-
Notifications
You must be signed in to change notification settings - Fork 945
/
CMakeLists.txt
63 lines (51 loc) · 2.12 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
cmake_minimum_required( VERSION 3.10 FATAL_ERROR )
set( CMAKE_VERBOSE_MAKEFILE ON )
# Configure the Android toolchain before the project start
if( CINDER_TARGET )
string( TOLOWER "${CINDER_TARGET}" CINDER_TARGET_LOWER )
if( "android" STREQUAL "${CINDER_TARGET_LOWER}" )
include( "${CMAKE_CURRENT_SOURCE_DIR}/proj/cmake/modules/cinderAndroidToolchain.cmake" )
endif()
endif()
# Project start
project( cinder )
option( CINDER_BUILD_TESTS "Build unit tests." OFF )
option( CINDER_BUILD_ALL_SAMPLES "Build all samples." OFF )
set( CINDER_BUILD_SAMPLE "" CACHE STRING "Build a specific sample by specifying its path relative to the samples directory (ex. '_opengl/Cube')." )
set( CINDER_PATH "${CMAKE_CURRENT_SOURCE_DIR}" )
set( CINDER_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/proj/cmake" )
include( ${CINDER_CMAKE_DIR}/configure.cmake )
include( ${CINDER_CMAKE_DIR}/libcinder_configure.cmake )
include( ${CINDER_CMAKE_DIR}/libcinder_source_files.cmake )
set( CINDER_SKIP_SAMPLES "" )
if( CINDER_LINUX )
include( "${CINDER_CMAKE_DIR}/platform_linux.cmake" )
elseif( CINDER_MAC )
include( "${CINDER_CMAKE_DIR}/platform_macosx.cmake" )
elseif( CINDER_ANDROID )
include( "${CINDER_CMAKE_DIR}/platform_android.cmake" )
elseif( CINDER_MSW )
include( "${CINDER_CMAKE_DIR}/platform_msw.cmake" )
else()
message( FATAL_ERROR "no target defined for system: '${CMAKE_SYSTEM_NAME}.'" )
endif()
include( ${CINDER_CMAKE_DIR}/libcinder_target.cmake )
if( CINDER_BUILD_ALL_SAMPLES )
include( ${CINDER_CMAKE_DIR}/modules/findCMakeDirs.cmake )
set( allSamples "" )
findCMakeDirs( allSamples "${CINDER_PATH}/samples" "${CINDER_SKIP_SAMPLES}" )
foreach( sampleDir ${allSamples} )
ci_log_v( "adding sample: ${sampleDir}" )
add_subdirectory( ${sampleDir} )
endforeach()
elseif( CINDER_BUILD_SAMPLE )
foreach( sampleDir ${CINDER_BUILD_SAMPLE} )
ci_log_v( "adding sample: ${sampleDir}" )
add_subdirectory( ${CINDER_PATH}/samples/${sampleDir}/proj/cmake )
endforeach()
endif()
if( CINDER_BUILD_TESTS )
enable_testing()
add_subdirectory( ${CINDER_PATH}/test/unit/proj/cmake )
add_custom_target( check COMMAND ${CMAKE_CTEST_COMMAND} --verbose )
endif()