-
Notifications
You must be signed in to change notification settings - Fork 2
/
GSettings.cmake
27 lines (23 loc) · 934 Bytes
/
GSettings.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#set the pkg-config variable
set(PKG_CONFIG_EXECUTABLE pkg-config)
#get the gsettings compiler command name from pkg-config
execute_process (
COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas
OUTPUT_VARIABLE GLIB_COMPLE_SCHEMAS OUTPUT_STRIP_TRAILING_WHITESPACE)
#get the glib prefix directory from pkg-config
execute_process (
COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable prefix
OUTPUT_VARIABLE GLIB_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE
)
#compile schemas in a directory and put the generated compiled file in
#the specified targetdir
function (compile_schemas_at SCHEMA_DIR TARGET_DIR)
execute_process (COMMAND ${GLIB_COMPLE_SCHEMAS} ${SCHEMA_DIR} --targetdir=${TARGET_DIR})
endfunction()
#compile schemas in a directory at install
function (compile_schemas_install SCHEMA_DIR)
install(
CODE
"execute_process (COMMAND ${GLIB_COMPLE_SCHEMAS} ${SCHEMA_DIR})"
)
endfunction()