summaryrefslogtreecommitdiff
blob: 7e024c937e7ccf2ecf6cc35072c57014ee234219 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From cb845f462072d1d1e4045eac5f16b4db1f552309 Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Mon, 2 Oct 2017 19:22:41 +0200
Subject: [PATCH] Bug 781645 - Skip GSettings schema compile and icon cache
 update when DESTDIR is set

(cherry picked from commit b40001cac702a74f818afb3f38acf9521e9d7b62)
---
 cmake/modules/GLibTools.cmake | 8 +++++---
 cmake/modules/IconCache.cmake | 8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/cmake/modules/GLibTools.cmake b/cmake/modules/GLibTools.cmake
index fc8eb827c8..f0be5586db 100644
--- a/cmake/modules/GLibTools.cmake
+++ b/cmake/modules/GLibTools.cmake
@@ -238,9 +238,11 @@ macro(add_gsettings_schemas _target _schema0)
 	if(_install_code)
 		# Compile gsettings schemas and ensure that all of them are in the place.
 		install(CODE
-			"execute_process(${_install_code}
-				COMMAND ${CMAKE_COMMAND} -E chdir . \"${GLIB_COMPILE_SCHEMAS}\" \"${GSETTINGS_SCHEMAS_DIR}\"
-			)")
+			"if(\"\$ENV{DESTDIR}\" STREQUAL \"\")
+				execute_process(${_install_code}
+					COMMAND ${CMAKE_COMMAND} -E chdir . \"${GLIB_COMPILE_SCHEMAS}\" \"${GSETTINGS_SCHEMAS_DIR}\"
+				)
+			endif(\"\$ENV{DESTDIR}\" STREQUAL \"\")")
 	endif(_install_code)
 endmacro(add_gsettings_schemas)
 
diff --git a/cmake/modules/IconCache.cmake b/cmake/modules/IconCache.cmake
index 6f7f5f0f24..145b843f1d 100644
--- a/cmake/modules/IconCache.cmake
+++ b/cmake/modules/IconCache.cmake
@@ -60,9 +60,11 @@ macro(add_icon_cache_files _destdir _fileslistvar)
 
 	if(GTK_UPDATE_ICON_CACHE)
 		install(CODE
-			"execute_process(${_install_code}
-				COMMAND ${CMAKE_COMMAND} -E chdir . ${_update_icon_cache_cmd}
-			)")
+			"if(\"\$ENV{DESTDIR}\" STREQUAL \"\")
+				execute_process(${_install_code}
+					COMMAND ${CMAKE_COMMAND} -E chdir . ${_update_icon_cache_cmd}
+				)
+			endif(\"\$ENV{DESTDIR}\" STREQUAL \"\")")
 	endif(GTK_UPDATE_ICON_CACHE)
 endmacro(add_icon_cache_files)
 
-- 
2.15.1