Skip to content

Commit 09957ba

Browse files
committed
Add boost::stacktrace to CMake
bd87dea added an include to boost/stacktrace into wrappers. While this include is likely to work because this is brought in by Boost::system, this commit makes this include more specific by adding a proper link to it in the main CMake file.
1 parent f58ba57 commit 09957ba

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

CMakeLists.txt

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
55

66
cmake_minimum_required(VERSION 3.4...3.22)
7+
8+
if(POLICY CMP0167)
9+
# Use CMake's FindBoost module, see comment below. Needed until minimum
10+
# boost version is >=1.70
11+
cmake_policy(SET CMP0167 NEW)
12+
endif()
13+
714
project (vsomeip)
815

916
set (VSOMEIP_NAME vsomeip3)
@@ -188,13 +195,13 @@ add_definitions(-DVSOMEIP_INTERNAL_SUPPRESS_DEPRECATED)
188195
# Threads
189196
find_package(Threads REQUIRED)
190197

191-
# Boost
192-
find_package( Boost 1.66 COMPONENTS system thread filesystem REQUIRED )
193-
if(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
194-
include_directories(${Boost_INCLUDE_DIR} )
195-
else()
196-
include_directories(SYSTEM ${Boost_INCLUDE_DIRS} )
197-
endif()
198+
# Boost: once this is pushed passed 1.70, it should be found using CONFIG rather
199+
# than CMake's FindBoost module, see policy CMP0167
200+
find_package(
201+
Boost 1.66 REQUIRED
202+
COMPONENTS system thread filesystem
203+
OPTIONAL_COMPONENTS stacktrace
204+
)
198205

199206
if(Boost_FOUND)
200207
if(Boost_LIBRARY_DIR)

0 commit comments

Comments
 (0)