@@ -14,7 +14,6 @@ endif()
14
14
project (Cucumber-Cpp)
15
15
16
16
option (BUILD_SHARED_LIBS "Generate shared libraries" OFF )
17
- option (CUKE_USE_STATIC_BOOST "Statically link Boost (except boost::test)" ${WIN32} )
18
17
option (CUKE_USE_STATIC_GTEST "Statically link Google Test" ON )
19
18
option (CUKE_ENABLE_BOOST_TEST "Enable Boost.Test framework" ON )
20
19
option (CUKE_ENABLE_EXAMPLES "Build examples" OFF )
@@ -111,69 +110,11 @@ endif()
111
110
# Boost
112
111
#
113
112
114
- if (MSVC11)
115
- # Boost 1.51 fixed a bug with MSVC11
116
- message (STATUS "Forcing Boost 1.51+ on MSVC11" )
117
- set (BOOST_MIN_VERSION "1.51" )
118
- else ()
119
- set (BOOST_MIN_VERSION "1.46" )
120
- endif ()
121
-
122
113
set (Boost_USE_STATIC_RUNTIME OFF )
123
- set (CUKE_CORE_BOOST_LIBS system program_options)
124
114
if (CUKE_ENABLE_BOOST_TEST)
125
115
# "An external test runner utility is required to link with dynamic library" (Boost User's Guide)
126
- set (Boost_USE_STATIC_LIBS OFF )
127
116
set (CMAKE_CXX_FLAGS "-DBOOST_TEST_DYN_LINK ${CMAKE_CXX_FLAGS} " )
128
- find_package (Boost ${BOOST_MIN_VERSION} COMPONENTS unit_test_framework)
129
- endif ()
130
-
131
- if (CUKE_USE_STATIC_BOOST)
132
- set (Boost_USE_STATIC_LIBS ON )
133
- find_package (Boost ${BOOST_MIN_VERSION} COMPONENTS ${CUKE_CORE_BOOST_LIBS} REQUIRED)
134
- else ()
135
- set (CMAKE_CXX_FLAGS "-DBOOST_ALL_DYN_LINK ${CMAKE_CXX_FLAGS} " )
136
- set (Boost_USE_STATIC_LIBS OFF )
137
- find_package (Boost ${BOOST_MIN_VERSION} COMPONENTS ${CUKE_CORE_BOOST_LIBS} REQUIRED)
138
- endif ()
139
-
140
- # Create import targets for CMake versions older than 3.5 (actually older FindBoost.cmake)
141
- if (Boost_USE_STATIC_LIBS)
142
- set (LIBRARY_TYPE STATIC )
143
- else ()
144
- # Just because we don't ask for static doesn't mean we're not getting static
145
- set (LIBRARY_TYPE UNKNOWN)
146
- endif ()
147
- if (Boost_INCLUDE_DIRS AND NOT TARGET Boost::boost)
148
- add_library (Boost::boost INTERFACE IMPORTED )
149
- set_target_properties (Boost::boost PROPERTIES
150
- "INTERFACE_INCLUDE_DIRECTORIES" "${Boost_INCLUDE_DIRS} " )
151
- endif ()
152
- if (Boost_SYSTEM_LIBRARY AND NOT TARGET Boost::system )
153
- add_library (Boost::system ${LIBRARY_TYPE} IMPORTED )
154
- set_target_properties (Boost::system PROPERTIES
155
- "IMPORTED_LOCATION" "${Boost_SYSTEM_LIBRARY} "
156
- "INTERFACE_LINK_LIBRARIES" "Boost::boost"
157
- )
158
- if (Boost_USE_STATIC_LIBS)
159
- set_target_properties (Boost::system PROPERTIES
160
- "COMPILE_DEFINITIONS" BOOST_ERROR_CODE_HEADER_ONLY=1
161
- )
162
- endif ()
163
- endif ()
164
- if (Boost_PROGRAM_OPTIONS_LIBRARY AND NOT TARGET Boost::program_options)
165
- add_library (Boost::program_options ${LIBRARY_TYPE} IMPORTED )
166
- set_target_properties (Boost::program_options PROPERTIES
167
- "IMPORTED_LOCATION" "${Boost_PROGRAM_OPTIONS_LIBRARY} "
168
- "INTERFACE_LINK_LIBRARIES" "Boost::boost"
169
- )
170
- endif ()
171
- if (Boost_UNIT_TEST_FRAMEWORK_LIBRARY AND NOT TARGET Boost::unit_test_framework)
172
- add_library (Boost::unit_test_framework ${LIBRARY_TYPE} IMPORTED )
173
- set_target_properties (Boost::unit_test_framework PROPERTIES
174
- "IMPORTED_LOCATION" "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} "
175
- "INTERFACE_LINK_LIBRARIES" "Boost::boost"
176
- )
117
+ find_package (Boost 1.70 COMPONENTS unit_test_framework)
177
118
endif ()
178
119
179
120
#
0 commit comments