aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-10-20 00:35:05 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-10-21 21:26:00 +0200
commit4f92dd8d052c80c752ca0df5e9b98f9daa6c2c0d (patch)
tree330d85f6faa1a8c3a3bb3f540244e5b54081983d
parent0a26104dcef1a77fb11e4bc8b0659de54caceb99 (diff)
downloadayatana-indicator-datetime-4f92dd8d052c80c752ca0df5e9b98f9daa6c2c0d.tar.gz
ayatana-indicator-datetime-4f92dd8d052c80c752ca0df5e9b98f9daa6c2c0d.tar.bz2
ayatana-indicator-datetime-4f92dd8d052c80c752ca0df5e9b98f9daa6c2c0d.zip
Use native CMake GSettings module
-rw-r--r--cmake/UseGSettings.cmake23
-rw-r--r--data/CMakeLists.txt7
2 files changed, 4 insertions, 26 deletions
diff --git a/cmake/UseGSettings.cmake b/cmake/UseGSettings.cmake
deleted file mode 100644
index 3b61523..0000000
--- a/cmake/UseGSettings.cmake
+++ /dev/null
@@ -1,23 +0,0 @@
-# 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()
-
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index d7ab10f..c76da5f 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -2,7 +2,6 @@
## GSettings schema
##
-include (UseGSettings)
set (SCHEMA_NAME "org.ayatana.indicator.datetime.gschema.xml")
set (SCHEMA_FILE_IN_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME}.in.in")
set (SCHEMA_FILE_IN "${CMAKE_CURRENT_BINARY_DIR}/${SCHEMA_NAME}.in")
@@ -13,8 +12,10 @@ configure_file(${SCHEMA_FILE_IN_IN} ${SCHEMA_FILE_IN})
set (ENV{LC_ALL} "C")
execute_process (COMMAND intltool-merge -quiet --xml-style --utf8 --no-translations "${SCHEMA_FILE_IN}" "${SCHEMA_FILE}")
-# let UseGSettings do the rest
-add_schema (${SCHEMA_FILE})
+# let GSettings do the rest
+find_package(GSettings REQUIRED)
+set(GSETTINGS_COMPILE ON)
+add_schema (${SCHEMA_NAME})
##
## Systemd Unit File