forked from Azzinoth/VisualNodeSystem-Example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
84 lines (67 loc) · 2.81 KB
/
Copy pathCMakeLists.txt
File metadata and controls
84 lines (67 loc) · 2.81 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
cmake_minimum_required(VERSION 3.10)
set(BUILD_TYPE "Debug and Release" CACHE STRING "Choose Build type")
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CONFIGURATION_TYPES Debug Release)
# set the project name
project(Visual_Node_System_Example LANGUAGES CXX)
# set different compiler flags depending on build type
set(CMAKE_CXX_FLAGS_DEBUG "/MP /ZI /W3 /Od /MDd /JMC /sdl /FC /D WIN32 /D IMGUI_IMPL_OPENGL_LOADER_GLEW /D _WINDOWS /D _DEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "/MP /W3 /O2 /Oi /Gy /sdl /FC /GL /OPT:REF /OPT:ICF /D WIN32 /D IMGUI_IMPL_OPENGL_LOADER_GLEW /D NDEBUG /D _WINDOWS")
# Turn on the ability to create folders to organize projects (.vcproj)
# It creates "CMakePredefinedTargets" folder by default and adds CMake
# defined projects like INSTALL.vcproj and ZERO_CHECK.vcproj
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Force your path to Dear ImGui
set(DEAR_IMGUI_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/imgui CACHE PATH "Path to Dear ImGui directory." FORCE)
if(NOT TARGET VisualNodeSystem)
add_subdirectory(SubSystems/VisualNodeSystem)
endif()
# *************** THIRD_PARTY ***************
file(GLOB imgui_SRC
"ThirdParty/imgui/imgui.cpp"
"ThirdParty/imgui/imgui_demo.cpp"
"ThirdParty/imgui/imgui_draw.cpp"
"ThirdParty/imgui/imgui_impl_glfw.cpp"
"ThirdParty/imgui/imgui_impl_opengl3.cpp"
"ThirdParty/imgui/imgui_tables.cpp"
"ThirdParty/imgui/imgui_widgets.cpp"
)
# *************** THIRD_PARTY END ***************
file(GLOB source_SRC
"CustomNode.h"
"CustomNode.cpp"
"CustomNode2.h"
"CustomNode2.cpp"
"CustomNode3.h"
"CustomNode3.cpp"
"CustomNode4.h"
"CustomNode4.cpp"
"CustomNodeStyleDemonstration.h"
"CustomNodeStyleDemonstration.cpp"
"main.cpp"
)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/glew2/lib/$(PlatformTarget))
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/GLFW/lib/$(PlatformTarget))
# add the executable
add_executable(Visual_Node_System_Example WIN32
${source_SRC}
# *************** THIRD_PARTY ***************
${imgui_SRC}
)
target_link_libraries(Visual_Node_System_Example VisualNodeSystem)
target_link_libraries(Visual_Node_System_Example glew32s.lib)
target_link_libraries(Visual_Node_System_Example glfw3.lib)
target_link_libraries(Visual_Node_System_Example glfw3dll.lib)
target_link_libraries(Visual_Node_System_Example opengl32.lib)
source_group("Source Files" FILES ${source_SRC})
# *************** THIRD_PARTY ***************
source_group("Source Files/ThirdParty/imgui" FILES ${imgui_SRC})
# set the startup project
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Visual_Node_System_Example)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/glew2/include
${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty
${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/imgui
${VISUAL_NODE_SYSTEM_DIR}
${VISUAL_NODE_SYSTEM_THIRDPARTY_DIR}
)