-
Notifications
You must be signed in to change notification settings - Fork 964
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
67 lines (56 loc) · 2.37 KB
/
CMakeLists.txt
File metadata and controls
67 lines (56 loc) · 2.37 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
cmake_minimum_required( VERSION 3.16 FATAL_ERROR )
set( CMAKE_VERBOSE_MAKEFILE ON )
if( POLICY CMP0091 )
cmake_policy( SET CMP0091 NEW )
endif()
# 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_COCOA_TOUCH )
include( "${CINDER_CMAKE_DIR}/platform_ios.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 )
add_subdirectory( ${CINDER_PATH}/samples/_AllSamples )
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()
# Set output directory so tests are in a predictable location within the build tree
if( ( "${CMAKE_GENERATOR}" MATCHES "Visual Studio.+" ) OR ( "Xcode" STREQUAL "${CMAKE_GENERATOR}" ) )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
else()
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}" )
endif()
add_subdirectory( ${CINDER_PATH}/test/unit/proj/cmake )
add_custom_target( check COMMAND ${CMAKE_CTEST_COMMAND} --verbose )
endif()