Merge lp:~compiz-team/compiz/compiz.fix_1046701 into lp:compiz/0.9.8

Proposed by Sam Spilsbury
Status: Merged
Approved by: Daniel van Vugt
Approved revision: 3361
Merged at revision: 3362
Proposed branch: lp:~compiz-team/compiz/compiz.fix_1046701
Merge into: lp:compiz/0.9.8
Diff against target: 146 lines (+79/-26)
3 files modified
CMakeLists.txt (+3/-0)
cmake/CompizGSettings.cmake (+71/-25)
postinst/CMakeLists.txt (+5/-1)
To merge this branch: bzr merge lp:~compiz-team/compiz/compiz.fix_1046701
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
jenkins (community) continuous-integration Approve
Review via email: mp+123501@code.launchpad.net

Commit message

Regenerate the local settings recompilation rule when cmake is re-run
and ensure that we pull in all the dependencies.

This fixes the case where a new gsettings schema got added for building but it wasn't recompiled locally, which could cause test failures because ... gsettings.

(LP: #1046701)

Description of the change

Regenerate the local settings recompilation rule when cmake is re-run
and ensure that we pull in all the dependencies.

This fixes the case where a new gsettings schema got added for building but it wasn't recompiled locally, which could cause test failures because ... gsettings.

(LP: #1046701)

To post a comment you must log in.
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Seems to work...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2012-09-05 20:45:21 +0000
3+++ CMakeLists.txt 2012-09-10 08:01:41 +0000
4@@ -79,6 +79,9 @@
5
6 # Don't allow subdirectories to add schema recompile rule
7 set_property (GLOBAL
8+ PROPERTY GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE
9+ TRUE)
10+set_property (GLOBAL
11 PROPERTY COMPIZ_INHIBIT_ADD_INSTALL_RECOMPILE_RULE
12 TRUE)
13
14
15=== modified file 'cmake/CompizGSettings.cmake'
16--- cmake/CompizGSettings.cmake 2012-08-31 04:18:02 +0000
17+++ cmake/CompizGSettings.cmake 2012-09-10 08:01:41 +0000
18@@ -106,37 +106,83 @@
19 USE_GSETTINGS)
20 endfunction ()
21
22-function (add_gsettings_schema_to_recompilation_list _target_name_for_schema)
23-
24- find_program (GLIB_COMPILE_SCHEMAS glib-compile-schemas)
25- mark_as_advanced (GLIB_COMPILE_SCHEMAS)
26+function (add_gsettings_local_recompilation_rule _schemas)
27+
28+ get_property (GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE_SET
29+ GLOBAL
30+ PROPERTY GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE
31+ SET)
32+
33+ if (GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE_SET)
34+ get_property (GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE
35+ GLOBAL
36+ PROPERTY GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE)
37+ else (GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE_SET)
38+ set (GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE FALSE)
39+ endif (GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE_SET)
40
41 get_property (GSETTINGS_LOCAL_COMPILE_TARGET_SET
42 GLOBAL
43 PROPERTY GSETTINGS_LOCAL_COMPILE_TARGET_SET
44 SET)
45
46- if (NOT GSETTINGS_LOCAL_COMPILE_TARGET_SET AND
47- GLIB_COMPILE_SCHEMAS)
48-
49- add_custom_command (OUTPUT ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/gschemas.compiled
50- COMMAND ${GLIB_COMPILE_SCHEMAS} --targetdir=${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/
51- ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/
52- COMMENT "Recompiling GSettings schemas locally"
53- )
54-
55- add_custom_target (compiz_gsettings_compile_local ALL
56- DEPENDS ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/gschemas.compiled)
57-
58- set_property (GLOBAL
59- PROPERTY GSETTINGS_LOCAL_COMPILE_TARGET_SET
60- TRUE)
61-
62- endif (NOT GSETTINGS_LOCAL_COMPILE_TARGET_SET AND
63- GLIB_COMPILE_SCHEMAS)
64-
65- add_dependencies (compiz_gsettings_compile_local
66- ${_target_name_for_schema})
67+ if (NOT GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE AND
68+ NOT GSETTINGS_LOCAL_COMPILE_TARGET_SET)
69+
70+ find_program (GLIB_COMPILE_SCHEMAS glib-compile-schemas)
71+ mark_as_advanced (GLIB_COMPILE_SCHEMAS)
72+
73+ if (GLIB_COMPILE_SCHEMAS)
74+
75+ set (_compiled_gschemas ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/gschemas.compiled)
76+
77+ # Invalidate the rule
78+ if (EXISTS ${_compiled_gschemas})
79+ execute_process (COMMAND rm ${_compiled_gschemas})
80+ endif (EXISTS ${_compiled_gschemas})
81+
82+ add_custom_command (OUTPUT ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/gschemas.compiled
83+ COMMAND ${GLIB_COMPILE_SCHEMAS} --targetdir=${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/
84+ ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/
85+ COMMENT "Recompiling GSettings schemas locally"
86+ DEPENDS ${${_schemas}}
87+ )
88+
89+ add_custom_target (compiz_gsettings_compile_local ALL
90+ DEPENDS ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/gschemas.compiled)
91+
92+ set_property (GLOBAL
93+ PROPERTY GSETTINGS_LOCAL_COMPILE_TARGET_SET
94+ TRUE)
95+
96+ endif (GLIB_COMPILE_SCHEMAS)
97+
98+ endif (NOT GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE AND
99+ NOT GSETTINGS_LOCAL_COMPILE_TARGET_SET)
100+
101+endfunction ()
102+
103+function (add_all_gsettings_schemas_to_local_recompilation_rule)
104+
105+ get_property (GSETTINGS_LOCAL_COMPILE_SCHEMAS
106+ GLOBAL
107+ PROPERTY GSETTINGS_LOCAL_COMPILE_SCHEMAS)
108+
109+ # Deferencing it appears to just give it the first schema, that's not what
110+ # we really want, so just pass the reference and double-dereference
111+ # internally
112+ add_gsettings_local_recompilation_rule (GSETTINGS_LOCAL_COMPILE_SCHEMAS)
113+
114+endfunction ()
115+
116+function (add_gsettings_schema_to_recompilation_list _schema_file_name)
117+
118+ set_property (GLOBAL
119+ APPEND
120+ PROPERTY GSETTINGS_LOCAL_COMPILE_SCHEMAS
121+ "${_schema_file_name}")
122+
123+ add_all_gsettings_schemas_to_local_recompilation_rule ()
124
125 endfunction ()
126
127
128=== modified file 'postinst/CMakeLists.txt'
129--- postinst/CMakeLists.txt 2012-07-09 04:06:21 +0000
130+++ postinst/CMakeLists.txt 2012-09-10 08:01:41 +0000
131@@ -1,10 +1,14 @@
132-# Don't allow subdirectories to add schema recompile rule
133+# Allow setting the recompile rule again
134 set_property (GLOBAL
135 PROPERTY COMPIZ_INHIBIT_ADD_INSTALL_RECOMPILE_RULE
136 FALSE)
137+set_property (GLOBAL
138+ PROPERTY GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE
139+ FALSE)
140
141 if (USE_GSETTINGS)
142
143 compiz_add_install_recompile_gsettings_schemas (${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas)
144+ add_all_gsettings_schemas_to_local_recompilation_rule ()
145
146 endif (USE_GSETTINGS)

Subscribers

People subscribed via source and target branches