7
7
# Distributed under the Boost Software License, Version 1.0. (See accompanying
8
8
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9
9
#
10
- # Official repository: https://github.com/cppalliance/runtime_services
10
+ # Official repository: https://github.com/cppalliance/rts
11
11
#
12
12
13
13
#-------------------------------------------------
16
16
#
17
17
#-------------------------------------------------
18
18
cmake_minimum_required (VERSION 3.8...3.20 )
19
- set (BOOST_RUNTIME_SERVICES_VERSION 1 )
19
+ set (BOOST_RTS_VERSION 1 )
20
20
if (BOOST_SUPERPROJECT_VERSION )
21
- set (BOOST_RUNTIME_SERVICES_VERSION ${BOOST_SUPERPROJECT_VERSION} )
21
+ set (BOOST_RTS_VERSION ${BOOST_SUPERPROJECT_VERSION} )
22
22
endif ()
23
- project (boost_runtime_services VERSION "${BOOST_RUNTIME_SERVICES_VERSION } " LANGUAGES CXX )
24
- set (BOOST_RUNTIME_SERVICES_IS_ROOT OFF )
23
+ project (boost_rts VERSION "${BOOST_RTS_VERSION } " LANGUAGES CXX )
24
+ set (BOOST_RTS_IS_ROOT OFF )
25
25
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
26
- set (BOOST_RUNTIME_SERVICES_IS_ROOT ON )
26
+ set (BOOST_RTS_IS_ROOT ON )
27
27
endif ()
28
28
set (__ignore__ ${CMAKE_C_COMPILER} )
29
29
@@ -32,11 +32,11 @@ set(__ignore__ ${CMAKE_C_COMPILER})
32
32
# Options
33
33
#
34
34
#-------------------------------------------------
35
- if (BOOST_RUNTIME_SERVICES_IS_ROOT )
35
+ if (BOOST_RTS_IS_ROOT )
36
36
include (CTest )
37
37
endif ()
38
- option (BOOST_RUNTIME_SERVICES_BUILD_TESTS "Build boost::runtime_services tests" ${BUILD_TESTING} )
39
- option (BOOST_RUNTIME_SERVICES_BUILD_EXAMPLES "Build boost::runtime_services examples" ${BOOST_RUNTIME_SERVICES_IS_ROOT } )
38
+ option (BOOST_RTS_BUILD_TESTS "Build boost::rts tests" ${BUILD_TESTING} )
39
+ option (BOOST_RTS_BUILD_EXAMPLES "Build boost::rts examples" ${BOOST_RTS_IS_ROOT } )
40
40
41
41
42
42
# Check if environment variable BOOST_SRC_DIR is set
@@ -53,36 +53,37 @@ set(BOOST_SRC_DIR ${DEFAULT_BOOST_SRC_DIR} CACHE STRING "Boost source dir to use
53
53
#
54
54
#-------------------------------------------------
55
55
# The boost super-project requires one explicit dependency per-line.
56
- set (BOOST_RUNTIME_SERVICES_DEPENDENCIES
56
+ set (BOOST_RTS_DEPENDENCIES
57
57
Boost::config
58
58
Boost::container_hash
59
59
Boost::core
60
60
Boost::mp11
61
+ Boost::system
61
62
Boost::throw_exception
62
63
)
63
64
64
- foreach (BOOST_RUNTIME_SERVICES_DEPENDENCY ${BOOST_RUNTIME_SERVICES_DEPENDENCIES } )
65
- if (BOOST_RUNTIME_SERVICES_DEPENDENCY MATCHES "^[ ]*Boost::([A-Za-z0-9_]+)[ ]*$" )
66
- list (APPEND BOOST_RUNTIME_SERVICES_INCLUDE_LIBRARIES ${CMAKE_MATCH_1} )
65
+ foreach (BOOST_RTS_DEPENDENCY ${BOOST_RTS_DEPENDENCIES } )
66
+ if (BOOST_RTS_DEPENDENCY MATCHES "^[ ]*Boost::([A-Za-z0-9_]+)[ ]*$" )
67
+ list (APPEND BOOST_RTS_INCLUDE_LIBRARIES ${CMAKE_MATCH_1} )
67
68
endif ()
68
69
endforeach ()
69
70
# Conditional dependencies
70
- if (BOOST_RUNTIME_SERVICES_BUILD_TESTS )
71
- set (BOOST_RUNTIME_SERVICES_UNIT_TEST_LIBRARIES url )
71
+ if (BOOST_RTS_BUILD_TESTS )
72
+ set (BOOST_RTS_UNIT_TEST_LIBRARIES url )
72
73
endif ()
73
- if (BOOST_RUNTIME_SERVICES_BUILD_EXAMPLES )
74
- # set(BOOST_RUNTIME_SERVICES_EXAMPLE_LIBRARIES url)
74
+ if (BOOST_RTS_BUILD_EXAMPLES )
75
+ # set(BOOST_RTS_EXAMPLE_LIBRARIES url)
75
76
endif ()
76
77
# Complete dependency list
77
- set (BOOST_INCLUDE_LIBRARIES ${BOOST_RUNTIME_SERVICES_INCLUDE_LIBRARIES } ${BOOST_RUNTIME_SERVICES_UNIT_TEST_LIBRARIES } ${BOOST_RUNTIME_SERVICES_EXAMPLE_LIBRARIES } )
78
- set (BOOST_EXCLUDE_LIBRARIES runtime_services )
78
+ set (BOOST_INCLUDE_LIBRARIES ${BOOST_RTS_INCLUDE_LIBRARIES } ${BOOST_RTS_UNIT_TEST_LIBRARIES } ${BOOST_RTS_EXAMPLE_LIBRARIES } )
79
+ set (BOOST_EXCLUDE_LIBRARIES rts )
79
80
80
81
#-------------------------------------------------
81
82
#
82
83
# Add Boost Subdirectory
83
84
#
84
85
#-------------------------------------------------
85
- if (BOOST_RUNTIME_SERVICES_IS_ROOT )
86
+ if (BOOST_RTS_IS_ROOT )
86
87
set (CMAKE_FOLDER Dependencies )
87
88
# Find absolute BOOST_SRC_DIR
88
89
if (NOT IS_ABSOLUTE ${BOOST_SRC_DIR} )
@@ -130,31 +131,46 @@ endif ()
130
131
#-------------------------------------------------
131
132
set_property (GLOBAL PROPERTY USE_FOLDERS ON )
132
133
133
- file (GLOB_RECURSE BOOST_RUNTIME_SERVICES_HEADERS CONFIGURE_DEPENDS include /boost/*.hpp include /boost/*.natvis )
134
- file (GLOB_RECURSE BOOST_RUNTIME_SERVICES_SOURCES CONFIGURE_DEPENDS src/*.cpp src/*.hpp )
134
+ file (GLOB_RECURSE BOOST_RTS_HEADERS CONFIGURE_DEPENDS include /boost/*.hpp include /boost/*.natvis )
135
+ file (GLOB_RECURSE BOOST_RTS_SOURCES CONFIGURE_DEPENDS src/*.cpp src/*.hpp )
135
136
136
- source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR} /include/boost PREFIX "" FILES ${BOOST_RUNTIME_SERVICES_HEADERS } )
137
- source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR} /src PREFIX "runtime_services " FILES ${BOOST_RUNTIME_SERVICES_SOURCES } )
137
+ source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR} /include/boost/rts PREFIX "include " FILES ${BOOST_RTS_HEADERS } )
138
+ source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR} /src PREFIX "src " FILES ${BOOST_RTS_SOURCES } )
138
139
139
- add_library (boost_runtime_services ${BOOST_RUNTIME_SERVICES_HEADERS } ${BOOST_RUNTIME_SERVICES_SOURCES } )
140
- add_library (Boost::runtime_services ALIAS boost_runtime_services )
141
- target_compile_features (boost_runtime_services PUBLIC cxx_constexpr )
142
- target_include_directories (boost_runtime_services PUBLIC "${PROJECT_SOURCE_DIR} /include" )
143
- target_link_libraries (boost_runtime_services PUBLIC ${BOOST_RUNTIME_SERVICES_DEPENDENCIES } )
144
- target_compile_definitions (boost_runtime_services PUBLIC BOOST_RUNTIME_SERVICES_NO_LIB )
145
- target_compile_definitions (boost_runtime_services PRIVATE BOOST_RUNTIME_SERVICES_SOURCE )
140
+ add_library (boost_rts ${BOOST_RTS_HEADERS } ${BOOST_RTS_SOURCES } )
141
+ add_library (Boost::rts ALIAS boost_rts )
142
+ target_compile_features (boost_rts PUBLIC cxx_constexpr )
143
+ target_include_directories (boost_rts PUBLIC "${PROJECT_SOURCE_DIR} /include" )
144
+ target_link_libraries (boost_rts PUBLIC ${BOOST_RTS_DEPENDENCIES } )
145
+ target_compile_definitions (boost_rts PUBLIC BOOST_RTS_NO_LIB )
146
+ target_compile_definitions (boost_rts PRIVATE BOOST_RTS_SOURCE )
146
147
if (BUILD_SHARED_LIBS )
147
- target_compile_definitions (boost_runtime_services PUBLIC BOOST_RUNTIME_SERVICES_DYN_LINK )
148
+ target_compile_definitions (boost_rts PUBLIC BOOST_RTS_DYN_LINK )
148
149
else ()
149
- target_compile_definitions (boost_runtime_services PUBLIC BOOST_RUNTIME_SERVICES_STATIC_LINK )
150
+ target_compile_definitions (boost_rts PUBLIC BOOST_RTS_STATIC_LINK )
151
+ endif ()
152
+
153
+
154
+ # Zlib
155
+ find_package (ZLIB )
156
+ if (ZLIB_FOUND )
157
+ file (GLOB_RECURSE BOOST_RTS_ZLIB_SOURCES CONFIGURE_DEPENDS src_zlib/*.cpp src_zlib/*.hpp )
158
+ file (GLOB_RECURSE BOOST_RTS_ZLIB_HEADERS CONFIGURE_DEPENDS include /boost/rts/zlib/*.hpp )
159
+ source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR} /src_zlib PREFIX "src" FILES ${BOOST_RTS_ZLIB_SOURCES} )
160
+ add_library (boost_rts_zlib build /Jamfile ${BOOST_RTS_ZLIB_HEADERS} ${BOOST_RTS_ZLIB_SOURCES} )
161
+ add_library (Boost::rts_zlib ALIAS boost_rts_zlib )
162
+ target_link_libraries (boost_rts_zlib PUBLIC boost_rts )
163
+ target_link_libraries (boost_rts_zlib PRIVATE ZLIB::ZLIB )
164
+ target_compile_definitions (boost_rts_zlib PUBLIC BOOST_RTS_HAS_ZLIB )
165
+ target_compile_definitions (boost_rts_zlib PRIVATE BOOST_RTS_SOURCE )
150
166
endif ()
151
167
152
168
#-------------------------------------------------
153
169
#
154
170
# Tests
155
171
#
156
172
#-------------------------------------------------
157
- if (BOOST_RUNTIME_SERVICES_BUILD_TESTS )
173
+ if (BOOST_RTS_BUILD_TESTS )
158
174
add_subdirectory (test )
159
175
endif ()
160
176
@@ -163,6 +179,6 @@ endif ()
163
179
# Examples
164
180
#
165
181
#-------------------------------------------------
166
- if (BOOST_RUNTIME_SERVICES_BUILD_EXAMPLES )
182
+ if (BOOST_RTS_BUILD_EXAMPLES )
167
183
# add_subdirectory(example)
168
184
endif ()
0 commit comments