forked from nyue/imnodes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
142 lines (118 loc) · 2.22 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
cmake_minimum_required(VERSION 3.14)
project ( imnodes )
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package ( OpenGL REQUIRED )
if (WIN32)
find_package ( SDL )
include_directories (
${SDL_INCLUDE_DIR}
)
set(sdl_link_library ${SDL_LIBRARY})
else()
find_package ( SDL2 )
include_directories (
${SDL2_INCLUDE_DIRS}
)
set(sdl_link_library SDL2)
endif()
if (APPLE)
find_package ( X11 REQUIRED )
find_library(CORE_FOUNDATION Foundation)
if (NOT CORE_FOUNDATION)
message(FATAL_ERROR "Foundation not found")
endif()
endif()
include_directories (
gl3w/include
imgui
.
${X11_INCLUDE_DIR}
)
add_library ( gl3w STATIC
gl3w/src/gl3w.c
)
add_library ( imgui STATIC
imgui/imgui.cpp
imgui/imgui_draw.cpp
imgui/imgui_impl_opengl3.cpp
imgui/imgui_impl_sdl.cpp
imgui/imgui_widgets.cpp
)
add_library ( imnodes STATIC
imnodes.cpp
)
set ( imnodes_link_libraries
${sdl_link_library}
gl3w
imgui
imnodes
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${CMAKE_DL_LIBS}
${X11_LIBRARIES}
${CORE_FOUNDATION}
)
add_executable ( color_node_editor WIN32
example/color_node_editor.cpp
example/main.cpp
)
add_executable ( multi_editor WIN32
example/multi_editor.cpp
example/main.cpp
)
add_executable ( save_load WIN32
example/save_load.cpp
example/main.cpp
)
add_executable ( simple WIN32
example/simple.cpp
example/main.cpp
)
target_link_libraries ( color_node_editor
${imnodes_link_libraries}
)
target_link_libraries ( multi_editor
${imnodes_link_libraries}
)
target_link_libraries ( save_load
${imnodes_link_libraries}
)
target_link_libraries ( simple
${imnodes_link_libraries}
)
install ( TARGETS
gl3w
imgui
imnodes
DESTINATION
lib
)
install ( FILES
imnodes.h
DESTINATION
include/imnodes
)
install ( FILES
imgui/imconfig.h
imgui/imgui.h
imgui/imgui_impl_opengl3.h
imgui/imgui_impl_sdl.h
imgui/imgui_internal.h
imgui/imstb_rectpack.h
imgui/imstb_textedit.h
imgui/imstb_truetype.h
DESTINATION
include/imgui
)
install ( FILES
gl3w/include/GL/gl3w.h
gl3w/include/GL/glcorearb.h
DESTINATION
include/gl3w/GL
)
install ( FILES
cmake/imnodesConfig.cmake
DESTINATION
lib/cmake
)