diff options
author | Brad King <brad.king@kitware.com> | 2021-09-22 18:55:42 (GMT) |
---|---|---|
committer | Igor S. Gerasimov <i.s.ger@ya.ru> | 2021-10-05 14:41:36 (GMT) |
commit | 9b69307b56376e2bd0a82539562f9e59a808194b (patch) | |
tree | 549ac8a41a7dcd38c3949a46594805dda4b9791d /Tests/FindLAPACK/CMakeLists.txt | |
parent | 91fd645d46adeaa22221b0c08307d2dc35b81ade (diff) | |
download | CMake-9b69307b56376e2bd0a82539562f9e59a808194b.zip CMake-9b69307b56376e2bd0a82539562f9e59a808194b.tar.gz CMake-9b69307b56376e2bd0a82539562f9e59a808194b.tar.bz2 |
Find{BLAS,LAPACK}: De-duplicate and generalize test creation logic
Interpret `CMake_TEST_FindBLAS` and `CMake_TEST_FindLAPACK` as a
sequence of option assignments intermixed with vendor names.
Diffstat (limited to 'Tests/FindLAPACK/CMakeLists.txt')
-rw-r--r-- | Tests/FindLAPACK/CMakeLists.txt | 51 |
1 files changed, 2 insertions, 49 deletions
diff --git a/Tests/FindLAPACK/CMakeLists.txt b/Tests/FindLAPACK/CMakeLists.txt index 535c7b6..a2470ef 100644 --- a/Tests/FindLAPACK/CMakeLists.txt +++ b/Tests/FindLAPACK/CMakeLists.txt @@ -1,49 +1,2 @@ -foreach(variant IN LISTS CMake_TEST_FindLAPACK) - if(variant MATCHES "^([^.]+)\\.(.*)$") - set(vendor "${CMAKE_MATCH_1}") - set(alt_compiler "-DCMAKE_C_COMPILER=${CMAKE_MATCH_2}") - else() - set(vendor "${variant}") - set(alt_compiler "") - endif() - if(vendor STREQUAL "All" AND CMake_TEST_FindLAPACK_All) - set(EXPECT_All "-DEXPECT_All=${CMake_TEST_FindLAPACK_All}") - else() - set(EXPECT_All "") - endif() - add_test(NAME FindLAPACK.Test_${variant} COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindLAPACK/Test" - "${CMake_BINARY_DIR}/Tests/FindLAPACK/Test_${variant}" - ${build_generator_args} - --build-project TestFindLAPACK - --build-options ${build_options} ${alt_compiler} ${EXPECT_All} -DBLA_VENDOR=${vendor} - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) -endforeach() - -foreach(variant IN LISTS CMake_TEST_FindLAPACK_STATIC) - if(variant MATCHES "^([^.]+)\\.(.*)$") - set(vendor "${CMAKE_MATCH_1}") - set(alt_compiler "-DCMAKE_C_COMPILER=${CMAKE_MATCH_2}") - else() - set(vendor "${variant}") - set(alt_compiler "") - endif() - if(vendor STREQUAL "All" AND CMake_TEST_FindLAPACK_STATIC_All) - set(EXPECT_All "-DEXPECT_All=${CMake_TEST_FindLAPACK_STATIC_All}") - else() - set(EXPECT_All "") - endif() - add_test(NAME FindLAPACK.Test_${variant}_Static COMMAND - ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> - --build-and-test - "${CMake_SOURCE_DIR}/Tests/FindLAPACK/Test" - "${CMake_BINARY_DIR}/Tests/FindLAPACK/Test_${variant}_Static" - ${build_generator_args} - --build-project TestFindLAPACK - --build-options ${build_options} ${alt_compiler} ${EXPECT_All} -DBLA_VENDOR=${vendor} -DBLA_STATIC=ON - --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> - ) -endforeach() +include("${CMake_SOURCE_DIR}/Tests/FindBLAS/add_BLAS_LAPACK_tests.cmake") +add_BLAS_LAPACK_tests(CMake_TEST_FindLAPACK) |