From f9a39b44803e6347c72c1edd8ba46f633e99dd57 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Sun, 8 Nov 2020 13:50:13 +0100 Subject: Rewrite to indicator-ng, simplify, drop all GTK references, move to CMake fixes #9, fixes #12 --- cmake/UseGSettings.cmake | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 cmake/UseGSettings.cmake (limited to 'cmake/UseGSettings.cmake') diff --git a/cmake/UseGSettings.cmake b/cmake/UseGSettings.cmake new file mode 100644 index 0000000..3b61523 --- /dev/null +++ b/cmake/UseGSettings.cmake @@ -0,0 +1,23 @@ +# GSettings.cmake, CMake macros written for Marlin, feel free to re-use them. + +macro(add_schema SCHEMA_NAME) + + set(PKG_CONFIG_EXECUTABLE pkg-config) + set(GSETTINGS_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/glib-2.0/schemas") + + # Run the validator and error if it fails + execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE _glib_compile_schemas OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND ${_glib_compile_schemas} --dry-run --schema-file=${SCHEMA_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE) + + if (_schemas_invalid) + message (SEND_ERROR "Schema validation error: ${_schemas_invalid}") + endif (_schemas_invalid) + + # Actually install and recomple schemas + message (STATUS "${GSETTINGS_DIR} is the GSettings install dir") + install (FILES ${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR} OPTIONAL) + + install (CODE "message (STATUS \"Compiling GSettings schemas\")") + install (CODE "execute_process (COMMAND ${_glib_compile_schemas} ${GSETTINGS_DIR})") +endmacro() + -- cgit v1.2.3