File: LinAlgModulesMacros.cmake

package info (click to toggle)
ga 5.9.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,472 kB
  • sloc: ansic: 192,963; fortran: 53,761; f90: 11,218; cpp: 5,784; makefile: 2,248; sh: 1,945; python: 1,734; perl: 534; csh: 134; asm: 106
file content (71 lines) | stat: -rw-r--r-- 2,041 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
set( LINALG_MACROS_DIR ${CMAKE_CURRENT_LIST_DIR} )

macro( find_linalg_dependencies _libs )
  include( CMakeFindDependencyMacro )
  foreach( _lib ${${_libs}} )
    if (${_lib} MATCHES "OpenMP")
      find_dependency(OpenMP)
    elseif (${_lib} MATCHES "Threads")
      if (NOT TARGET Threads::Threads)
        find_dependency(Threads)
        # Threads::Threads by default is not GLOBAL, so to allow users of LINALG_LIBRARIES to safely use it we need to make it global
        # more discussion here: https://gitlab.kitware.com/cmake/cmake/-/issues/17256
        set_target_properties(Threads::Threads PROPERTIES IMPORTED_GLOBAL TRUE)
      endif(NOT TARGET Threads::Threads)
    elseif (${_lib} MATCHES "tbb")
      find_dependency(TBB)
    elseif (${_lib} MATCHES "MPI")
      find_dependency(MPI)  
    endif()
  endforeach()
endmacro()

function( install_linalg_modules _dest_dir )

set( LINALG_FIND_MODULES
     FindBLAS.cmake
     FindBLIS.cmake
     FindIBMESSL.cmake
     FindIntelMKL.cmake
     FindLAPACK.cmake
     FindOpenBLAS.cmake
     FindReferenceBLAS.cmake
     FindReferenceLAPACK.cmake
     FindReferenceScaLAPACK.cmake
     FindScaLAPACK.cmake
     FindILP64.cmake
     FindTBB.cmake
     FindStandardFortran.cmake
     LinAlgModulesMacros.cmake
)

set( LINALG_UTIL_FILES
     util/BLASUtilities.cmake
     util/blis_int_size.c
     util/func_check.c
     util/get_mpi_vendor.c
     util/ilp64_checker.c
     util/lapack_ilp64_checker.c
     util/openblas_int_size.c
     util/CommonFunctions.cmake
     util/IntrospectMPI.cmake
     util/IntrospectOpenMP.cmake
     util/LAPACKUtilities.cmake
     util/ScaLAPACKUtilities.cmake )

list( TRANSFORM LINALG_FIND_MODULES
      PREPEND   ${LINALG_MACROS_DIR}/ )
list( TRANSFORM LINALG_UTIL_FILES
      PREPEND   ${LINALG_MACROS_DIR}/ )

install(
  FILES ${LINALG_FIND_MODULES} ${LINALG_MACROS_DIR}/LICENSE.txt
  DESTINATION ${${_dest_dir}}/linalg-cmake-modules
)

install(
  FILES ${LINALG_UTIL_FILES}
  DESTINATION ${${_dest_dir}}/linalg-cmake-modules/util
)

endfunction()