-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
37 lines (27 loc) · 1.02 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
cmake_minimum_required(VERSION 3.14)
project(652ahs)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Find OpenGL
find_package(OpenGL REQUIRED)
find_package(SQLite3 REQUIRED)
# ImGui
set(IMGUI_DIR ${CMAKE_SOURCE_DIR}/libs/imgui)
set(IMGUI_INCLUDE_DIR ${IMGUI_DIR} ${IMGUI_DIR}/backends)
# glfw
set(GLFW_DIR ${CMAKE_SOURCE_DIR}/libs/glfw)
file(GLOB IMGUI_SOURCES ${IMGUI_DIR}/*.cpp)
set(IMGUI_IMPL_SOURCES ${IMGUI_DIR}/backends/imgui_impl_opengl3.cpp
${IMGUI_DIR}/backends/imgui_impl_glfw.cpp)
# Add source files
file(GLOB_RECURSE SOURCES src/*.cpp)
file(GLOB_RECURSE SOURCES src/*.cpp ${IMGUI_SOURCES} ${IMGUI_IMPL_SOURCES})
add_subdirectory(${GLFW_DIR})
# Create the executable
add_executable(652ahs ${SOURCES} ${IMGUI_SOURCES} ${IMGUI_IMPL_SOURCES})
# Link libraries
target_link_libraries(652ahs PRIVATE glfw OpenGL::GL sqlite3)
# Include directories
target_include_directories(
652ahs PRIVATE ${CMAKE_SOURCE_DIR}/include ${IMGUI_INCLUDE_DIR}
${BOOST_ASIO_INCLUDE_DIR})