forked from MotionReality/boost-cmake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
45 lines (33 loc) · 1.34 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
cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
cmake_policy(SET CMP0042 NEW)
project(BoostCMake NONE)
include(TargetArchitecture)
option(BUILD_UNIT_TESTS "Build unit tests" FALSE)
option(BUILD_SHARED_LIBRARIES "Build shared libraries" TRUE)
set(APPLE_CODE_SIGN_IDENTITY "" CACHE STRING "Sign identity name")
set(CMAKE_TARGET_ARCHITECTURE "" CACHE string "Target build architecture")
set(BOOST_PROJECT_SOURCE_DIR "" CACHE string "Source boost project directory")
list(APPEND CMAKE_MODULE_PATH "${BOOST_PROJECT_SOURCE_DIR}/modules")
if(NOT CMAKE_TARGET_ARCHITECTURE)
target_architecture(CMAKE_TARGET_ARCHITECTURE)
endif()
if(APPLE)
set(CMAKE_OSX_ARCHITECTURES ${CMAKE_TARGET_ARCHITECTURE})
endif()
if(BUILD_UNIT_TESTS)
enable_testing()
endif()
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/frameworks/boost")
find_package(Git REQUIRED)
execute_process(COMMAND
${CMAKE_SOURCE_DIR}/shallow-clone develop
https://github.com/boostorg/boost.git
${CMAKE_BINARY_DIR}/frameworks/boost
)
endif()
if(NOT EXISTS "${CMAKE_BINARY_DIR}/frameworks/boost")
file(COPY "frameworks/boost" DESTINATION "${CMAKE_BINARY_DIR}/frameworks")
endif()
file(COPY "src/" DESTINATION "${CMAKE_BINARY_DIR}/frameworks/boost")
add_subdirectory("${CMAKE_BINARY_DIR}/frameworks/boost"
"${CMAKE_BINARY_DIR}/frameworks/boost")