forked from BioGearsEngine/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
96 lines (87 loc) · 4.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
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
###############################################################################
# CMAKE DEFINITIONS AND setTINGS
#
# Requires the following environmental variables:
#
# BUILD TYPE ENV VARIABLE Description
# ANDROID ANDROID_NDK Android NDK root folder location
# (also required for toolchain file)
# ANDROID GRADLE_EXECUTABLE Location of the Gradle executable
###############################################################################
set(ROOT_PROJECT_NAME Biogears)
set(${ROOT_PROJECT_NAME}_CMAKE_MIN_VERSION 3.11.0)
set(${ROOT_PROJECT_NAME}_CMAKE_POLICY 3.11.0)
cmake_minimum_required(VERSION ${${ROOT_PROJECT_NAME}_CMAKE_MIN_VERSION})
include(cmake/cmake-common_logic.cmake)
set(${ROOT_PROJECT_NAME}_VERSION_MAJOR 6)
set(${ROOT_PROJECT_NAME}_VERSION_MINOR 4)
set(${ROOT_PROJECT_NAME}_VERSION_PATCH 0)
set(${ROOT_PROJECT_NAME}_VERSION_TAG "-beta")
################################################################################
# STEP 1:
# Change this to custimize your project
################################################################################
project( ${ROOT_PROJECT_NAME} LANGUAGES CXX C)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${PROJECT_SOURCE_DIR}/cmake/common )
list(APPEND CMAKE_PREFIX_PATH ${ARA_${ROOT_PROJECT_NAME}_EXTERNAL} )
list(APPEND CMAKE_LIBRARY_PATH ${ARA_${ROOT_PROJECT_NAME}_EXTERNAL}/lib )
list(APPEND CMAKE_INCLUDE_PATH ${ARA_${ROOT_PROJECT_NAME}_EXTERNAL}/include )
message(STATUS "
Using the following search paths
CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}
CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}
CMAKE_LIBRARY_PATH = ${CMAKE_LIBRARY_PATH}
CMAKE_INCLUDE_PATH = ${CMAKE_INCLUDE_PATH}
CMAKE_FIND_ROOT_PATH = ${CMAKE_FIND_ROOT_PATH}
")
###############################################################################
# Add Repository Subdirectories
###############################################################################
add_subdirectory(projects)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT scenario_driver)
###############################################################################
# Stage Code for IDE Testing
###############################################################################
create_cache_file()
create_stage()
###############################################################################
# Step 2:
# You likely need to add on project to stage for every executable you would like
# to stage (AKA move dep DLLs to the run folder for debugging.
################################################################################
if(ARA_${ROOT_PROJECT_NAME}_BUILD_${ROOT_PROJECT_NAME})
add_dependencies(STAGE ${ROOT_PROJECT_NAME})
add_dependencies(STAGE scenario_driver)
add_dependencies(STAGE test_driver)
endif()
###############################################################################
# Step 3:
# Infrastructure Installation for each library
# your project outputs create a Find${lib}.cmake file
# list them here. This will install them in your sysroot
# so other projects can build off those libraries
###############################################################################
install(EXPORT lib${ROOT_PROJECT_NAME}
NAMESPACE ${ROOT_PROJECT_NAME}::
FILE ${ROOT_PROJECT_NAME}.cmake
DESTINATION lib/cmake/${ROOT_PROJECT_NAME}
)
include(CMakePackageConfigHelpers)
# generate the config file that is includes the exports
configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/${ROOT_PROJECT_NAME}Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${ROOT_PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION "lib/cmake/${ROOT_PROJECT_NAME}"
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
# generate the version file for the config file
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${ROOT_PROJECT_NAME}ConfigVersion.cmake"
VERSION "${${ROOT_PROJECT_NAME}_VERSION_MAJOR}.${${ROOT_PROJECT_NAME}_VERSION_MINOR}"
COMPATIBILITY AnyNewerVersion
)
# install the configuration file
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${ROOT_PROJECT_NAME}Config.cmake
DESTINATION lib/cmake/${ROOT_PROJECT_NAME}
)