-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
70 lines (63 loc) · 1.76 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CPP_COMPILER clang)
set(CMAKE_CXX_STANDARD 17)
project(poppy-engine)
project(${PROJECT_NAME} VERSION 1.0)
set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib)
set(SOURCES
${SRC_DIR})
set(ImGuiSources
main.cpp
imgui/imconfig.h
imgui/imgui_demo.cpp
imgui/imgui_draw.cpp
imgui/imgui_impl_glfw.cpp
imgui/imgui_impl_glfw.h
imgui/imgui_impl_opengl3.cpp
imgui/imgui_impl_opengl3.h
imgui/imgui_internal.h
imgui/imgui_widgets.cpp
imgui/imgui.cpp
imgui/imgui.h
imgui/imstb_rectpack.h
imgui/imstb_textedit.h
imgui/imstb_truetype.h
)
file(
GLOB sources
src/main.cpp
vendor/entt.h
imgui/examples/imgui_impl_opengl3.cpp
imgui/examples/imgui_impl_glfw.cpp
src/entt/*.h
src/entt/*.cpp
src/entt/components/*.cpp
src/entt/components/*.h
src/editor/*.cpp
src/editor/*.h
src
src/renderer/*.cpp
src/renderer/*.h
imgui/glad/glad.h
imgui/glad/glad.c
${ImGuiSources}
)
add_executable(${PROJECT_NAME} ${sources})
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(${PROJECT_NAME}
PRIVATE
${SRC_DIR}
imgui
${CMAKE_CURRENT_SOURCE_DIR}/glm
${CMAKE_CURRENT_SOURCE_DIR}/glew
imgui/glad
)
find_package(glfw3 3.2 REQUIRED)
target_link_libraries(${PROJECT_NAME} glfw)
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIRS})
link_directories(${OPENGL_LIBRARY_DIRS})
set(LIBS glfw dl ${OPENGL_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${LIBS})
add_compile_definitions(IMGUI_IMPL_OPENGL_LOADER_GLAD)