Skip to content

Commit

Permalink
Add COMPILE_GSCHEMAS to allow disabling gschemas compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
luc14n0 authored and jralls committed Mar 18, 2018
1 parent 7378c13 commit a893a63
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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-schemas for a better integration with GNOME
SET(COMPILE_GSCHEMAS 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

Expand Down
30 changes: 16 additions & 14 deletions gnucash/gschemas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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_GSCHEMAS)
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})
Expand Down
1 change: 1 addition & 0 deletions libgnucash/app-utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# NB: Unit tests which require GSchemas should be made conditional on COMPILE_GSCHEMAS.
ADD_SUBDIRECTORY(test)
# Build the library

Expand Down

0 comments on commit a893a63

Please sign in to comment.