1 message(STATUS "CBLAS enable")
4 set(LAPACK_INSTALL_EXPORT_NAME cblas-targets)
6 # Create a header file cblas.h for the routines called in my C programs
7 include(FortranCInterface)
8 ## Ensure that the fortran compiler and c compiler specified are compatible
9 FortranCInterface_VERIFY()
10 FortranCInterface_HEADER( ${LAPACK_BINARY_DIR}/include/cblas_mangling.h
11 MACRO_NAMESPACE "F77_"
12 SYMBOL_NAMESPACE "F77_" )
13 if( NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND)
14 message(WARNING "Reverting to pre-defined include/lapacke_mangling.h")
15 configure_file( include/lapacke_mangling_with_flags.h.in
16 ${LAPACK_BINARY_DIR}/include/lapacke_mangling.h )
19 include_directories( include ${LAPACK_BINARY_DIR}/include )
20 add_subdirectory(include)
23 macro(append_subdir_files variable dirname)
24 get_directory_property(holder DIRECTORY ${dirname} DEFINITION ${variable})
25 foreach(depfile ${holder})
26 list(APPEND ${variable} "${dirname}/${depfile}")
30 append_subdir_files(CBLAS_INCLUDE "include")
31 install( FILES ${CBLAS_INCLUDE} ${LAPACK_BINARY_DIR}/include/cblas_mangling.h DESTINATION include )
33 # --------------------------------------------------
35 add_subdirectory(testing)
36 add_subdirectory(examples)
40 set(ALL_TARGETS ${ALL_TARGETS} blas)
43 # Export cblas targets from the
44 # install tree, if any.
45 set(_cblas_config_install_guard_target "")
47 install(EXPORT cblas-targets
48 DESTINATION ${LIBRARY_DIR}/cmake/cblas-${LAPACK_VERSION})
49 # Choose one of the cblas targets to use as a guard for
50 # cblas-config.cmake to load targets from the install tree.
51 list(GET ALL_TARGETS 0 _cblas_config_install_guard_target)
54 # Export cblas targets from the build tree, if any.
55 set(_cblas_config_build_guard_target "")
57 export(TARGETS ${ALL_TARGETS} FILE cblas-targets.cmake)
59 # Choose one of the cblas targets to use as a guard
60 # for cblas-config.cmake to load targets from the build tree.
61 list(GET ALL_TARGETS 0 _cblas_config_build_guard_target)
64 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-version.cmake.in
65 ${LAPACK_BINARY_DIR}/cblas-config-version.cmake @ONLY)
66 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-build.cmake.in
67 ${LAPACK_BINARY_DIR}/cblas-config.cmake @ONLY)
70 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cblas.pc.in ${CMAKE_CURRENT_BINARY_DIR}/cblas.pc)
72 ${CMAKE_CURRENT_BINARY_DIR}/cblas.pc
73 DESTINATION ${PKG_CONFIG_DIR}
76 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-install.cmake.in
77 ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/cblas-config.cmake @ONLY)
79 ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/cblas-config.cmake
80 ${LAPACK_BINARY_DIR}/cblas-config-version.cmake
81 DESTINATION ${LIBRARY_DIR}/cmake/cblas-${LAPACK_VERSION}
84 #install(EXPORT cblas-targets
85 # DESTINATION ${LIBRARY_DIR}/cmake/cblas-${LAPACK_VERSION})