aboutsummaryrefslogtreecommitdiff
path: root/data/CMakeLists.txt
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-11-19 12:17:30 +0100
committerRobert Tari <robert@tari.in>2021-11-19 12:17:30 +0100
commit809eb8cffb47629733258feb915f9cf348ab7345 (patch)
treec83c457014f69088aecfeef6cc3b4cb5f455e474 /data/CMakeLists.txt
parent5a2368bf0bf87721540ec0183b6ba4c88fd0be3e (diff)
parentf59500bfe360dce317af6b3c24c9a71206e9011a (diff)
downloadayatana-indicator-display-809eb8cffb47629733258feb915f9cf348ab7345.tar.gz
ayatana-indicator-display-809eb8cffb47629733258feb915f9cf348ab7345.tar.bz2
ayatana-indicator-display-809eb8cffb47629733258feb915f9cf348ab7345.zip
Merge branch 'sunweaver-pr/consolidate-gschema-usage'
Attributes GH PR #40: https://github.com/AyatanaIndicators/ayatana-indicator-display/pull/40
Diffstat (limited to 'data/CMakeLists.txt')
-rw-r--r--data/CMakeLists.txt17
1 files changed, 13 insertions, 4 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index acc462f..6f8cda1 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -1,12 +1,21 @@
find_package(GSettings)
##
-## GSettings
+## GSettings schema
##
-if(NOT EXISTS /usr/share/glib-2.0/schemas/com.lomiri.touch.system.gschema.xml)
- add_schema ("org.ayatana.indicator.display.gschema.xml")
-endif()
+set (SCHEMA_NAME "org.ayatana.display.gschema.xml")
+set (SCHEMA_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SCHEMA_NAME}")
+set (SCHEMA_FILE_IN "${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME}.in")
+
+# generate the .xml file using intltool
+find_package(Intltool REQUIRED)
+set (ENV{LC_ALL} "C")
+intltool_merge_translations("${SCHEMA_FILE_IN}" "${SCHEMA_FILE}" ALL UTF8 STYLE "xml" NO_TRANSLATIONS)
+
+# let GSettings do the rest
+find_package(GSettings REQUIRED)
+add_schema (${SCHEMA_NAME})
##
## Systemd Unit File