~unity-2d-team/unity-2d/trunk

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Tarmac
  • Author(s): Tiago Salem Herrmann
  • Date: 2011-12-08 12:28:25 UTC
  • mfrom: (807.1.1 unity-2d)
  • Revision ID: tarmac-20111208122825-gxd52f8mkkl5o8ru
In a particular scenario unity-2d-places may abort due to a SIGABRT raised by QConf().
If for some reason (probably during a distro upgrade) the schema file isn't properly installed and
unity-2d-places is wrapped, then it simply aborts with the following message:

unity-2d-places: [FATAL] Settings schema 'com.canonical.Unity2d' is not installed

This patch adds a simple check if the schema file is present, and if not, assume the default
value. Other components like launcher and panel won't probably have this same issue since
they keep running in memory, and not launched on-the-fly.. Fixes: https://bugs.launchpad.net/bugs/857575. Appoved by .

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
set(UNITY_DIR /usr/share/unity/)
10
10
set(UNITY_2D_DATA_DIR "${CMAKE_SOURCE_DIR}/data")
11
11
 
12
 
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
13
 
 
14
12
# Configure debian files
15
13
string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" 1 -1 DEBIAN_INSTALL_PREFIX)
16
14
file(GLOB DEBIAN_FILES debian/*.in)
53
51
set (UNITY_2D_SCHEMAS "com.canonical.Unity2d.gschema.xml")
54
52
set (UNITY_2D_GCONF_CONVERT "unity-2d.convert")
55
53
set (GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas/")
 
54
set (UNITY_2D_SCHEMA_FILE "${GSETTINGS_DIR}${UNITY_2D_SCHEMAS}")
56
55
set (GCONF_CONVERT_DIR "${CMAKE_INSTALL_PREFIX}/share/GConf/gsettings")
57
56
execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas  OUTPUT_VARIABLE GLIB_COMPILE_SCHEMAS OUTPUT_STRIP_TRAILING_WHITESPACE)
58
57
 
69
68
install (CODE "message (STATUS \"Compiling GSettings schemas\")")
70
69
install (CODE "execute_process (COMMAND ${GLIB_COMPILE_SCHEMAS} ${GSETTINGS_DIR})")
71
70
 
 
71
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
 
72
 
72
73
# Install GConf to GSettings conversion file
73
74
install (FILES ${UNITY_2D_DATA_DIR}/${UNITY_2D_GCONF_CONVERT} DESTINATION ${GCONF_CONVERT_DIR})
74
75