Skip to content

Commit

Permalink
generate .gschema.xml.in to include cmake constants e.g. alarm_defaul…
Browse files Browse the repository at this point in the history
…t_sound
  • Loading branch information
ckerr authored and sunweaver committed Mar 26, 2018
1 parent b72e441 commit eec442b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@
## GSettings schema
##

find_package (GSettings)

add_schema ("org.ayatana.indicator.datetime.gschema.xml")
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")
set (SCHEMA_FILE "${CMAKE_CURRENT_BINARY_DIR}/${SCHEMA_NAME}")
# generate the .xml.in file so cmake constants are included
configure_file(${SCHEMA_FILE_IN_IN} ${SCHEMA_FILE_IN})
# generate the .xml file using intltool
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})

##
## Systemd Unit File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
</description>
</key>
<key name="alarm-default-sound" type="s">
<default>'/usr/share/sounds/ubuntu/ringtones/Alarm clock.ogg'</default>
<default>'${ALARM_DEFAULT_SOUND}'</default>
<summary>The alarm's default sound file.</summary>
<description>
If an alarm doesn't specify its own sound file, this file will be used as the fallback sound.
Expand Down

0 comments on commit eec442b

Please sign in to comment.