Skip to content

Commit

Permalink
[cmake] install paths not hardwired + use GNUInstallDirs convention
Browse files Browse the repository at this point in the history
resolves #165
  • Loading branch information
evaleev committed Oct 22, 2023
1 parent 33d2218 commit 4363e1f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ include(FeatureSummary)
include(RedefaultableOption)
include(CMakePackageConfigHelpers)
include(AddCustomTargetSubproject)
include(CMakePushCheckState)
include(CTest) # defines BUILD_TESTING option

# Configure options
Expand All @@ -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}")
Expand Down

0 comments on commit 4363e1f

Please sign in to comment.