diff options
author | Sergiu Deitsch <sergiu.deitsch@gmail.com> | 2018-01-14 10:42:48 (GMT) |
---|---|---|
committer | Sergiu Deitsch <sergiu.deitsch@th-nuernberg.de> | 2018-01-19 16:00:44 (GMT) |
commit | 2557cad5ec5084f86d4bb56c82939a49fc9d3071 (patch) | |
tree | d23f50924e34f79dacf9585c5dba3de14429a122 /Tests/FindBoost/TestFail | |
parent | 7b78242d602c5ffa1831478ef624bc41642ca1ff (diff) | |
download | CMake-2557cad5ec5084f86d4bb56c82939a49fc9d3071.zip CMake-2557cad5ec5084f86d4bb56c82939a49fc9d3071.tar.gz CMake-2557cad5ec5084f86d4bb56c82939a49fc9d3071.tar.bz2 |
FindBoost: support OPTIONAL_COMPONENTS
Diffstat (limited to 'Tests/FindBoost/TestFail')
-rw-r--r-- | Tests/FindBoost/TestFail/CMakeLists.txt | 18 | ||||
-rw-r--r-- | Tests/FindBoost/TestFail/main.cxx | 24 |
2 files changed, 42 insertions, 0 deletions
diff --git a/Tests/FindBoost/TestFail/CMakeLists.txt b/Tests/FindBoost/TestFail/CMakeLists.txt new file mode 100644 index 0000000..7c14a59 --- /dev/null +++ b/Tests/FindBoost/TestFail/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.1) +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) diff --git a/Tests/FindBoost/TestFail/main.cxx b/Tests/FindBoost/TestFail/main.cxx new file mode 100644 index 0000000..6e8b5da --- /dev/null +++ b/Tests/FindBoost/TestFail/main.cxx @@ -0,0 +1,24 @@ +#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; +} |