diff options
author | Brad King <brad.king@kitware.com> | 2015-12-04 14:54:13 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-12-04 14:54:13 (GMT) |
commit | 65dc4170f858d561144a3c79397f4d2822bae4b6 (patch) | |
tree | b5648ae2b17f08a4cda1cce682fa30eb1c728cea /Tests | |
parent | d4767fca963e97ec2147a343e24ec366cc2646cb (diff) | |
parent | d60cef773659d69ed2fce9b963d788ab422679b9 (diff) | |
download | CMake-65dc4170f858d561144a3c79397f4d2822bae4b6.zip CMake-65dc4170f858d561144a3c79397f4d2822bae4b6.tar.gz CMake-65dc4170f858d561144a3c79397f4d2822bae4b6.tar.bz2 |
Merge topic 'FindBoost-imported-targets'
d60cef77 Help: Add notes for topic 'FindBoost-imported-targets.rst'
9fd98750 Tests: Add FindBoost testcase for imported targets
3f9b081f FindBoost: Add imported targets
01c80acd FindBoost: Automatically add missing component dependencies
5183c6e5 FindBoost: Embed component dependency table
8a60e696 Utilities: Add BoostScanDeps script
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/FindBoost/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/FindBoost/Test/CMakeLists.txt | 18 | ||||
-rw-r--r-- | Tests/FindBoost/Test/main.cxx | 26 |
4 files changed, 58 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5fd7159..6c4567d 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1356,6 +1356,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endif() endif() + if(CMake_TEST_FindBoost) + add_subdirectory(FindBoost) + endif() + if(CMake_TEST_FindGSL) add_subdirectory(FindGSL) endif() diff --git a/Tests/FindBoost/CMakeLists.txt b/Tests/FindBoost/CMakeLists.txt new file mode 100644 index 0000000..259ee26 --- /dev/null +++ b/Tests/FindBoost/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindBoost.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindBoost/Test" + "${CMake_BINARY_DIR}/Tests/FindBoost/Test" + ${build_generator_args} + --build-project TestFindBoost + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindBoost/Test/CMakeLists.txt b/Tests/FindBoost/Test/CMakeLists.txt new file mode 100644 index 0000000..ce50fc7 --- /dev/null +++ b/Tests/FindBoost/Test/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.1) +project(TestFindBoost CXX) +include(CTest) + +find_package(Boost REQUIRED COMPONENTS 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) diff --git a/Tests/FindBoost/Test/main.cxx b/Tests/FindBoost/Test/main.cxx new file mode 100644 index 0000000..0f44f30 --- /dev/null +++ b/Tests/FindBoost/Test/main.cxx @@ -0,0 +1,26 @@ +#include <boost/filesystem.hpp> +#include <boost/thread.hpp> + +namespace +{ + + boost::mutex m1; + boost::recursive_mutex m2; + + void + threadmain() + { + boost::lock_guard<boost::mutex> lock1(m1); + boost::lock_guard<boost::recursive_mutex> lock2(m2); + + boost::filesystem::path p(boost::filesystem::current_path()); + } + +} + +int main() { + boost::thread foo(threadmain); + foo.join(); + + return 0; +} |