Repository navigation
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
50 lines (42 loc) · 1.53 KB
/
Copy pathCMakeLists.txt
File metadata and controls
50 lines (42 loc) · 1.53 KB
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
# Generated by `boostdep --cmake lexical_cast`
# Copyright 2020 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.8...4.4)
project(boost_lexical_cast VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
if(BOOST_USE_MODULES)
add_library(boost_lexical_cast STATIC)
target_sources(boost_lexical_cast PUBLIC
FILE_SET CXX_MODULES
BASE_DIRS modules
FILES modules/boost_lexical_cast.cppm
)
target_compile_features(boost_lexical_cast PUBLIC cxx_std_20)
target_compile_definitions(boost_lexical_cast PUBLIC BOOST_USE_MODULES)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 20)
endif()
if (CMAKE_CXX_MODULE_STD AND CMAKE_CXX_STANDARD IN_LIST CMAKE_CXX_COMPILER_IMPORT_STD)
target_compile_definitions(boost_lexical_cast PUBLIC BOOST_LEXICAL_CAST_USE_STD_MODULE)
target_compile_features(boost_lexical_cast PUBLIC cxx_std_23)
message(STATUS "Using `import std;`")
else()
message(STATUS "`import std;` is not available")
endif()
set(__scope PUBLIC)
else()
add_library(boost_lexical_cast INTERFACE)
set(__scope INTERFACE)
endif()
target_include_directories(boost_lexical_cast ${__scope} include)
target_link_libraries(boost_lexical_cast
${__scope}
Boost::config
Boost::container
Boost::core
Boost::throw_exception
)
add_library(Boost::lexical_cast ALIAS boost_lexical_cast)
if(BUILD_TESTING)
add_subdirectory(test)
endif()