Skip to content

Commit c9b5d31

Browse files
fechantillac-antidotkevinAlbs
authored andcommitted
examples: Use Boost::boost target to link against boost library
1 parent d21a365 commit c9b5d31

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

examples/projects/bsoncxx/cmake/shared/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ add_executable(hello_bsoncxx ../../hello_bsoncxx.cpp)
4242

4343
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
4444
find_package(Boost 1.56.0 REQUIRED)
45-
target_include_directories(hello_bsoncxx
46-
PRIVATE ${Boost_INCLUDE_DIRS}
47-
)
45+
target_link_libraries(hello_bsoncxx PRIVATE Boost::boost)
4846
endif()
4947

5048
target_link_libraries(hello_bsoncxx

examples/projects/bsoncxx/cmake/static/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ add_executable(hello_bsoncxx ../../hello_bsoncxx.cpp)
4242

4343
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
4444
find_package(Boost 1.56.0 REQUIRED)
45-
target_include_directories(hello_bsoncxx
46-
PRIVATE ${Boost_INCLUDE_DIRS}
47-
)
45+
target_link_libraries(hello_bsoncxx PRIVATE Boost::boost)
4846
endif()
4947

5048
target_link_libraries(hello_bsoncxx

examples/projects/mongocxx/cmake/shared/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ add_executable(hello_mongocxx ../../hello_mongocxx.cpp)
4242

4343
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
4444
find_package(Boost 1.56.0 REQUIRED)
45-
target_include_directories(hello_mongocxx
46-
PRIVATE ${Boost_INCLUDE_DIRS}
47-
)
45+
target_link_libraries(hello_mongocxx PRIVATE Boost::boost)
4846
endif()
4947

5048
target_link_libraries(hello_mongocxx

examples/projects/mongocxx/cmake/static/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ add_executable(hello_mongocxx ../../hello_mongocxx.cpp)
4242

4343
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
4444
find_package(Boost 1.56.0 REQUIRED)
45-
target_include_directories(hello_mongocxx
46-
PRIVATE ${Boost_INCLUDE_DIRS}
47-
)
45+
target_link_libraries(hello_mongocxx PRIVATE Boost::boost)
4846
endif()
4947

5048
target_link_libraries(hello_mongocxx

0 commit comments

Comments
 (0)