summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorNiels Ole Salscheider <niels_ole@salscheider-online.de>2015-12-21 15:02:11 (GMT)
committerBrad King <brad.king@kitware.com>2015-12-21 15:23:48 (GMT)
commit7656662148782b7751c62efd256e644c7295c883 (patch)
tree3b68d118027732e9852208e6a21f2481b877c7a0 /Source
parentba88bfcf212bc8e93eb065e6d4bafbbf34394e68 (diff)
downloadCMake-7656662148782b7751c62efd256e644c7295c883.zip
CMake-7656662148782b7751c62efd256e644c7295c883.tar.gz
CMake-7656662148782b7751c62efd256e644c7295c883.tar.bz2
QtDialog: Add option to control XDG file install destination
Create a `CMAKE_XDGDATA_DIR` option and add a corresponding flag to the `bootstrap` script. This is needed for multiarch layouts where the prefix is `/usr/${host}` but where architecture-independent files (like the XDG-specific ones) are installed to `/usr/share`.
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeInstallDestinations.cmake5
-rw-r--r--Source/QtDialog/CMakeLists.txt6
2 files changed, 8 insertions, 3 deletions
diff --git a/Source/CMakeInstallDestinations.cmake b/Source/CMakeInstallDestinations.cmake
index 99c86ca..2f9d95a 100644
--- a/Source/CMakeInstallDestinations.cmake
+++ b/Source/CMakeInstallDestinations.cmake
@@ -3,24 +3,29 @@ if(BEOS)
set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # HAIKU
set(CMAKE_MAN_DIR_DEFAULT "documentation/man") # HAIKU
set(CMAKE_DOC_DIR_DEFAULT "documentation/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # HAIKU
+ set(CMAKE_XDGDATA_DIR_DEFAULT "share") # HAIKU
elseif(CYGWIN)
set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION}") # CYGWIN
set(CMAKE_DOC_DIR_DEFAULT "share/doc/cmake-${CMake_VERSION}") # CYGWIN
set(CMAKE_MAN_DIR_DEFAULT "share/man") # CYGWIN
+ set(CMAKE_XDGDATA_DIR_DEFAULT "share") # CYGWIN
else()
set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # OTHER
set(CMAKE_DOC_DIR_DEFAULT "doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") # OTHER
set(CMAKE_MAN_DIR_DEFAULT "man") # OTHER
+ set(CMAKE_XDGDATA_DIR_DEFAULT "share") # OTHER
endif()
set(CMAKE_DATA_DIR_DESC "data")
set(CMAKE_DOC_DIR_DESC "docs")
set(CMAKE_MAN_DIR_DESC "man pages")
+set(CMAKE_XDGDATA_DIR_DESC "XDG specific files")
foreach(v
CMAKE_DATA_DIR
CMAKE_DOC_DIR
CMAKE_MAN_DIR
+ CMAKE_XDGDATA_DIR
)
# Populate the cache with empty values so we know when the user sets them.
set(${v} "" CACHE STRING "")
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 9161ad3..f17de5d 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -193,7 +193,7 @@ if(UNIX AND NOT APPLE)
foreach (size IN ITEMS 32 128)
install(
FILES "${CMAKE_CURRENT_SOURCE_DIR}/CMakeSetup${size}.png"
- DESTINATION "share/icons/hicolor/${size}x${size}/apps"
+ DESTINATION "${CMAKE_XDGDATA_DIR}/icons/hicolor/${size}x${size}/apps"
${COMPONENT}
RENAME "CMakeSetup.png")
endforeach ()
@@ -201,10 +201,10 @@ if(UNIX AND NOT APPLE)
# install a desktop file so CMake appears in the application start menu
# with an icon
install(FILES CMake.desktop
- DESTINATION share/applications
+ DESTINATION "${CMAKE_XDGDATA_DIR}/applications"
${COMPONENT})
install(FILES cmakecache.xml
- DESTINATION share/mime/packages
+ DESTINATION "${CMAKE_XDGDATA_DIR}/mime/packages"
${COMPONENT})
endif()