mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
CMake 3.27 deprecates compatibility with CMake < 3.5. Update find module tests to avoid the deprecation warning.
19 lines
767 B
CMake
19 lines
767 B
CMake
cmake_minimum_required(VERSION 3.5)
|
|
project(TestFindBoost CXX)
|
|
include(CTest)
|
|
|
|
find_package(Boost REQUIRED COMPONENTS foobar filesystem thread)
|
|
|
|
add_executable(test_boost_tgt main.cxx)
|
|
target_link_libraries(test_boost_tgt
|
|
Boost::dynamic_linking
|
|
Boost::disable_autolinking
|
|
Boost::filesystem
|
|
Boost::thread)
|
|
add_test(NAME test_boost_tgt COMMAND test_boost_tgt)
|
|
|
|
add_executable(test_boost_var main.cxx)
|
|
target_include_directories(test_boost_var PRIVATE ${Boost_INCLUDE_DIRS})
|
|
target_link_libraries(test_boost_var PRIVATE ${Boost_FILESYSTEM_LIBRARIES} ${Boost_SYSTEM_LIBRARIES} ${Boost_THREAD_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
|
add_test(NAME test_boost_var COMMAND test_boost_var)
|