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 FortranCInterface_HEADER( ${CMAKE_CURRENT_SOURCE_DIR}/include/cblas_mangling.h
10 SYMBOL_NAMESPACE "F77_" )
12 # Old way to detect mangling
13 #include(FortranMangling)
14 #FORTRAN_MANGLING(CDEFS)
15 #set(CDEFS ${CDEFS} CACHE STRING "Fortran Mangling" FORCE)
16 #MESSAGE(STATUS "=========")
18 # --------------------------------------------------
20 #ADD_DEFINITIONS( "-D${CDEFS}")
23 include_directories( include )
24 add_subdirectory(include)
27 macro(append_subdir_files variable dirname)
28 get_directory_property(holder DIRECTORY ${dirname} DEFINITION ${variable})
29 foreach(depfile ${holder})
30 list(APPEND ${variable} "${dirname}/${depfile}")
34 append_subdir_files(CBLAS_INCLUDE "include")
35 INSTALL( FILES ${CBLAS_INCLUDE} DESTINATION include )
37 # --------------------------------------------------
39 add_subdirectory(testing)
40 add_subdirectory(examples)
44 set(ALL_TARGETS ${ALL_TARGETS} blas)
47 # Export cblas targets from the
48 # install tree, if any.
49 set(_cblas_config_install_guard_target "")
51 install(EXPORT cblas-targets
52 DESTINATION lib/cmake/cblas-${LAPACK_VERSION})
53 # Choose one of the cblas targets to use as a guard for
54 # cblas-config.cmake to load targets from the install tree.
55 list(GET ALL_TARGETS 0 _cblas_config_install_guard_target)
58 # Export cblas targets from the build tree, if any.
59 set(_cblas_config_build_guard_target "")
61 export(TARGETS ${ALL_TARGETS} FILE cblas-targets.cmake)
63 # Choose one of the cblas targets to use as a guard
64 # for cblas-config.cmake to load targets from the build tree.
65 list(GET ALL_TARGETS 0 _cblas_config_build_guard_target)
68 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-version.cmake.in
69 ${LAPACK_BINARY_DIR}/cblas-config-version.cmake @ONLY)
70 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-build.cmake.in
71 ${LAPACK_BINARY_DIR}/cblas-config.cmake @ONLY)
74 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cblas.pc.in ${CMAKE_CURRENT_BINARY_DIR}/cblas.pc)
76 ${CMAKE_CURRENT_BINARY_DIR}/cblas.pc
77 DESTINATION ${PKG_CONFIG_DIR}
80 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-install.cmake.in
81 ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/cblas-config.cmake @ONLY)
83 ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/cblas-config.cmake
84 ${LAPACK_BINARY_DIR}/cblas-config-version.cmake
85 DESTINATION lib/cmake/cblas-${LAPACK_VERSION}
88 #install(EXPORT cblas-targets
89 # DESTINATION lib/cmake/cblas-${LAPACK_VERSION})