-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
106 lines (81 loc) · 3.51 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
##########################################################################
# Copyright (C) 2007-2008 Douglas Gregor <[email protected]> #
# Copyright (C) 2007-2009 Troy Straszheim <[email protected]> #
# Copyright (C) 2010-2011 Daniel Pfeifer <[email protected]> #
# #
# Distributed under the Boost Software License, Version 1.0. #
# See accompanying file LICENSE_1_0.txt or copy at #
# http://www.boost.org/LICENSE_1_0.txt #
##########################################################################
cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
project(Boost)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake)
if(NOT BOOST_STAGE MATCHES "^STABLE$|^UNSTABLE$")
set(BOOST_STAGE "STABLE" CACHE STRING "Possible values are STABLE and UNSTABLE" FORCE)
endif()
set_property(CACHE BOOST_STAGE PROPERTY STRINGS STABLE UNSTABLE)
option(BOOST_INCLUDE_INCUBATING "Should incubating components be included?" OFF)
option(BOOST_DEBIAN_PACKAGES "" OFF)
#
set(BOOST_MONOLITHIC_DIR ${CMAKE_BINARY_DIR}/monolithic)
if(BOOST_UPDATE_SOURCE OR NOT DEFINED BOOST_UPDATE_SOURCE)
include(BoostModule)
include(BoostFetchGit)
include(BoostFetchSubversion)
include(BoostFetchDownload)
include(BoostFetchPristineBoost)
set(BOOST_FRAGMENT_LIST)
set(fragments_expression "${CMAKE_SOURCE_DIR}/fragments/boost/*.cmake")
if(BOOST_INCLUDE_INCUBATING)
list(APPEND fragments_expression "${CMAKE_SOURCE_DIR}/fragments/incubating/*.cmake")
endif(BOOST_INCLUDE_INCUBATING)
file(GLOB_RECURSE modules ${fragments_expression})
foreach(module ${modules})
include(${module})
endforeach(module)
list(SORT BOOST_FRAGMENT_LIST)
set(BOOST_MODULE_ADD_SUBDIRECTORIES)
foreach(fragment ${BOOST_FRAGMENT_LIST})
set(BOOST_MODULE_ADD_SUBDIRECTORIES
"${BOOST_MODULE_ADD_SUBDIRECTORIES}\nadd_subdirectory(src/${fragment})")
# fetch the fragment
set(source "${BOOST_${fragment}_${BOOST_STAGE}}")
list(GET source 0 service)
list(REMOVE_AT source 0)
message(STATUS "fetching '${fragment}' via ${service}.")
# prepare arguments for boost_fetch_* functions
set(args ${fragment} "${BOOST_MONOLITHIC_DIR}/src" ${source})
if(service STREQUAL "DOWNLOAD")
boost_fetch_download(${args})
elseif(service STREQUAL "GIT")
boost_fetch_git(${args})
elseif(service STREQUAL "SVN")
boost_fetch_svn(${args})
elseif(service STREQUAL "COPY_FROM_PRISTINE_BOOST")
boost_fetch_pristine_boost(${args})
else()
message(FATAL_ERROR "no service for ${name} given!")
endif()
endforeach(fragment)
configure_file(CMakeLists.txt.in
"${BOOST_MONOLITHIC_DIR}/CMakeLists.txt" @ONLY)
file(COPY
BoostCPack.cmake
create_package
create_package.bat
CTestConfig.cmake
LICENSE_1_0.txt
README.txt
DESTINATION ${BOOST_MONOLITHIC_DIR}
)
set(BOOST_UPDATE_SOURCE OFF CACHE BOOL "update source" FORCE)
endif(BOOST_UPDATE_SOURCE OR NOT DEFINED BOOST_UPDATE_SOURCE)
# TODO: remove this once all modules provide their own CMakeLists.txt file
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_SOURCE_DIR}/provided" "${BOOST_MONOLITHIC_DIR}/src"
)
if(BOOST_DEBIAN_PACKAGES)
list(APPEND BOOST_FOOTER BoostDebian BoostRPM)
endif(BOOST_DEBIAN_PACKAGES)
set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${BOOST_MONOLITHIC_DIR};/")
add_subdirectory("${BOOST_MONOLITHIC_DIR}" "${BOOST_MONOLITHIC_DIR}-build")