diff options
author | Pierre Ossman <ossman@cendio.se> | 2019-02-01 13:24:20 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2020-03-12 12:03:52 +0100 |
commit | e4f253e1d1e1851bce3ea4a5511622696daf6d06 (patch) | |
tree | f1fee3aaf1feca1c040f2fc8fcf31a8310d023ba /CMakeLists.txt | |
parent | 7694f9b4aae475a7b5985e0e960e21c5869f64cf (diff) | |
download | tigervnc-e4f253e1d1e1851bce3ea4a5511622696daf6d06.tar.gz tigervnc-e4f253e1d1e1851bce3ea4a5511622696daf6d06.zip |
Use standard install dir variable names
This makes our builds directly compatible with most distributions
without packagers/users having to specify extra flags.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 540ef944..72672cd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,9 @@ cmake_minimum_required(VERSION 2.8.11) if(POLICY CMP0022) cmake_policy(SET CMP0022 OLD) endif() +if(${CMAKE_VERSION} VERSION_LESS "3.4.0") + message(WARNING "CMake 3.4.0 or newer is required to get correct default installation paths") +endif() # Internal cmake modules set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) @@ -27,19 +30,12 @@ set(VERSION 1.10.80) set(RCVERSION 1,10,80,0) # Installation paths -set(SYSCONF_DIR "${CMAKE_INSTALL_PREFIX}/etc") -set(BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin") -set(SBIN_DIR "${CMAKE_INSTALL_PREFIX}/sbin") -set(DATA_DIR "${CMAKE_INSTALL_PREFIX}/share") -set(LIBEXEC_DIR "${CMAKE_INSTALL_PREFIX}/libexec") -set(MAN_DIR "${DATA_DIR}/man") -set(LOCALE_DIR "${DATA_DIR}/locale") -set(DOC_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/${CMAKE_PROJECT_NAME}-${VERSION}") -set(UNIT_DIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system") - -if(WIN32) -set(BIN_DIR "${CMAKE_INSTALL_PREFIX}") -set(DOC_DIR "${CMAKE_INSTALL_PREFIX}") +include(GNUInstallDirs) +set(CMAKE_INSTALL_UNITDIR "lib/systemd/system" CACHE PATH "systemd unit files (lib/systemd/system)") +if(IS_ABSOLUTE "${CMAKE_INSTALL_UNITDIR}") + set(CMAKE_INSTALL_FULL_UNITDIR "${CMAKE_INSTALL_UNITDIR}") +else() + set(CMAKE_INSTALL_FULL_UNITDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_UNITDIR}") endif() option(INSTALL_SYSTEMD_UNITS "Install TigerVNC systemd units" ON) |