Skip to content

Commit 9eb3b60

Browse files
committed
Update commonSettings.cmkae
Check build type for boost. Add version check for boost CMake finder issue.
1 parent cfa427b commit 9eb3b60

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

cmake/commonSettings.cmake

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,17 @@ else()
154154
endif()
155155

156156
# Use Boost Release
157-
set(Boost_USE_DEBUG_LIBS OFF)
158-
set(Boost_USE_RELEASE_LIBS ON)
159-
set(Boost_NO_BOOST_CMAKE ON)
157+
if(CMAKE_BUILD_TYPE MATCHES Release)
158+
set(Boost_USE_DEBUG_LIBS OFF)
159+
set(Boost_USE_RELEASE_LIBS ON)
160+
elseif(CMAKE_BUILD_TYPE MATCHES Debug)
161+
set(Boost_USE_DEBUG_LIBS ON)
162+
set(Boost_USE_RELEASE_LIBS OFF)
163+
endif()
164+
# Issue with Boost CMake finder introduced in version 1.70
165+
if(Boost_VERSION VERSION_GREATER_EQUAL "1.70.0")
166+
set(Boost_NO_BOOST_CMAKE ON)
167+
endif()
160168

161169
if(NOT Boost_USE_STATIC_LIBS)
162170
# link against dynamic boost libraries

0 commit comments

Comments
 (0)