File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1
1
find_package (OpenMP REQUIRED)
2
2
find_package (libcmaes 0.10 QUIET )
3
3
if (NOT libcmaes_FOUND)
4
+ set (BSMPT_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} " )
5
+ set (BSMPT_CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} " )
6
+ set (BSMPT_CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} " )
4
7
set (EXPORT_CMAES TRUE )
5
8
FetchContent_Declare(
6
9
libcmaes
@@ -21,6 +24,23 @@ find_package(libcmaes 0.10 QUIET)
21
24
"${libcmaes_SOURCE_DIR} /*"
22
25
)
23
26
endif ()
27
+
28
+ ## WORKAROUND for https://github.com/phbasler/BSMPT/issues/72 until the PR is fixed
29
+ string (REPLACE " " ";" REPLACED_FLAGS ${BSMPT_CMAKE_CXX_FLAGS} )
30
+ string (REPLACE " " ";" REPLACED_FLAGS_RELEASE ${BSMPT_CMAKE_CXX_FLAGS_RELEASE} )
31
+ string (REPLACE " " ";" REPLACED_FLAGS_DEBUG ${BSMPT_CMAKE_CXX_FLAGS_DEBUG} )
32
+ target_compile_options (cmaes PUBLIC ${REPLACED_FLAGS} )
33
+ if (CMAKE_BUILD_TYPE MATCHES RELEASE)
34
+ target_compile_options (cmaes PUBLIC ${REPLACED_FLAGS_RELEASE} )
35
+ endif ()
36
+ if (CMAKE_BUILD_TYPE MATCHES DEBUG)
37
+ target_compile_options (cmaes PUBLIC ${REPLACED_FLAGS_DEBUG} )
38
+ endif ()
39
+ set (CMAKE_CXX_FLAGS "${BSMPT_CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS} " )
40
+ set (CMAKE_CXX_FLAGS_DEBUG "${BSMPT_CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_DEBUG} " )
41
+ set (CMAKE_CXX_FLAGS_RELEASE "${BSMPT_CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELEASE} " )
42
+ ## WORKAROUND end
43
+
24
44
set (libcmaes_FOUND TRUE )
25
45
else ()
26
46
set (CodeCoverageExcludesFromOtherPkgs
You can’t perform that action at this time.
0 commit comments