Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt

cmake_minimum_required( VERSION 3.8...3.31 )
project( boost_any VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX )
cmake_minimum_required(VERSION 3.28...4.4)
project(boost_any VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)

if (BOOST_USE_MODULES)
if(BOOST_USE_MODULES)
add_library(boost_any)
target_sources(boost_any PUBLIC
FILE_SET modules_public
Expand All @@ -16,11 +16,12 @@ if (BOOST_USE_MODULES)
target_compile_features(boost_any PUBLIC cxx_std_20)
target_compile_definitions(boost_any PUBLIC BOOST_USE_MODULES)
set(__boost_cxx_standard ${CMAKE_CXX_STANDARD})
if (NOT __boost_cxx_standard)
set(__boost_cxx_standard 20)
if(NOT __boost_cxx_standard)
set(__boost_cxx_standard 23)
endif()
if (CMAKE_CXX_COMPILER_IMPORT_STD AND ${__boost_cxx_standard} IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD)
target_compile_definitions(boost_any PRIVATE BOOST_ANY_USE_STD_MODULE)
if(CMAKE_CXX_COMPILER_IMPORT_STD AND ${__boost_cxx_standard} IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD)
target_compile_definitions(boost_any PUBLIC BOOST_ANY_USE_STD_MODULE)
target_compile_features(boost_any PUBLIC cxx_std_${__boost_cxx_standard})
message(STATUS "Using `import std;`")
else()
message(STATUS "`import std;` is not available")
Expand All @@ -32,14 +33,14 @@ else()
endif()

target_include_directories(boost_any ${__scope} include)
target_link_libraries( boost_any
target_link_libraries(boost_any
${__scope}
Boost::config
Boost::throw_exception
Boost::type_index
)

add_library( Boost::any ALIAS boost_any )
add_library(Boost::any ALIAS boost_any)

if(BUILD_TESTING)
add_subdirectory(test)
Expand Down