From f884850f034e4b6877b0bda9c043f9088f5e2bdd Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Sun, 22 Oct 2023 13:09:43 -0400 Subject: [PATCH] [cmake] install paths not hardwired + use GNUInstallDirs convention resolves #165 --- CMakeLists.txt | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 594aa2c2..d84b65a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,7 @@ include(FeatureSummary) include(RedefaultableOption) include(CMakePackageConfigHelpers) include(AddCustomTargetSubproject) +include(CMakePushCheckState) include(CTest) # defines BUILD_TESTING option # Configure options @@ -77,28 +78,27 @@ add_feature_info("TARGET_MAX_INDEX_RANK=${TARGET_MAX_INDEX_RANK}" TRUE "default set(TARGET_ARCH "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") -include(CMakePushCheckState) -include(GNUInstallDirs) -include(AppendFlags) - ########################## -# Standard build variables +# INSTALL variables ########################## -set(BTAS_INSTALL_BINDIR "bin" +include(GNUInstallDirs) +set(BTAS_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH "BTAS BIN install directory") -set(BTAS_INSTALL_INCLUDEDIR "include" +set(BTAS_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}" CACHE PATH "BTAS INCLUDE install directory") -set(BTAS_INSTALL_LIBDIR "lib" +set(BTAS_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "BTAS LIB install directory") -set(BTAS_INSTALL_SHAREDIR "share/BTAS/${BTAS_MAJOR_VERSION}.${BTAS_MINOR_VERSION}.${BTAS_MICRO_VERSION}" - CACHE PATH "BTAS SHARE install directory") -set(BTAS_INSTALL_DATADIR "${BTAS_INSTALL_SHAREDIR}/data" +set(BTAS_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}/BTAS/${BTAS_EXT_VERSION}" CACHE PATH "BTAS DATA install directory") -set(BTAS_INSTALL_DOCDIR "${BTAS_INSTALL_SHAREDIR}/doc" +set(BTAS_INSTALL_DOCDIR "${BTAS_INSTALL_DATADIR}/doc" CACHE PATH "BTAS DOC install directory") -set(BTAS_INSTALL_CMAKEDIR "lib/cmake/BTAS" +set(BTAS_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/BTAS" CACHE PATH "BTAS CMAKE install directory") +########################## +# Standard build variables +########################## +include(AppendFlags) # Get standard build variables from the environment if they have not already been set if(NOT CMAKE_C_FLAGS OR NOT DEFINED CMAKE_C_FLAGS) set(CMAKE_C_FLAGS "$ENV{CPPFLAGS}")