Skip to content

Commit ce6a40b

Browse files
committed
Add CMakeLists.txt
1 parent 3c0d0fa commit ce6a40b

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

CMakeLists.txt

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Generated by `boostdep --cmake program_options`
2+
# Copyright 2020 Peter Dimov
3+
# Distributed under the Boost Software License, Version 1.0.
4+
# https://www.boost.org/LICENSE_1_0.txt
5+
6+
cmake_minimum_required(VERSION 3.5...3.16)
7+
8+
project(boost_program_options VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
9+
10+
add_library(boost_program_options
11+
src/cmdline.cpp
12+
src/config_file.cpp
13+
src/convert.cpp
14+
src/options_description.cpp
15+
src/parsers.cpp
16+
src/positional_options.cpp
17+
src/split.cpp
18+
src/utf8_codecvt_facet.cpp
19+
src/value_semantic.cpp
20+
src/variables_map.cpp
21+
src/winmain.cpp
22+
)
23+
24+
add_library(Boost::program_options ALIAS boost_program_options)
25+
26+
target_include_directories(boost_program_options PUBLIC include)
27+
28+
target_link_libraries(boost_program_options
29+
PUBLIC
30+
Boost::any
31+
Boost::config
32+
Boost::core
33+
Boost::detail
34+
Boost::function
35+
Boost::iterator
36+
Boost::lexical_cast
37+
Boost::smart_ptr
38+
Boost::static_assert
39+
Boost::throw_exception
40+
Boost::type_traits
41+
PRIVATE
42+
Boost::bind
43+
Boost::tokenizer
44+
)
45+
46+
target_compile_definitions(boost_program_options
47+
PUBLIC BOOST_PROGRAM_OPTIONS_NO_LIB
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()
62+

0 commit comments

Comments
 (0)