Debian Codegraph @

Tests/FindBLAS/Test/CMakeLists.txt

raw
1 cmake_minimum_required(VERSION 3.10)
2 project(TestFindBLAS C)
3 include(CTest)
4
5 find_package(BLAS REQUIRED)
6
7 # Configure the test case to match BLAS's integer type ABI.
8 # FindBLAS defaults to 32-bit integers if BLA_SIZEOF_INTEGER
9 # is not already set in the cache.
10 if(NOT BLA_SIZEOF_INTEGER)
11 set(BLA_SIZEOF_INTEGER 4)
12 endif()
13
14 add_executable(test_tgt main.c)
15 target_link_libraries(test_tgt BLAS::BLAS)
16 target_compile_definitions(test_tgt PUBLIC BLA_SIZEOF_INTEGER=${BLA_SIZEOF_INTEGER})
17 add_test(NAME test_tgt COMMAND test_tgt)
18
19 add_executable(test_var main.c)
20 target_link_libraries(test_var PRIVATE ${BLAS_LIBRARIES})
21 target_compile_definitions(test_var PUBLIC BLA_SIZEOF_INTEGER=${BLA_SIZEOF_INTEGER})
22 add_test(NAME test_var COMMAND test_var)
23
24 if((BLA_VENDOR STREQUAL "Intel10_64lp") OR
25 (BLA_VENDOR STREQUAL "All" AND EXPECT_All STREQUAL "Intel10_64lp"))
26 if(NOT BLAS_LIBRARIES MATCHES "^(-Wl,--start-group;)?[^;]*mkl_intel_lp64")
27 message(FATAL_ERROR "BLAS_LIBRARIES does not start in mkl_intel_lp64:\n ${BLAS_LIBRARIES}")
28 endif()
29 elseif((BLA_VENDOR STREQUAL "Intel10_64ilp") OR
30 (BLA_VENDOR STREQUAL "All" AND EXPECT_All STREQUAL "Intel10_64ilp"))
31 if(NOT BLAS_LIBRARIES MATCHES "^(-Wl,--start-group;)?[^;]*mkl_intel_ilp64")
32 message(FATAL_ERROR "BLAS_LIBRARIES does not start in mkl_intel_ilp64:\n ${BLAS_LIBRARIES}")
33 endif()
34 endif()