-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
54 lines (43 loc) · 1.36 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
cmake_minimum_required(VERSION 3.10)
project(json_x_glfw_opengl3)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIRS})
set(GLFW_BUILD_DOCS OFF CACHE BOOL "GLFW lib only")
set(GLFW_INSTALL OFF CACHE BOOL "GLFW lib only")
add_subdirectory(glfw)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/imgui
${CMAKE_CURRENT_SOURCE_DIR}/imgui/backends
${CMAKE_CURRENT_SOURCE_DIR}/imnodes
${CMAKE_CURRENT_SOURCE_DIR}/json
${CMAKE_CURRENT_SOURCE_DIR}/json/nlohmann
${CMAKE_CURRENT_SOURCE_DIR}/json/nlohmann/thirdparty
${CMAKE_CURRENT_SOURCE_DIR}/ImGuiFileDialog
)
file(GLOB_RECURSE SOURCES
src/*.cpp
imgui/*.cpp
imgui/backends/*.cpp
ImGuiFileDialog/*.cpp
imnodes/*.cpp
)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(PLATFORM "-linux-amd64")
set(LIBS ${OPENGL_LIBRARIES})
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(PLATFORM "-macos-arm64")
set(LIBS ${OPENGL_LIBRARIES})
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(PLATFORM "-windows-amd64")
set(LIBS gdi32 opengl32 imm32)
endif()
set(SHA_SHORT "$ENV{SHA_SHORT}")
if(SHA_SHORT)
set(EXE "json_x_glfw_opengl3${PLATFORM}_${SHA_SHORT}")
else()
set(EXE "json_x_glfw_opengl3${PLATFORM}")
endif()
add_executable(${EXE} ${SOURCES})
target_link_libraries(${EXE} glfw ${LIBS})