@@ -69,30 +69,6 @@ if(MSVC)
69
69
set (CMAKE_MSVC_RUNTIME_LIBRARY
70
70
"MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${MSVC_LINK_DYNAMIC_RUNTIME} >:DLL>" )
71
71
72
- # link against static boost libraries
73
- if (NOT DEFINED Boost_USE_STATIC_LIBS)
74
- if (BUILD_SHARED_LIBS )
75
- set (Boost_USE_STATIC_LIBS 0)
76
- else ()
77
- set (Boost_USE_STATIC_LIBS 1)
78
- endif ()
79
- endif ()
80
-
81
- # Boost static runtime ON for MSVC
82
- if (NOT DEFINED Boost_USE_STATIC_RUNTIME)
83
- if (BUILD_SHARED_LIBS OR (MSVC AND MSVC_LINK_DYNAMIC_RUNTIME))
84
- set (Boost_USE_STATIC_RUNTIME 0)
85
- else ()
86
- set (Boost_USE_STATIC_RUNTIME 1)
87
- endif ()
88
- endif ()
89
-
90
-
91
-
92
- IF (NOT Boost_USE_STATIC_LIBS)
93
- add_definitions (-DBOOST_ALL_DYN_LINK)
94
- add_definitions (-DBOOST_TEST_DYN_LINK)
95
- endif ()
96
72
add_compile_options (/external:env:BOOST)
97
73
add_compile_options (/external:W0)
98
74
add_compile_definitions (_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING)
@@ -137,9 +113,8 @@ else()
137
113
set (BUILD_SHARED_LIBS ON )
138
114
endif ()
139
115
140
- # link against dynamic boost libraries
141
- add_definitions (-DBOOST_ALL_DYN_LINK)
142
- add_definitions (-DBOOST_TEST_DYN_LINK)
116
+ # Issue with Boost CMake finder introduced in version 1.70
117
+ set (Boost_NO_BOOST_CMAKE ON )
143
118
144
119
# avoid a crash in valgrind that sometimes occurs if this flag is not defined
145
120
add_definitions (-DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
@@ -196,8 +171,33 @@ else()
196
171
# if QuantLib is build separately
197
172
include_directories ("${CMAKE_CURRENT_LIST_DIR} /../QuantLib/build" )
198
173
174
+ endif ()
199
175
176
+ # Boost #
177
+ # link against static boost libraries
178
+ if (NOT DEFINED Boost_USE_STATIC_LIBS)
179
+ if (BUILD_SHARED_LIBS )
180
+ set (Boost_USE_STATIC_LIBS OFF )
181
+ else ()
182
+ set (Boost_USE_STATIC_LIBS ON )
183
+ endif ()
184
+ endif ()
185
+
186
+ # Boost static runtime. ON for MSVC
187
+ if (NOT DEFINED Boost_USE_STATIC_RUNTIME)
188
+ if (BUILD_SHARED_LIBS OR (MSVC AND MSVC_LINK_DYNAMIC_RUNTIME))
189
+ set (Boost_USE_STATIC_RUNTIME OFF )
190
+ else ()
191
+ set (Boost_USE_STATIC_RUNTIME ON )
192
+ endif ()
193
+ endif ()
194
+
195
+ if (NOT Boost_USE_STATIC_LIBS)
196
+ # link against dynamic boost libraries
197
+ add_definitions (-DBOOST_ALL_DYN_LINK)
198
+ add_definitions (-DBOOST_TEST_DYN_LINK)
200
199
endif ()
200
+ # Boost end #
201
201
202
202
# workaround when building with boost 1.81, see https://github.com/boostorg/phoenix/issues/111
203
203
add_definitions (-DBOOST_PHOENIX_STL_TUPLE_H_)
0 commit comments