diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-03-21 22:24:56 +0100 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-03-21 22:31:09 +0100 |
commit | 928e79cf5d51a3c78d388b7eb972b3dae1ebbb68 (patch) | |
tree | 9ca1c5c89cb6b8127baaf1827337cd8c1b1ef7e4 /modules/ECMInstallIcons.cmake | |
parent | 09008700af42967f6ad10c9b3ef565cc2f727874 (diff) | |
download | extra-cmake-modules-928e79cf5d51a3c78d388b7eb972b3dae1ebbb68.tar.gz extra-cmake-modules-928e79cf5d51a3c78d388b7eb972b3dae1ebbb68.tar.bz2 |
Fix _ecm_update_iconcache to only update the install location
Use the CMAKE_INSTALL_PREFIX to ensure that only a file in the install
location will be touched. Otherwise a user running
make install
as root would create root-owned files in the build directory.
Use the cmake -E touch command to update the mtime of the directory.
That command exists since late 2007, but this manual file creation
workaround pre-dates that by a few months (kdelibs SVN revision 691973).
There is no chance any calling code is already passing an absolute path
here because later in the function it is already used together with a
CMAKE_INSTALL_PREFIX.
Inspired-by: REVIEW 127445
Diffstat (limited to 'modules/ECMInstallIcons.cmake')
-rw-r--r-- | modules/ECMInstallIcons.cmake | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/ECMInstallIcons.cmake b/modules/ECMInstallIcons.cmake index 3923636a..730bde7a 100644 --- a/modules/ECMInstallIcons.cmake +++ b/modules/ECMInstallIcons.cmake @@ -206,8 +206,7 @@ function(_ecm_update_iconcache installdir theme) install(CODE " set(DESTDIR_VALUE \"\$ENV{DESTDIR}\") if (NOT DESTDIR_VALUE) - file(WRITE \"${installdir}/${theme}/temp.txt\" \"update\") - file(REMOVE \"${installdir}/${theme}/temp.txt\") + execute_process(COMMAND \"${CMAKE_COMMAND}\" -E touch \"${CMAKE_INSTALL_PREFIX}/${installdir}/${theme}\") set(HAVE_GTK_UPDATE_ICON_CACHE_EXEC ${GTK_UPDATE_ICON_CACHE_EXECUTABLE}) if (HAVE_GTK_UPDATE_ICON_CACHE_EXEC) execute_process(COMMAND ${GTK_UPDATE_ICON_CACHE_EXECUTABLE} -q -t -i . WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}/${installdir}/${theme}\") |