Use GNUInstallDirs to allow changing target directories
* Multi-lib distributions need to change the libdir which is only portably possible with `GNUInstallDirs`. * Multi-arch distributions such as Debian and Exherbo need to be able to change the bindir.
This commit is contained in:
parent
77d16ffc69
commit
ed79a29d87
|
@ -2,7 +2,7 @@
|
||||||
## Author: Hank Anderson <hank@statease.com>
|
## Author: Hank Anderson <hank@statease.com>
|
||||||
##
|
##
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.8.4)
|
cmake_minimum_required(VERSION 2.8.5)
|
||||||
project(OpenBLAS)
|
project(OpenBLAS)
|
||||||
set(OpenBLAS_MAJOR_VERSION 0)
|
set(OpenBLAS_MAJOR_VERSION 0)
|
||||||
set(OpenBLAS_MINOR_VERSION 2)
|
set(OpenBLAS_MINOR_VERSION 2)
|
||||||
|
@ -12,6 +12,9 @@ set(OpenBLAS_VERSION "${OpenBLAS_MAJOR_VERSION}.${OpenBLAS_MINOR_VERSION}.${Open
|
||||||
enable_language(ASM)
|
enable_language(ASM)
|
||||||
enable_language(C)
|
enable_language(C)
|
||||||
|
|
||||||
|
# Adhere to GNU filesystem layout conventions
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(OpenBLAS_LIBNAME libopenblas)
|
set(OpenBLAS_LIBNAME libopenblas)
|
||||||
else()
|
else()
|
||||||
|
@ -216,23 +219,20 @@ set_target_properties(${OpenBLAS_LIBNAME} PROPERTIES
|
||||||
|
|
||||||
# Install libraries
|
# Install libraries
|
||||||
install(TARGETS ${OpenBLAS_LIBNAME}
|
install(TARGETS ${OpenBLAS_LIBNAME}
|
||||||
RUNTIME DESTINATION bin
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
ARCHIVE DESTINATION lib
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
LIBRARY DESTINATION lib )
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} )
|
||||||
|
|
||||||
# Install include files
|
# Install include files
|
||||||
FILE(GLOB_RECURSE INCLUDE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
|
FILE(GLOB_RECURSE INCLUDE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
|
||||||
install (FILES ${INCLUDE_FILES} DESTINATION include)
|
install (FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
install (TARGETS ${OpenBLAS_LIBNAME}_static DESTINATION lib)
|
install (TARGETS ${OpenBLAS_LIBNAME}_static DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(FindPkgConfig QUIET)
|
include(FindPkgConfig QUIET)
|
||||||
if(PKG_CONFIG_FOUND)
|
if(PKG_CONFIG_FOUND)
|
||||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
|
||||||
set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
|
|
||||||
set(includedir ${CMAKE_INSTALL_PREFIX}/include)
|
|
||||||
configure_file(${PROJECT_SOURCE_DIR}/cmake/openblas.pc.in ${PROJECT_BINARY_DIR}/openblas.pc @ONLY)
|
configure_file(${PROJECT_SOURCE_DIR}/cmake/openblas.pc.in ${PROJECT_BINARY_DIR}/openblas.pc @ONLY)
|
||||||
install (FILES ${PROJECT_BINARY_DIR}/openblas.pc DESTINATION lib/pkgconfig/)
|
install (FILES ${PROJECT_BINARY_DIR}/openblas.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
prefix=@prefix@
|
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
||||||
libdir=@libdir@
|
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
||||||
includedir=@includedir@
|
|
||||||
|
|
||||||
Name: OpenBLAS
|
Name: OpenBLAS
|
||||||
Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version
|
Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version
|
||||||
|
|
Loading…
Reference in New Issue