GSettings doesn't respect --prefix: Closes #6001
This commit is contained in:
parent
9790bae446
commit
d863dbb36b
2 changed files with 16 additions and 12 deletions
|
|
@ -17,7 +17,7 @@ if (GSETTINGS_COMPILE_IN_PLACE)
|
|||
message(STATUS "GSettings schemas will be compiled in-place.")
|
||||
endif ()
|
||||
|
||||
macro(add_schemas GSETTINGS_TARGET SCHEMA_DIRECTORY)
|
||||
macro(add_schemas GSETTINGS_TARGET SCHEMA_DIRECTORY PREFIX)
|
||||
set(PKG_CONFIG_EXECUTABLE pkg-config)
|
||||
|
||||
# Locate all schema files.
|
||||
|
|
@ -25,16 +25,20 @@ macro(add_schemas GSETTINGS_TARGET SCHEMA_DIRECTORY)
|
|||
"${SCHEMA_DIRECTORY}/*.gschema.xml"
|
||||
)
|
||||
|
||||
# Find the GLib path for schema installation
|
||||
execute_process(
|
||||
COMMAND
|
||||
${PKG_CONFIG_EXECUTABLE}
|
||||
glib-2.0
|
||||
--variable prefix
|
||||
OUTPUT_VARIABLE
|
||||
_glib_prefix
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if ("${PREFIX}" STREQUAL "")
|
||||
# Find the GLib path for schema installation
|
||||
execute_process(
|
||||
COMMAND
|
||||
${PKG_CONFIG_EXECUTABLE}
|
||||
glib-2.0
|
||||
--variable prefix
|
||||
OUTPUT_VARIABLE
|
||||
_glib_prefix
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
else ()
|
||||
set(_glib_prefix ${PREFIX})
|
||||
endif ()
|
||||
|
||||
set(GSETTINGS_DIR "${_glib_prefix}/share/glib-2.0/schemas/" CACHE INTERNAL "")
|
||||
|
||||
|
|
|
|||
|
|
@ -469,7 +469,7 @@ add_custom_command(
|
|||
# This needs to be here and not in desktop/CMakeLists.txt in order for Geary to run in the build
|
||||
# directory
|
||||
include(GSettings)
|
||||
add_schemas(geary ${GSETTINGS_DIR})
|
||||
add_schemas(geary ${GSETTINGS_DIR} ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
IF (XGETTEXT_FOUND)
|
||||
MESSAGE("Creating POT file")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue