diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2015-09-21 15:57:33 (GMT) |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2015-09-21 19:17:32 (GMT) |
commit | 7279f2939e98ae9ecfb8fda2dc82f6b0048b9316 (patch) | |
tree | 2e154af372731e47634c42792ee83a2c6d7e26aa /Tests/FindThreads | |
parent | cec45e27f6dc2657b00902bcaef5bd93ae16ead7 (diff) | |
download | CMake-7279f2939e98ae9ecfb8fda2dc82f6b0048b9316.zip CMake-7279f2939e98ae9ecfb8fda2dc82f6b0048b9316.tar.gz CMake-7279f2939e98ae9ecfb8fda2dc82f6b0048b9316.tar.bz2 |
FindThreads: add simple testcase
Diffstat (limited to 'Tests/FindThreads')
-rw-r--r-- | Tests/FindThreads/C-only/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/FindThreads/CMakeLists.txt | 9 |
2 files changed, 19 insertions, 0 deletions
diff --git a/Tests/FindThreads/C-only/CMakeLists.txt b/Tests/FindThreads/C-only/CMakeLists.txt new file mode 100644 index 0000000..ab4ca0d --- /dev/null +++ b/Tests/FindThreads/C-only/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.3 FATAL_ERROR) +project(FindThreads_C-only C) + +set(CMAKE_THREAD_PREFER_PTHREAD On) +find_package(Threads REQUIRED) + +if (NOT WIN32) + add_executable(thr ${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/CheckForPthreads.c) + target_link_libraries(thr Threads::Threads) +endif () diff --git a/Tests/FindThreads/CMakeLists.txt b/Tests/FindThreads/CMakeLists.txt new file mode 100644 index 0000000..36518a3 --- /dev/null +++ b/Tests/FindThreads/CMakeLists.txt @@ -0,0 +1,9 @@ +add_test(NAME FindThreads.C-only COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindThreads/C-only" + "${CMake_BINARY_DIR}/Tests/FindThreads/C-only" + ${build_generator_args} + --build-project FindThreads_C-only + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V + ) |