FindThreads: add simple testcase
This commit is contained in:
parent
cec45e27f6
commit
7279f2939e
|
@ -1365,6 +1365,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
|
||||||
add_subdirectory(FindOpenSSL)
|
add_subdirectory(FindOpenSSL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(FindThreads)
|
||||||
|
|
||||||
# Matlab module
|
# Matlab module
|
||||||
if(CMake_TEST_FindMatlab)
|
if(CMake_TEST_FindMatlab)
|
||||||
ADD_TEST_MACRO(FindMatlab.basic_checks ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>)
|
ADD_TEST_MACRO(FindMatlab.basic_checks ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>)
|
||||||
|
|
|
@ -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 ()
|
|
@ -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
|
||||||
|
)
|
Loading…
Reference in New Issue