77# Distributed under the Boost Software License, Version 1.0. (See accompanying
88# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
99#
10- # Official repository: https://github.com/cppalliance/runtime_services
10+ # Official repository: https://github.com/cppalliance/rts
1111#
1212
1313#-------------------------------------------------
1616#
1717#-------------------------------------------------
1818cmake_minimum_required (VERSION 3.8...3.20 )
19- set (BOOST_RUNTIME_SERVICES_VERSION 1)
19+ set (BOOST_RTS_VERSION 1)
2020if (BOOST_SUPERPROJECT_VERSION)
21- set (BOOST_RUNTIME_SERVICES_VERSION ${BOOST_SUPERPROJECT_VERSION} )
21+ set (BOOST_RTS_VERSION ${BOOST_SUPERPROJECT_VERSION} )
2222endif ()
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 )
2525if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
26- set (BOOST_RUNTIME_SERVICES_IS_ROOT ON )
26+ set (BOOST_RTS_IS_ROOT ON )
2727endif ()
2828set (__ignore__ ${CMAKE_C_COMPILER} )
2929
@@ -32,11 +32,11 @@ set(__ignore__ ${CMAKE_C_COMPILER})
3232# Options
3333#
3434#-------------------------------------------------
35- if (BOOST_RUNTIME_SERVICES_IS_ROOT )
35+ if (BOOST_RTS_IS_ROOT )
3636 include (CTest )
3737endif ()
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 } )
4040
4141
4242# 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
5353#
5454#-------------------------------------------------
5555# The boost super-project requires one explicit dependency per-line.
56- set (BOOST_RUNTIME_SERVICES_DEPENDENCIES
56+ set (BOOST_RTS_DEPENDENCIES
5757 Boost::config
5858 Boost::container_hash
5959 Boost::core
6060 Boost::mp11
61+ Boost::system
6162 Boost::throw_exception
6263 )
6364
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} )
6768 endif ()
6869endforeach ()
6970# 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)
7273endif ()
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)
7576endif ()
7677# 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 )
7980
8081#-------------------------------------------------
8182#
8283# Add Boost Subdirectory
8384#
8485#-------------------------------------------------
85- if (BOOST_RUNTIME_SERVICES_IS_ROOT )
86+ if (BOOST_RTS_IS_ROOT )
8687 set (CMAKE_FOLDER Dependencies)
8788 # Find absolute BOOST_SRC_DIR
8889 if (NOT IS_ABSOLUTE ${BOOST_SRC_DIR} )
@@ -130,31 +131,46 @@ endif ()
130131#-------------------------------------------------
131132set_property (GLOBAL PROPERTY USE_FOLDERS ON )
132133
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 )
135136
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 } )
138139
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 )
146147if (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 )
148149else ()
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 )
150166endif ()
151167
152168#-------------------------------------------------
153169#
154170# Tests
155171#
156172#-------------------------------------------------
157- if (BOOST_RUNTIME_SERVICES_BUILD_TESTS )
173+ if (BOOST_RTS_BUILD_TESTS )
158174 add_subdirectory (test )
159175endif ()
160176
@@ -163,6 +179,6 @@ endif ()
163179# Examples
164180#
165181#-------------------------------------------------
166- if (BOOST_RUNTIME_SERVICES_BUILD_EXAMPLES )
182+ if (BOOST_RTS_BUILD_EXAMPLES )
167183 # add_subdirectory(example)
168184endif ()
0 commit comments