forked from kovacsv/VisualScriptEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
299 lines (265 loc) · 12.1 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
cmake_minimum_required (VERSION 3.6)
set (VSE_VERSION_1 0)
set (VSE_VERSION_2 5)
set (VSE_VERSION_3 6)
set (VSE_LIB_NAME VisualScriptEngine)
set (VSE_CUSTOM_BUILD_OPTIONS ${VSE_CUSTOM_BUILD_OPTIONS})
function (SetCompilerOptions module)
target_compile_options (${module} PUBLIC "$<$<CONFIG:Debug>:-DDEBUG>")
if (MSVC)
set (AdditionalWarnings /w44061 /w44062 /w44265 /w44266 /w44355 /w44596 /w44800)
target_compile_options (${module} PUBLIC /W4 /WX ${AdditionalWarnings} ${VSE_CUSTOM_BUILD_OPTIONS})
else ()
target_compile_options (${module} PUBLIC -std=c++11 -Wall -Wextra -Werror ${VSE_CUSTOM_BUILD_OPTIONS})
endif ()
endfunction ()
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
set (CMAKE_SUPPRESS_REGENERATION 1)
set (CMAKE_CONFIGURATION_TYPES Debug;Release;RelWithDebInfo)
set (CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/DevKit CACHE PATH "Install prefix.")
set (CMAKE_DEBUG_POSTFIX "Debug")
add_definitions (-DUNICODE -D_UNICODE)
project (VisualScriptEngine)
enable_testing ()
# NodeEngine
set (NodeEngineSourcesFolder Sources/NodeEngine)
file (GLOB NodeEngineHeaderFiles ${NodeEngineSourcesFolder}/*.hpp)
file (GLOB NodeEngineSourceFiles ${NodeEngineSourcesFolder}/*.cpp)
set (
NodeEngineFiles
${NodeEngineHeaderFiles}
${NodeEngineSourceFiles}
)
source_group ("Sources" FILES ${NodeEngineFiles})
add_library (NodeEngine STATIC ${NodeEngineFiles})
set_target_properties (NodeEngine PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIG>")
target_include_directories (NodeEngine PUBLIC ${NodeEngineSourcesFolder})
SetCompilerOptions (NodeEngine)
install (TARGETS NodeEngine DESTINATION lib)
install (FILES ${NodeEngineHeaderFiles} DESTINATION include)
install (FILES ${NodeEngineSourceFiles} DESTINATION source)
# NodeUIEngine
set (NodeUIEngineSourcesFolder Sources/NodeUIEngine)
configure_file (${NodeUIEngineSourcesFolder}/NUIE_VersionInfo.hpp.in ${PROJECT_BINARY_DIR}/NUIE_VersionInfo.hpp)
include_directories (${PROJECT_BINARY_DIR})
file (GLOB NodeUIEngineHeaderFiles ${NodeUIEngineSourcesFolder}/*.hpp ${PROJECT_BINARY_DIR}/NUIE_VersionInfo.hpp)
file (GLOB NodeUIEngineSourceFiles ${NodeUIEngineSourcesFolder}/*.cpp)
set (
NodeUIEngineFiles
${NodeUIEngineHeaderFiles}
${NodeUIEngineSourceFiles}
)
source_group ("Sources" FILES ${NodeUIEngineFiles})
add_library (NodeUIEngine STATIC ${NodeUIEngineFiles})
set_target_properties (NodeUIEngine PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIG>")
target_include_directories (NodeUIEngine PUBLIC ${NodeEngineSourcesFolder} ${NodeUIEngineSourcesFolder})
target_link_libraries (NodeUIEngine NodeEngine)
SetCompilerOptions (NodeUIEngine)
install (TARGETS NodeUIEngine DESTINATION lib)
install (FILES ${NodeUIEngineHeaderFiles} DESTINATION include)
install (FILES ${NodeUIEngineSourceFiles} DESTINATION source)
# BuiltInNodes
set (BuiltInNodesSourcesFolder Sources/BuiltInNodes)
file (GLOB BuiltInNodesHeaderFiles ${BuiltInNodesSourcesFolder}/*.hpp)
file (GLOB BuiltInNodesSourceFiles ${BuiltInNodesSourcesFolder}/*.cpp)
set (
BuiltInNodesFiles
${BuiltInNodesHeaderFiles}
${BuiltInNodesSourceFiles}
)
source_group ("Sources" FILES ${BuiltInNodesFiles})
add_library (BuiltInNodes STATIC ${BuiltInNodesFiles})
set_target_properties (BuiltInNodes PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIG>")
target_include_directories (BuiltInNodes PUBLIC ${NodeEngineSourcesFolder} ${NodeUIEngineSourcesFolder} ${BuiltInNodesSourcesFolder})
target_link_libraries (BuiltInNodes NodeEngine NodeUIEngine)
SetCompilerOptions (BuiltInNodes)
install (TARGETS BuiltInNodes DESTINATION lib)
install (FILES ${BuiltInNodesHeaderFiles} DESTINATION include)
install (FILES ${BuiltInNodesSourceFiles} DESTINATION source)
# Localization
set (LocalizationSourcesFolder Sources/Localization)
file (GLOB LocalizationFiles ${LocalizationSourcesFolder}/*.po)
install (FILES ${LocalizationFiles} DESTINATION localization)
# NodeEngineTest
set (TestFrameworkSourcesFolder Sources/TestFramework)
set (TestEnvironmentSourcesFolder Sources/NodeEngineTest/TestEnvironment)
set (NodeEngineTestSourcesFolder Sources/NodeEngineTest)
file (GLOB TestFrameworkFiles ${TestFrameworkSourcesFolder}/*.hpp ${TestFrameworkSourcesFolder}/*.cpp)
file (GLOB TestEnvironmentFiles ${TestEnvironmentSourcesFolder}/*.hpp ${TestEnvironmentSourcesFolder}/*.cpp)
file (GLOB NodeEngineTestHeaderFiles ${NodeEngineTestSourcesFolder}/*.hpp)
file (GLOB NodeEngineTestSourceFiles ${NodeEngineTestSourcesFolder}/*.cpp)
set (
NodeEngineTestTestFiles
${NodeEngineTestHeaderFiles}
${NodeEngineTestSourceFiles}
)
set (
NodeEngineTestFiles
${TestFrameworkFiles}
${TestEnvironmentFiles}
${NodeEngineTestTestFiles}
)
source_group ("Framework" FILES ${TestFrameworkFiles})
source_group ("Environment" FILES ${TestEnvironmentFiles})
source_group ("Sources" FILES ${NodeEngineTestTestFiles})
add_executable (NodeEngineTest ${NodeEngineTestFiles})
set_target_properties (NodeEngineTest PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIG>")
target_include_directories (
NodeEngineTest PUBLIC
${NodeEngineSourcesFolder}
${NodeUIEngineSourcesFolder}
${BuiltInNodesSourcesFolder}
${TestFrameworkSourcesFolder}
${TestEnvironmentSourcesFolder}
)
target_link_libraries (NodeEngineTest NodeEngine NodeUIEngine BuiltInNodes)
get_filename_component (NodeEngineTestSourcesFolderAbsolute "${CMAKE_CURRENT_LIST_DIR}/${NodeEngineTestSourcesFolder}" ABSOLUTE)
add_custom_command (TARGET NodeEngineTest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${NodeEngineTestSourcesFolderAbsolute}/VisualTestFiles $<TARGET_FILE_DIR:NodeEngineTest>/VisualTestFiles
COMMAND ${CMAKE_COMMAND} -E copy_directory ${NodeEngineTestSourcesFolderAbsolute}/CompatibilityTestFiles $<TARGET_FILE_DIR:NodeEngineTest>/CompatibilityTestFiles
)
SetCompilerOptions (NodeEngineTest)
add_test (NodeEngineTest NodeEngineTest)
# EmbeddingTutorial
set (EmbeddingTutorialSourcesFolder Sources/EmbeddingTutorial)
file (GLOB EmbeddingTutorialHeaderFiles ${EmbeddingTutorialSourcesFolder}/*.hpp)
file (GLOB EmbeddingTutorialSourceFiles ${EmbeddingTutorialSourcesFolder}/*.cpp)
set (
EmbeddingTutorialFiles
${EmbeddingTutorialHeaderFiles}
${EmbeddingTutorialSourceFiles}
)
source_group ("Sources" FILES ${EmbeddingTutorialFiles})
add_executable (EmbeddingTutorial ${EmbeddingTutorialFiles})
set_target_properties (EmbeddingTutorial PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIG>")
target_include_directories (
EmbeddingTutorial PUBLIC
${NodeEngineSourcesFolder}
${NodeUIEngineSourcesFolder}
${BuiltInNodesSourcesFolder}
)
target_link_libraries (EmbeddingTutorial NodeEngine NodeUIEngine BuiltInNodes)
SetCompilerOptions (EmbeddingTutorial)
if (MSVC)
target_compile_options (EmbeddingTutorial PUBLIC /wd4100)
else ()
target_compile_options (EmbeddingTutorial PUBLIC -Wno-unused-parameter)
endif ()
if (WIN32)
# WindowsAppSupport
set (WindowsAppSupportSourcesFolder Sources/WindowsAppSupport)
file (GLOB WindowsAppSupportHeaderFiles ${WindowsAppSupportSourcesFolder}/*.hpp)
file (GLOB WindowsAppSupportSourceFiles ${WindowsAppSupportSourcesFolder}/*.cpp)
set (
WindowsAppSupportFiles
${WindowsAppSupportHeaderFiles}
${WindowsAppSupportSourceFiles}
)
source_group ("Sources" FILES ${WindowsAppSupportFiles})
add_library (WindowsAppSupport STATIC ${WindowsAppSupportFiles})
set_target_properties (WindowsAppSupport PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIG>")
target_include_directories (WindowsAppSupport PUBLIC ${NodeEngineSourcesFolder} ${NodeUIEngineSourcesFolder} ${WindowsAppSupportSourcesFolder})
target_link_libraries (WindowsAppSupport NodeEngine NodeUIEngine)
SetCompilerOptions (WindowsAppSupport)
install (TARGETS WindowsAppSupport DESTINATION lib)
install (FILES ${WindowsAppSupportHeaderFiles} DESTINATION include)
install (FILES ${WindowsAppSupportSourceFiles} DESTINATION source)
# WindowsReferenceApp
set (WindowsReferenceAppSourcesFolder Sources/WindowsReferenceApp)
file (GLOB WindowsReferenceAppHeaderFiles ${WindowsReferenceAppSourcesFolder}/*.hpp)
file (GLOB WindowsReferenceAppSourceFiles
${WindowsReferenceAppSourcesFolder}/*.cpp
${WindowsReferenceAppSourcesFolder}/*.rc
${WindowsReferenceAppSourcesFolder}/*.manifest
)
set (
WindowsReferenceAppFiles
${WindowsReferenceAppHeaderFiles}
${WindowsReferenceAppSourceFiles}
)
source_group ("Sources" FILES ${WindowsReferenceAppFiles})
add_executable (WindowsReferenceApp WIN32 ${WindowsReferenceAppFiles})
set_target_properties (WindowsReferenceApp PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIG>")
target_include_directories (
WindowsReferenceApp PUBLIC
${NodeEngineSourcesFolder}
${NodeUIEngineSourcesFolder}
${BuiltInNodesSourcesFolder}
${WindowsAppSupportSourcesFolder}
)
target_link_libraries (WindowsReferenceApp NodeEngine NodeUIEngine BuiltInNodes WindowsAppSupport)
SetCompilerOptions (WindowsReferenceApp)
# WindowsEmbeddingDemo
set (WindowsEmbeddingDemoSourcesFolder Sources/WindowsEmbeddingDemo)
file (GLOB WindowsEmbeddingDemoHeaderFiles ${WindowsEmbeddingDemoSourcesFolder}/*.hpp)
file (GLOB WindowsEmbeddingDemoSourceFiles ${WindowsEmbeddingDemoSourcesFolder}/*.cpp)
set (
WindowsEmbeddingDemoFiles
${WindowsEmbeddingDemoHeaderFiles}
${WindowsEmbeddingDemoSourceFiles}
)
source_group ("Sources" FILES ${WindowsEmbeddingDemoFiles})
add_executable (WindowsEmbeddingDemo WIN32 ${WindowsEmbeddingDemoFiles})
set_target_properties (WindowsEmbeddingDemo PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIG>")
target_include_directories (
WindowsEmbeddingDemo PUBLIC
${NodeEngineSourcesFolder}
${NodeUIEngineSourcesFolder}
${BuiltInNodesSourcesFolder}
${WindowsAppSupportSourcesFolder}
)
target_link_libraries (WindowsEmbeddingDemo NodeEngine NodeUIEngine BuiltInNodes WindowsAppSupport)
SetCompilerOptions (WindowsEmbeddingDemo)
endif ()
if (APPLE)
find_library (CocoaFramework Cocoa)
# MacOSAppSupport
set (MacOSAppSupportSourcesFolder Sources/MacOSAppSupport)
file (GLOB MacOSAppSupportHeaderFiles ${MacOSAppSupportSourcesFolder}/*.hpp)
file (GLOB MacOSAppSupportSourceFiles ${MacOSAppSupportSourcesFolder}/*.cpp ${MacOSAppSupportSourcesFolder}/*.mm)
set (
MacOSAppSupportFiles
${MacOSAppSupportHeaderFiles}
${MacOSAppSupportSourceFiles}
)
source_group ("Sources" FILES ${MacOSAppSupportFiles})
add_library (MacOSAppSupport STATIC ${MacOSAppSupportFiles})
set_target_properties (MacOSAppSupport PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIG>")
target_include_directories (MacOSAppSupport PUBLIC ${NodeEngineSourcesFolder} ${NodeUIEngineSourcesFolder} ${MacOSAppSupportSourcesFolder})
target_link_libraries (MacOSAppSupport ${CocoaFramework})
target_link_libraries (MacOSAppSupport NodeEngine NodeUIEngine)
SetCompilerOptions (MacOSAppSupport)
install (TARGETS MacOSAppSupport DESTINATION lib)
install (FILES ${MacOSAppSupportHeaderFiles} DESTINATION include)
install (FILES ${MacOSAppSupportSourceFiles} DESTINATION source)
# MacOSEmbeddingDemo
set (MacOSEmbeddingDemoSourcesFolder Sources/MacOSEmbeddingDemo)
file (GLOB MacOSEmbeddingDemoHeaderFiles ${MacOSEmbeddingDemoSourcesFolder}/*.hpp)
file (GLOB MacOSEmbeddingDemoSourceFiles
${MacOSEmbeddingDemoSourcesFolder}/*.cpp
${MacOSEmbeddingDemoSourcesFolder}/*.mm
)
set (
MacOSEmbeddingDemoFiles
${MacOSEmbeddingDemoHeaderFiles}
${MacOSEmbeddingDemoSourceFiles}
)
set (
MacOSEmbeddingDemoResourceFiles
)
source_group ("Sources" FILES ${MacOSEmbeddingDemoFiles})
file (GLOB_RECURSE MacOSEmbeddingDemoResourceFiles ${MacOSEmbeddingDemoSourcesFolder}/icons/*.png)
add_executable (MacOSEmbeddingDemo MACOSX_BUNDLE ${MacOSEmbeddingDemoFiles} ${MacOSEmbeddingDemoResourceFiles})
set_source_files_properties (${MacOSEmbeddingDemoResourceFiles} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set_target_properties (MacOSEmbeddingDemo PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIG>")
target_include_directories (
MacOSEmbeddingDemo PUBLIC
${NodeEngineSourcesFolder}
${NodeUIEngineSourcesFolder}
${BuiltInNodesSourcesFolder}
${MacOSAppSupportSourcesFolder}
)
target_link_libraries (MacOSEmbeddingDemo ${CocoaFramework})
target_link_libraries (MacOSEmbeddingDemo NodeEngine NodeUIEngine BuiltInNodes MacOSAppSupport)
SetCompilerOptions (MacOSEmbeddingDemo)
endif ()