-
Notifications
You must be signed in to change notification settings - Fork 64
/
CMakeLists.txt
322 lines (278 loc) · 13.3 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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
PROJECT(octoon)
# CONAN依赖
IF(EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo_multi.cmake)
INCLUDE(${CMAKE_BINARY_DIR}/conanbuildinfo_multi.cmake)
conan_basic_setup()
else()
MESSAGE(WARNING "The file conanbuildinfo_multi.cmake doesn't exist, you have to run conan install first")
ENDIF()
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
LIST(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})
# 项目文件路径
SET(OCTOON_PATH ${PROJECT_SOURCE_DIR} CACHE STRING "Adds a path to octoon" FORCE)
SET(OCTOON_PATH_BIN ${OCTOON_PATH}/lib/ CACHE STRING "Adds a path to output dir" FORCE)
SET(OCTOON_PATH_DEPENDENCIES ${OCTOON_PATH}/contrib CACHE STRING "Adds a path to octoon dependencies" FORCE)
SET(OCTOON_PATH_SAMPLES ${OCTOON_PATH}/samples CACHE STRING "Adds a path to octoon samples" FORCE)
SET(OCTOON_PATH_INCLUDE ${OCTOON_PATH}/include CACHE STRING "Adds a path to octoon header" FORCE)
SET(OCTOON_PATH_HEADER ${OCTOON_PATH_INCLUDE}/octoon CACHE STRING "Adds a path to octoon header" FORCE)
SET(OCTOON_PATH_SOURCE ${OCTOON_PATH}/source CACHE STRING "Adds a path to octoon source" FORCE)
SET(OCTOON_PATH_DOCUMENT ${OCTOON_PATH}/document CACHE STRING "Adds a path to octoon document" FORCE)
OPTION(OCTOON_BUILD_DOCUMENT "ON to enable document generation" OFF)
OPTION(OCTOON_BUILD_AVX "ON for use OFF for ignore" ON)
OPTION(OCTOON_BUILD_DEBUG_MODE "ON for debug or OFF for release" ON)
OPTION(OCTOON_BUILD_SHARED_DLL "ON for dynamic OFF for static libraries" ON)
# 设置默认编译平台
IF(ANDROID_ABI OR CMAKE_SYSTEM_NAME MATCHES "VCMDDAndroid")
SET(PLATFORM 4)
SET(VCMDDAndroid 1)
ELSEIF(WIN32)
SET(PLATFORM 3)
ELSEIF(APPLE)
SET(PLATFORM 1)
ELSEIF(UNIX)
SET(PLATFORM 2)
ELSE()
SET(PLATFORM 3)
ENDIF()
# 设置编译平台
SET(OCTOON_BUILD_PLATFORM ${PLATFORM} CACHE STRING
"Specify the platform. Possible values:
1 - Apple
2 - Linux
3 - Windows
4 - Android
5 - Java
6 - Emscripten"
)
IF(OCTOON_BUILD_PLATFORM EQUAL 1)
SET(OCTOON_BUILD_PLATFORM_APPLE TRUE)
ADD_DEFINITIONS(-DOCTOON_BUILD_PLATFORM_APPLE)
ELSEIF(OCTOON_BUILD_PLATFORM EQUAL 2)
SET(OCTOON_BUILD_PLATFORM_LINUX TRUE)
ADD_DEFINITIONS(-DOCTOON_BUILD_PLATFORM_LINUX)
ELSEIF(OCTOON_BUILD_PLATFORM EQUAL 3)
SET(OCTOON_BUILD_PLATFORM_WINDOWS TRUE)
ADD_DEFINITIONS(-DOCTOON_BUILD_PLATFORM_WINDOWS)
ELSEIF(OCTOON_TARGET_PLATFORM EQUAL 4)
SET(OCTOON_BUILD_PLATFORM_ANDROID TRUE)
ADD_DEFINITIONS(-DOCTOON_BUILD_PLATFORM_ANDROID)
ELSEIF(OCTOON_BUILD_PLATFORM EQUAL 5)
SET(OCTOON_BUILD_PLATFORM_JAVA TRUE)
ADD_DEFINITIONS(-DOCTOON_BUILD_PLATFORM_JAVA)
ELSEIF(OCTOON_BUILD_PLATFORM EQUAL 6)
SET(OCTOON_BUILD_PLATFORM_EMSCRIPTEN TRUE)
ADD_DEFINITIONS(-DOCTOON_BUILD_PLATFORM_EMSCRIPTEN)
ELSE()
MESSAGE(FATAL_ERROR "Unsupported build platform: " ${OCTOON_BUILD_PLATFORM})
ENDIF()
IF(OCTOON_BUILD_DEBUG_MODE)
SET(CMAKE_BUILD_TYPE Debug CACHE STRING "One of None Debug Release RelWithDebInfo MinSizeRel" FORCE)
ELSE()
SET(CMAKE_BUILD_TYPE Release CACHE STRING "One of None Debug Release RelWithDebInfo MinSizeRel" FORCE)
ENDIF()
# 设置不同平台下链接时后缀
IF(OCTOON_BUILD_PLATFORM_LINUX OR OCTOON_BUILD_PLATFORM_ANDROID)
SET(PLATFORM_NAME "linux")
ELSEIF(OCTOON_BUILD_PLATFORM_APPLE)
SET(PLATFORM_NAME "apple")
ELSEIF(OCTOON_BUILD_PLATFORM_EMSCRIPTEN)
SET(PLATFORM_NAME "web")
ELSEIF(OCTOON_BUILD_PLATFORM_WINDOWS)
SET(PLATFORM_NAME "win")
ADD_DEFINITIONS(-D_WINDOWS)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING)
SET(COMPILER_NAME "vc")
IF(MSVC_VERSION GREATER 1600)
SET(COMPILER_NAME "11")
ELSEIF(MSVC_VERSION GREATER 1500)
SET(COMPILER_NAME "10")
ELSEIF(MSVC_VERSION GREATER 1400)
SET(COMPILER_NAME "9")
ENDIF()
ENDIF()
IF(CMAKE_GENERATOR MATCHES "ARM" OR CMAKE_GENERATOR_PLATFORM MATCHES "ARM")
SET(LIBRARY_OUT_NAME "ARM")
ELSEIF(CMAKE_GENERATOR MATCHES "Win64" OR CMAKE_GENERATOR_PLATFORM MATCHES "x64" OR VCPKG_TARGET_TRIPLET MATCHES "x64-windows" OR CMAKE_EXE_LINKER_FLAGS MATCHES "/machine:x64")
SET(LIBRARY_OUT_NAME "64")
SET(WIN64 TRUE)
ELSEIF(CMAKE_GENERATOR MATCHES "Visual Studio" OR VCPKG_TARGET_TRIPLET MATCHES "x86-windows")
SET(LIBRARY_OUT_NAME "86")
SET(WIN32 TRUE)
ELSE()
SET(LIBRARY_OUT_NAME "86")
ENDIF()
# CXX 14 扩展
SET(CMAKE_CXX_STANDARD 20)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_CXX_EXTENSIONS OFF)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
INCLUDE(cmake/CXXModules.cmake)
# 设置编译文件后缀
SET(CMAKE_DEBUG_POSTFIX "_d" CACHE STRING "Adds a postfix for debug-built libraries.")
SET(CMAKE_RELEASE_POSTFIX "" CACHE STRING "Adds a postfix for release-built libraries.")
SET(CMAKE_RELWITHDEBINFO_POSTFIX "_RelWithDebInfo" CACHE STRING "Adds a postfix for ReleaseWithDebug-built libraries.")
SET(CMAKE_MINSIZEREL_POSTFIX "_MinsizeRel" CACHE STRING "Adds a postfix for MinsizeRelease-built libraries.")
# 指定库文件输出路径
SET(OCTOON_LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib/binaries/${PLATFORM_NAME}${LIBRARY_OUT_NAME} CACHE STRING "build path" FORCE)
SET(OCTOON_LIBRARY_OUTPUT_PATH_DEBUG ${OCTOON_LIBRARY_OUTPUT_PATH}_Debug CACHE STRING "build path" FORCE)
SET(OCTOON_LIBRARY_OUTPUT_PATH_RELEASE ${OCTOON_LIBRARY_OUTPUT_PATH}_Release CACHE STRING "build path" FORCE)
SET(OCTOON_LIBRARY_OUTPUT_PATH_RELWITHDEBINFO ${OCTOON_LIBRARY_OUTPUT_PATH}_RelWithDebInfo CACHE STRING "build path" FORCE)
SET(OCTOON_LIBRARY_OUTPUT_PATH_MINSIZEREL ${OCTOON_LIBRARY_OUTPUT_PATH}_MinsizeRel CACHE STRING "build path" FORCE)
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
FUNCTION(TARGET_COPY_TO_OUTPUT_DIR)
SET(options)
SET(oneValueArgs TARGET RELATIVE DEST_SUBFOLDER)
SET(multiValueArgs FILES)
CMAKE_PARSE_ARGUMENTS(TARGET_COPY_TO_OUTPUT_DIR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
FOREACH(_ELEMENT ${TARGET_COPY_TO_OUTPUT_DIR_FILES} )
IF(TARGET_COPY_TO_OUTPUT_DIR_RELATIVE)
SET(_SOURCE_FILE ${TARGET_COPY_TO_OUTPUT_DIR_RELATIVE}/${_ELEMENT})
SET(_FOLDER_PATH ${_ELEMENT})
ELSE()
SET(_SOURCE_FILE ${_ELEMENT})
GET_FILENAME_COMPONENT(_FOLDER_PATH ${_ELEMENT} NAME)
SET(_ELEMENT "")
ENDIF()
# handle directories and files slightly different
IF(IS_DIRECTORY ${_SOURCE_FILE})
IF(MDL_LOG_FILE_DEPENDENCIES)
MESSAGE(STATUS "- folder to copy: ${_SOURCE_FILE}")
ENDIF()
ADD_CUSTOM_COMMAND(
TARGET ${TARGET_COPY_TO_OUTPUT_DIR_TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_SOURCE_FILE} $<TARGET_FILE_DIR:${TARGET_COPY_TO_OUTPUT_DIR_TARGET}>/${TARGET_COPY_TO_OUTPUT_DIR_DEST_SUBFOLDER}${_FOLDER_PATH}
)
ELSE()
IF(MDL_LOG_FILE_DEPENDENCIES)
MESSAGE(STATUS "- file to copy: ${_SOURCE_FILE}")
ENDIF()
ADD_CUSTOM_COMMAND(
TARGET ${TARGET_COPY_TO_OUTPUT_DIR_TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${_SOURCE_FILE} $<TARGET_FILE_DIR:${TARGET_COPY_TO_OUTPUT_DIR_TARGET}>/${TARGET_COPY_TO_OUTPUT_DIR_DEST_SUBFOLDER}${_ELEMENT}
)
ENDIF()
ENDFOREACH()
ENDFUNCTION()
MACRO(SET_TARGET_ATTRIBUTE target directory)
SET_TARGET_PROPERTIES(${target} PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${OCTOON_LIBRARY_OUTPUT_PATH}
ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${OCTOON_LIBRARY_OUTPUT_PATH_DEBUG}
ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${OCTOON_LIBRARY_OUTPUT_PATH_RELEASE}
ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO ${OCTOON_LIBRARY_OUTPUT_PATH_RELWITHDEBINFO}
ARCHIVE_OUTPUT_DIRECTORY_MINSIZEREL ${OCTOON_LIBRARY_OUTPUT_PATH_MINSIZEREL}
LIBRARY_OUTPUT_DIRECTORY ${OCTOON_LIBRARY_OUTPUT_PATH}
LIBRARY_OUTPUT_DIRECTORY_DEBUG ${OCTOON_LIBRARY_OUTPUT_PATH_DEBUG}
LIBRARY_OUTPUT_DIRECTORY_RELEASE ${OCTOON_LIBRARY_OUTPUT_PATH_RELEASE}
LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO ${OCTOON_LIBRARY_OUTPUT_PATH_RELWITHDEBINFO}
LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL ${OCTOON_LIBRARY_OUTPUT_PATH_MINSIZEREL}
RUNTIME_OUTPUT_DIRECTORY ${OCTOON_LIBRARY_OUTPUT_PATH}
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${OCTOON_LIBRARY_OUTPUT_PATH_DEBUG}
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${OCTOON_LIBRARY_OUTPUT_PATH_RELEASE}
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${OCTOON_LIBRARY_OUTPUT_PATH_RELWITHDEBINFO}
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${OCTOON_LIBRARY_OUTPUT_PATH_MINSIZEREL}
)
SET_TARGET_PROPERTIES(${target} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
SET_TARGET_PROPERTIES(${target} PROPERTIES PROJECT_LABEL ${target})
SET_TARGET_PROPERTIES(${target} PROPERTIES FOLDER ${directory})
IF(MINGW OR CMAKE_GENERATOR MATCHES "Unix")
STRING(REGEX REPLACE "lib" "" target_name ${target})
SET_TARGET_PROPERTIES(${target} PROPERTIES OUTPUT_NAME ${target_name})
ENDIF()
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
SET_TARGET_PROPERTIES(${target} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${OCTOON_LIBRARY_OUTPUT_PATH}_${CMAKE_CFG_INTDIR})
IF(VCMDDAndroid)
SET_PROPERTY(TARGET ${target} PROPERTY VC_MDD_ANDROID_API_LEVEL "android-21")
ELSEIF(${CMAKE_VS_PLATFORM_TOOLSET} STREQUAL "v140_clang_3_7")
SET_PROPERTY(TARGET ${target} PROPERTY VS_PLATFORM_TOOLSET_OVERRIDE "v140_clang_3_7")
ENDIF()
ENDIF()
ENDMACRO()
IF(CMAKE_GENERATOR MATCHES "Unix" OR CMAKE_GENERATOR MATCHES "MinGW")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wignored-qualifiers")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -finput-charset=utf-8")
IF(CMAKE_GENERATOR MATCHES "MinGW")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wlogical-op-parentheses")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Winconsistent-missing-override")
ENDIF()
IF(CMAKE_GENERATOR MATCHES "Unix")
SET(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
ENDIF()
IF(OCTOON_BUILD_AVX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse")
ENDIF()
ELSEIF(CMAKE_GENERATOR MATCHES "Xcode")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -frtti")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
ELSEIF(CMAKE_GENERATOR MATCHES "Visual Studio")
IF(${CMAKE_VS_PLATFORM_TOOLSET} STREQUAL "v140_clang_3_7" OR ${CMAKE_VS_PLATFORM_TOOLSET} STREQUAL VCMDDAndroid)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -frtti")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
ELSE()
# 运行时类型信息
SET(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /GR")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR")
# 快速的浮点模型
SET(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast")
# 多处理器编译
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
SET(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /W0")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /openmp")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /openmp")
# SEH
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /EHa")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /EHa")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /EHa")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /EHa")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ob2")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ot")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
IF(OCTOON_BUILD_AVX)
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:AVX")
ENDIF()
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /subsystem:windows")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /entry:mainCRTStartup")
ENDIF()
ENDIF()
# 添加依赖库
ADD_SUBDIRECTORY(contrib)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /permissive-")
endif(MSVC)
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
IF(${CMAKE_VS_PLATFORM_TOOLSET} STREQUAL "v140_clang_3_7" OR ${CMAKE_VS_PLATFORM_TOOLSET} STREQUAL VCMDDAndroid)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Wall")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wreorder") # field 'x' will be initialized after field 'y'
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wshift-negative-value")
ELSE()
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W4")
# W3
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4251") # needs to have dll-interface to be used by clients of class
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4275") # 非 dll 接口 class“std::exception”用作 dll 接口 class“Exception”的基
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4611") # setjmp
# W4
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4100") # 未引用的形参
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4201") # 使用了非标准扩展: 无名称的结构/联合
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4099") # 缺少第三方的调试信息文件
ENDIF()
ENDIF()
# 添加项目
ADD_SUBDIRECTORY(source)
# 示例
ADD_SUBDIRECTORY(samples)
# doxygen API document
IF(OCTOON_BUILD_DOCUMENT)
ADD_SUBDIRECTORY(document)
ENDIF()