~ubuntu-branches/ubuntu/trusty/indicator-session/trusty-updates

« back to all changes in this revision

Viewing changes to cmake/UseGSettings.cmake

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Charles Kerr, Lars Uebernickel, Łukasz 'sil2100' Zemczak, Ubuntu daily release
  • Date: 2013-07-16 02:02:05 UTC
  • mfrom: (1.1.64)
  • Revision ID: package-import@ubuntu.com-20130716020205-84ig434y92hxi2g8
Tags: 12.10.5+13.10.20130716-0ubuntu1
[ Charles Kerr ]
* This is the GMenu, login1 version of indicator-session. This
  resubmission removes the prerequisite branch because the entire diff
  is contained in this ng-login1 branch.

[ Lars Uebernickel ]
* This is the GMenu, login1 version of indicator-session. This
  resubmission removes the prerequisite branch because the entire diff
  is contained in this ng-login1 branch.

[ Łukasz 'sil2100' Zemczak ]
* Add the python build-dep, as gdbus-codegen needs it to work
  properly.

[ Ubuntu daily release ]
* Automatic snapshot from revision 400

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# GSettings.cmake, CMake macros written for Marlin, feel free to re-use them.
 
2
 
 
3
macro(add_schema SCHEMA_NAME)
 
4
 
 
5
    set(PKG_CONFIG_EXECUTABLE pkg-config)
 
6
    set(GSETTINGS_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/glib-2.0/schemas")
 
7
 
 
8
    # Run the validator and error if it fails
 
9
    execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas  OUTPUT_VARIABLE _glib_compile_schemas OUTPUT_STRIP_TRAILING_WHITESPACE)
 
10
    execute_process (COMMAND ${_glib_compile_schemas} --dry-run --schema-file=${SCHEMA_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE)
 
11
 
 
12
    if (_schemas_invalid)
 
13
      message (SEND_ERROR "Schema validation error: ${_schemas_invalid}")
 
14
    endif (_schemas_invalid)
 
15
 
 
16
    # Actually install and recomple schemas
 
17
    message (STATUS "${GSETTINGS_DIR} is the GSettings install dir")
 
18
    install (FILES ${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR} OPTIONAL)
 
19
 
 
20
    install (CODE "message (STATUS \"Compiling GSettings schemas\")")
 
21
    install (CODE "execute_process (COMMAND ${_glib_compile_schemas} ${GSETTINGS_DIR})")
 
22
endmacro()
 
23