aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
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)