From c008398d4918ef94ab4d1ed0c4f57f63f8104aee Mon Sep 17 00:00:00 2001 From: David Seifert Date: Sun, 16 Apr 2017 00:59:28 +0200 Subject: [PATCH] Replace last occurrences of `include` install paths * Distributions might need to change the header dir * Also change the template paths in the `.pc` files to the idiomatic CMake `GNUInstallDirs` full paths, which are always correct, regardless of whether the user specified relative or absolute paths. This makes the build system somewhat easier and more idiomatic. --- BLAS/blas.pc.in | 4 ++-- CBLAS/CMakeLists.txt | 2 +- CBLAS/cblas.pc.in | 5 +++-- CMakeLists.txt | 6 ------ LAPACKE/CMakeLists.txt | 2 +- LAPACKE/lapacke.pc.in | 5 +++-- lapack.pc.in | 4 ++-- 7 files changed, 12 insertions(+), 16 deletions(-) diff --git a/BLAS/blas.pc.in b/BLAS/blas.pc.in index 4ad1bb0..3780977 100644 --- a/BLAS/blas.pc.in +++ b/BLAS/blas.pc.in @@ -1,5 +1,5 @@ -prefix=@prefix@ -libdir=@libdir@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Name: BLAS Description: FORTRAN reference implementation of BLAS Basic Linear Algebra Subprograms diff --git a/CBLAS/CMakeLists.txt b/CBLAS/CMakeLists.txt index f7be6e2..d9fa245 100644 --- a/CBLAS/CMakeLists.txt +++ b/CBLAS/CMakeLists.txt @@ -28,7 +28,7 @@ endforeach() endmacro() append_subdir_files(CBLAS_INCLUDE "include") -install(FILES ${CBLAS_INCLUDE} ${LAPACK_BINARY_DIR}/include/cblas_mangling.h DESTINATION include) +install(FILES ${CBLAS_INCLUDE} ${LAPACK_BINARY_DIR}/include/cblas_mangling.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) # -------------------------------------------------- if(BUILD_TESTING) diff --git a/CBLAS/cblas.pc.in b/CBLAS/cblas.pc.in index 7cf09f2..7c95ebb 100644 --- a/CBLAS/cblas.pc.in +++ b/CBLAS/cblas.pc.in @@ -1,9 +1,10 @@ -prefix=@prefix@ -libdir=@libdir@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Name: CBLAS Description: C Standard Interface to BLAS Basic Linear Algebra Subprograms Version: @LAPACK_VERSION@ URL: http://www.netlib.org/blas/#_cblas Libs: -L${libdir} -lcblas +Cflags: -I${includedir} Requires.private: blas diff --git a/CMakeLists.txt b/CMakeLists.txt index eed3796..d8b3c95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,12 +108,6 @@ macro(lapack_install_library lib) endmacro() set(PKG_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -set(prefix ${CMAKE_INSTALL_PREFIX}) -if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR}) - set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}") -else() - set(libdir "${CMAKE_INSTALL_LIBDIR}") -endif() # -------------------------------------------------- # Testing diff --git a/LAPACKE/CMakeLists.txt b/LAPACKE/CMakeLists.txt index d9a85ee..6812212 100644 --- a/LAPACKE/CMakeLists.txt +++ b/LAPACKE/CMakeLists.txt @@ -67,7 +67,7 @@ endif() target_link_libraries(lapacke PRIVATE ${LAPACK_LIBRARIES}) lapack_install_library(lapacke) -install(FILES ${LAPACKE_INCLUDE} ${LAPACK_BINARY_DIR}/include/lapacke_mangling.h DESTINATION include) +install(FILES ${LAPACKE_INCLUDE} ${LAPACK_BINARY_DIR}/include/lapacke_mangling.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) if(BUILD_TESTING) add_subdirectory(example) diff --git a/LAPACKE/lapacke.pc.in b/LAPACKE/lapacke.pc.in index e4b8356..68da739 100644 --- a/LAPACKE/lapacke.pc.in +++ b/LAPACKE/lapacke.pc.in @@ -1,9 +1,10 @@ -prefix=@prefix@ -libdir=@libdir@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Name: LAPACKE Description: C Standard Interface to LAPACK Linear Algebra PACKage Version: @LAPACK_VERSION@ URL: http://www.netlib.org/lapack/#_standard_c_language_apis_for_lapack Libs: -L${libdir} -llapacke +Cflags: -I${includedir} Requires.private: lapack diff --git a/lapack.pc.in b/lapack.pc.in index 711012d..316c871 100644 --- a/lapack.pc.in +++ b/lapack.pc.in @@ -1,5 +1,5 @@ -prefix=@prefix@ -libdir=@libdir@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Name: LAPACK Description: FORTRAN reference implementation of LAPACK Linear Algebra PACKage -- 2.7.4