]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | # Copyright 2020, 2021 Peter Dimov |
2 | # Distributed under the Boost Software License, Version 1.0. | |
3 | # https://www.boost.org/LICENSE_1_0.txt | |
4 | ||
5 | cmake_minimum_required(VERSION 3.5...3.16) | |
6 | ||
7 | project(boost_program_options VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) | |
8 | ||
9 | add_library(boost_program_options | |
10 | src/cmdline.cpp | |
11 | src/config_file.cpp | |
12 | src/convert.cpp | |
13 | src/options_description.cpp | |
14 | src/parsers.cpp | |
15 | src/positional_options.cpp | |
16 | src/split.cpp | |
17 | src/utf8_codecvt_facet.cpp | |
18 | src/value_semantic.cpp | |
19 | src/variables_map.cpp | |
20 | src/winmain.cpp | |
21 | ) | |
22 | ||
23 | add_library(Boost::program_options ALIAS boost_program_options) | |
24 | ||
25 | target_include_directories(boost_program_options PUBLIC include) | |
26 | ||
27 | target_link_libraries(boost_program_options | |
28 | PUBLIC | |
29 | Boost::any | |
30 | Boost::config | |
31 | Boost::core | |
32 | Boost::detail | |
33 | Boost::function | |
34 | Boost::iterator | |
35 | Boost::lexical_cast | |
36 | Boost::smart_ptr | |
37 | Boost::static_assert | |
38 | Boost::throw_exception | |
39 | Boost::type_traits | |
40 | PRIVATE | |
41 | Boost::bind | |
42 | Boost::tokenizer | |
43 | ) | |
44 | ||
45 | target_compile_definitions(boost_program_options | |
46 | PUBLIC BOOST_PROGRAM_OPTIONS_NO_LIB | |
47 | # Source files already define BOOST_PROGRAM_OPTIONS_SOURCE | |
48 | # PRIVATE BOOST_PROGRAM_OPTIONS_SOURCE | |
49 | ) | |
50 | ||
51 | if(BUILD_SHARED_LIBS) | |
52 | target_compile_definitions(boost_program_options PUBLIC BOOST_PROGRAM_OPTIONS_DYN_LINK) | |
53 | else() | |
54 | target_compile_definitions(boost_program_options PUBLIC BOOST_PROGRAM_OPTIONS_STATIC_LINK) | |
55 | endif() | |
56 | ||
57 | if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") | |
58 | ||
59 | add_subdirectory(test) | |
60 | ||
61 | endif() |