From 09b9106550fc05f71a49a3ddef7db8567c5888ac Mon Sep 17 00:00:00 2001 From: Wouter van Kesteren Date: Sat, 17 Dec 2016 00:18:39 +0100 Subject: [PATCH] Use CMAKE_INSTALL_FULL_DATA{,ROOT}DIR Exherbo installs architecture dependent data in a different place than architecture independent data. More concretely: binaries go in /usr/$chost/{bin,lib}, data goes in /usr/share and configs in /etc, /etc is already configurable through CMAKE_INSTALL_FULL_SYSCONFDIR but the datadir was not. This patch fixes it so that things can be pushed in the right places. --- CMake/Manpage.cmake | 2 +- CMakeLists.txt | 4 ++-- completions/zsh/CMakeLists.txt | 2 +- config.in | 4 ++-- sway/CMakeLists.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMake/Manpage.cmake b/CMake/Manpage.cmake index e5503760..d9780bc4 100644 --- a/CMake/Manpage.cmake +++ b/CMake/Manpage.cmake @@ -25,7 +25,7 @@ function(add_manpage name section) install( FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name}.${section} - DESTINATION share/man/man${section} + DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/man/man${section} COMPONENT documentation ) endfunction() diff --git a/CMakeLists.txt b/CMakeLists.txt index f55fadae..d1c38ce3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,14 +129,14 @@ if(zsh-completions) endif() install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop - DESTINATION share/wayland-sessions + DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/wayland-sessions COMPONENT data ) if(default-wallpaper) install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/assets/ - DESTINATION share/sway + DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/sway COMPONENT data FILES_MATCHING PATTERN "*Wallpaper*" ) diff --git a/completions/zsh/CMakeLists.txt b/completions/zsh/CMakeLists.txt index ac307d7d..62c85090 100644 --- a/completions/zsh/CMakeLists.txt +++ b/completions/zsh/CMakeLists.txt @@ -1,4 +1,4 @@ install( FILES _sway _swaymsg _swaygrab _swaylock - DESTINATION share/zsh/site-functions/ + DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/zsh/site-functions/ ) diff --git a/config.in b/config.in index 3cb0525e..a262fc82 100644 --- a/config.in +++ b/config.in @@ -20,8 +20,8 @@ set $menu dmenu_run ### Output configuration # -# Default wallpaper (more resolutions are available in /usr/share/sway/) -output * bg /usr/share/sway/Sway_Wallpaper_Blue_1920x1080.png fill +# Default wallpaper (more resolutions are available in __DATADIR__/sway/) +output * bg __DATADIR__/sway/Sway_Wallpaper_Blue_1920x1080.png fill # # Example configuration: # diff --git a/sway/CMakeLists.txt b/sway/CMakeLists.txt index 4532a6c3..448335cc 100644 --- a/sway/CMakeLists.txt +++ b/sway/CMakeLists.txt @@ -74,7 +74,7 @@ function(add_config name source destination) add_custom_command( OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name} COMMAND sed -r - 's?__PREFIX__?${CMAKE_INSTALL_PREFIX}?g\; s?__SYSCONFDIR__?${CMAKE_INSTALL_FULL_SYSCONFDIR}?g' + 's?__PREFIX__?${CMAKE_INSTALL_PREFIX}?g\; s?__SYSCONFDIR__?${CMAKE_INSTALL_FULL_SYSCONFDIR}?g\; s?__DATADIR__?${CMAKE_INSTALL_FULL_DATADIR}?g' ${PROJECT_SOURCE_DIR}/${source}.in > ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${name} DEPENDS ${PROJECT_SOURCE_DIR}/${source}.in COMMENT "Generating config file ${source}"