diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index beb73210..943e3cfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,8 @@ set( ${LAPACK_MAJOR_VERSION}.${LAPACK_MINOR_VERSION}.${LAPACK_PATCH_VERSION} ) +include(GNUInstallDirs) + # Updated OSX RPATH settings # In response to CMake 3.0 generating warnings regarding policy CMP0042, # the OSX RPATH settings have been updated per recommendations found @@ -26,9 +28,9 @@ set( set(CMAKE_MACOSX_RPATH ON) set(CMAKE_SKIP_BUILD_RPATH FALSE) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) -list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" isSystemDir) +list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES ${CMAKE_INSTALL_FULL_LIBDIR} isSystemDir) if("${isSystemDir}" STREQUAL "-1") - set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") + set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) endif() @@ -96,32 +98,21 @@ endif() set(LAPACK_INSTALL_EXPORT_NAME lapack-targets) -if(UNIX) - include(GNUInstallDirs) - set(ARCHIVE_DIR ${CMAKE_INSTALL_LIBDIR}) - set(LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}) - set(RUNTIME_DIR ${CMAKE_INSTALL_BINDIR}) -else() - set(ARCHIVE_DIR lib${LIB_SUFFIX}) - set(LIBRARY_DIR lib${LIB_SUFFIX}) - set(RUNTIME_DIR bin) -endif() - macro(lapack_install_library lib) install(TARGETS ${lib} EXPORT ${LAPACK_INSTALL_EXPORT_NAME} - ARCHIVE DESTINATION ${ARCHIVE_DIR} - LIBRARY DESTINATION ${LIBRARY_DIR} - RUNTIME DESTINATION ${RUNTIME_DIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) endmacro() -set(PKG_CONFIG_DIR ${LIBRARY_DIR}/pkgconfig) +set(PKG_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig) set(prefix ${CMAKE_INSTALL_PREFIX}) -if(NOT IS_ABSOLUTE ${LIBRARY_DIR}) - set(libdir "\${prefix}/${LIBRARY_DIR}") +if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR}) + set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}") else() - set(libdir "${LIBRARY_DIR}") + set(libdir "${CMAKE_INSTALL_LIBDIR}") endif() # -------------------------------------------------- @@ -162,17 +153,29 @@ set(DSECOND_SRC ${LAPACK_SOURCE_DIR}/INSTALL/dsecnd_${TIME_FUNC}.f) option(BUILD_SHARED_LIBS "Build shared libraries" OFF) option(BUILD_TESTING "Build tests" OFF) +message(STATUS "Build tests: ${BUILD_TESTING}") -# deprecated LAPACK routines +# deprecated LAPACK and LAPACKE routines option(BUILD_DEPRECATED "Build deprecated routines" OFF) +message(STATUS "Build deprecated routines: ${BUILD_DEPRECATED}") # -------------------------------------------------- # Precision to build # By default all precisions are generated -option(BUILD_SINGLE "Build LAPACK Single Precision" ON) -option(BUILD_DOUBLE "Build LAPACK Double Precision" ON) -option(BUILD_COMPLEX "Build LAPACK Complex Precision" ON) -option(BUILD_COMPLEX16 "Build LAPACK Double Complex Precision" ON) +option(BUILD_SINGLE "Build single precision real" ON) +option(BUILD_DOUBLE "Build double precision real" ON) +option(BUILD_COMPLEX "Build single precision complex" ON) +option(BUILD_COMPLEX16 "Build double precision complex" ON) +message(STATUS "Build single precision real: ${BUILD_SINGLE}") +message(STATUS "Build double precision real: ${BUILD_DOUBLE}") +message(STATUS "Build single precision complex: ${BUILD_COMPLEX}") +message(STATUS "Build double precision complex: ${BUILD_COMPLEX16}") + +if(NOT (BUILD_SINGLE OR BUILD_DOUBLE OR BUILD_COMPLEX OR BUILD_COMPLEX16)) + message(FATAL_ERROR "Nothing to build, no precision selected. + Please enable at least one of these: + BUILD_SINGLE, BUILD_DOUBLE, BUILD_COMPLEX, BUILD_COMPLEX16.") +endif() # -------------------------------------------------- # Subdirectories that need to be processed @@ -275,7 +278,6 @@ else() CACHE STRING "Linker flags for shared libs" FORCE) endif() -message(STATUS "BUILD TESTING : ${BUILD_TESTING}") if(BUILD_TESTING) add_subdirectory(TESTING) endif() @@ -346,7 +348,7 @@ endif() set(_lapack_config_install_guard_target "") if(ALL_TARGETS) install(EXPORT lapack-targets - DESTINATION ${LIBRARY_DIR}/cmake/lapack-${LAPACK_VERSION}) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lapack-${LAPACK_VERSION}) # Choose one of the lapack targets to use as a guard for # lapack-config.cmake to load targets from the install tree. @@ -396,5 +398,5 @@ write_basic_package_version_file( install(FILES ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake ${LAPACK_BINARY_DIR}/lapack-config-version.cmake - DESTINATION ${LIBRARY_DIR}/cmake/lapack-${LAPACK_VERSION} + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lapack-${LAPACK_VERSION} ) |