From 6b46299e8dd78cd0202c0c75f6a27d885ca931df Mon Sep 17 00:00:00 2001 From: luc14n0 Date: Sat, 17 Mar 2018 00:14:25 -0300 Subject: [PATCH] Add COMPILE_SCHEMA to allow disabling gschema compilation --- CMakeLists.txt | 3 +++ gnucash/gschemas/CMakeLists.txt | 30 ++++++++++++++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 370a6d15f34..4bd2e9f3db6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,9 @@ OPTION (ALLOW_OLD_GETTEXT "allow to configure build with a gettext version older # These are also settable from the command line in a similar way. +# Use gsettings-desktop-schema for a better integration with GNOME +SET(COMPILE_SCHEMA ON CACHE BOOL "Compile the GSettings schema") + SET(GNUCASH_BUILD_ID "" CACHE STRING "Overrides the GnuCash build identification (Build ID) which defaults to a description of the vcs commit from which gnucash is built. Distributions may want to insert a package management based version number instead") # GENERATE_SWIG_WRAPPERS - Controls whether to generate the swig wrappers for guile and python. If not set the wrappers will only be generated when building from a git worktree, commented out here, but will be evaluated later on in this file diff --git a/gnucash/gschemas/CMakeLists.txt b/gnucash/gschemas/CMakeLists.txt index 9f68bb744ef..b7668f139ab 100644 --- a/gnucash/gschemas/CMakeLists.txt +++ b/gnucash/gschemas/CMakeLists.txt @@ -22,23 +22,25 @@ SET(gschema_SOURCES add_gschema_targets("${gschema_SOURCES}") # Handle gschemas.compiled -set(CMAKE_COMMAND_TMP "") -if (${CMAKE_VERSION} VERSION_GREATER 3.1) - set(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env) -endif() - -add_custom_command( - OUTPUT ${SCHEMADIR_BUILD}/gschemas.compiled - COMMAND ${CMAKE_COMMAND_TMP} ${GLIB_COMPILE_SCHEMAS} ${SCHEMADIR_BUILD} - DEPENDS ${gschema_depends} -) +if (COMPILE_SCHEMA) + set(CMAKE_COMMAND_TMP "") + if (${CMAKE_VERSION} VERSION_GREATER 3.1) + set(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env) + endif() + + add_custom_command( + OUTPUT ${SCHEMADIR_BUILD}/gschemas.compiled + COMMAND ${CMAKE_COMMAND_TMP} ${GLIB_COMPILE_SCHEMAS} ${SCHEMADIR_BUILD} + DEPENDS ${gschema_depends} + ) -add_custom_target(compiled-schemas ALL DEPENDS ${SCHEMADIR_BUILD}/gschemas.compiled) + add_custom_target(compiled-schemas ALL DEPENDS ${SCHEMADIR_BUILD}/gschemas.compiled) -install(CODE "execute_process( - COMMAND ${SHELL} -c \"echo Compiling gschema files in $DESTDIR${CMAKE_INSTALL_FULL_DATADIR}/glib-2.0/schemas ; - ${GLIB_COMPILE_SCHEMAS} $DESTDIR${CMAKE_INSTALL_FULL_DATADIR}/glib-2.0/schemas\")") + install(CODE "execute_process( + COMMAND ${SHELL} -c \"echo Compiling gschema files in $DESTDIR${CMAKE_INSTALL_FULL_DATADIR}/glib-2.0/schemas ; + ${GLIB_COMPILE_SCHEMAS} $DESTDIR${CMAKE_INSTALL_FULL_DATADIR}/glib-2.0/schemas\")") +endif () SET(gschemas_DIST_local "") FOREACH(file ${gschema_SOURCES})