aboutsummaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-02-04 11:43:08 -0600
committerTed Gould <ted@gould.cx>2015-02-04 11:43:08 -0600
commit363a5d1ae24d58d294d8806930cf788879a6f73a (patch)
tree84009225026a565ae74b4ae1d37ca407a03bf733 /tests/CMakeLists.txt
parent8838bd8e4e95f1da3bcc85324e924e782a434c4e (diff)
downloadayatana-indicator-sound-363a5d1ae24d58d294d8806930cf788879a6f73a.tar.gz
ayatana-indicator-sound-363a5d1ae24d58d294d8806930cf788879a6f73a.tar.bz2
ayatana-indicator-sound-363a5d1ae24d58d294d8806930cf788879a6f73a.zip
Compile GSettings schema and use the memory backend
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r--tests/CMakeLists.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index bc2df0d..d9bfe0b 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -11,6 +11,28 @@ add_library (gtest STATIC
target_link_libraries(gtest ${GTEST_LIBS})
###########################
+# GSettings Schema
+###########################
+
+# build the necessary schemas
+set_directory_properties (PROPERTIES
+ ADDITIONAL_MAKE_CLEAN_FILES gschemas.compiled)
+set_source_files_properties (gschemas.compiled GENERATED)
+
+# GSettings:
+# compile the indicator-sound schema into a gschemas.compiled file in this directory,
+# and help the tests to find that file by setting -DSCHEMA_DIR
+set (SCHEMA_DIR ${CMAKE_CURRENT_BINARY_DIR})
+add_definitions(-DSCHEMA_DIR="${SCHEMA_DIR}")
+execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas
+ OUTPUT_VARIABLE COMPILE_SCHEMA_EXECUTABLE
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+add_custom_command (OUTPUT gschemas.compiled
+ DEPENDS ${CMAKE_BINARY_DIR}/data/com.canonical.indicator.sound.gschema.xml
+ COMMAND cp -f ${CMAKE_BINARY_DIR}/data/*gschema.xml ${SCHEMA_DIR}
+ COMMAND ${COMPILE_SCHEMA_EXECUTABLE} ${SCHEMA_DIR})
+
+###########################
# Vala Mocks
###########################