aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2011-06-10 18:18:58 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2011-06-12 10:05:16 +0200
commitb2223d65951c3ad706d76d35e15df8cf2e17535f (patch)
tree50f8b823c9a115483975f41b7cd2a75401430b22 /CMakeLists.txt
parente1e9a6d3198516e9924068b4fab0d4df070a76a5 (diff)
downloadlogdiag-b2223d65951c3ad706d76d35e15df8cf2e17535f.tar.gz
logdiag-b2223d65951c3ad706d76d35e15df8cf2e17535f.tar.xz
logdiag-b2223d65951c3ad706d76d35e15df8cf2e17535f.zip
Integrate GSettings, remember View settings.
The org.logdiag ID has been chosen as I haven't found any specific rules and com.github.logdiag seems not to be future-proof. This domain remains available so far, anyway. The schemas are compiled only when installed directly to CMAKE_INSTALL_PREFIX to the root filesystem. When invoking `make install` with DESTDIR, only the XML files are copied over as the schemas would have to be recompiled later anyway.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt36
1 files changed, 35 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 151e000..2c8a144 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -256,7 +256,40 @@ if (GTK_DOC_FOUND)
HTML ${project_DOC_DIR}/html)
endif (GTK_DOC_FOUND)
+# GSettings
+find_program (GLIB_COMPILE_SCHEMAS_EXECUTABLE glib-compile-schemas)
+if (NOT GLIB_COMPILE_SCHEMAS_EXECUTABLE)
+ message (FATAL_ERROR "glib-compile-schemas not found")
+endif (NOT GLIB_COMPILE_SCHEMAS_EXECUTABLE)
+
+set (GSETTINGS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/share")
+set (GSETTINGS_SCHEMAS "${GSETTINGS_DIR}/org.logdiag.gschema.xml")
+
+add_custom_target (logdiag_gschema_check
+ COMMAND ${GLIB_COMPILE_SCHEMAS_EXECUTABLE} --dry-run "${GSETTINGS_DIR}"
+ DEPENDS "${GSETTINGS_SCHEMAS}"
+ COMMENT "Checking GSettings schema files" VERBATIM)
+
+if (OPTION_NOINSTALL)
+ set (GSETTINGS_COMPILED_SCHEMA "${CMAKE_CURRENT_BINARY_DIR}/gschemas.compiled")
+
+ add_custom_command (OUTPUT "${GSETTINGS_COMPILED_SCHEMA}"
+ COMMAND ${GLIB_COMPILE_SCHEMAS_EXECUTABLE}
+ "--targetdir=${CMAKE_CURRENT_BINARY_DIR}" "${GSETTINGS_DIR}"
+ DEPENDS "${GSETTINGS_SCHEMAS}"
+ COMMENT "Compiling GSettings schema files" VERBATIM)
+ add_custom_target (logdiag_gschema ALL DEPENDS "${GSETTINGS_COMPILED_SCHEMA}")
+endif (OPTION_NOINSTALL)
+
# Installation
+install (FILES ${GSETTINGS_SCHEMAS}
+ DESTINATION share/glib-2.0/schemas)
+install (CODE " # DESTDIR is not in use on Windows
+ if (WIN32 OR \"\$ENV{DESTDIR}\" STREQUAL \"\")
+ execute_process (COMMAND ${GLIB_COMPILE_SCHEMAS_EXECUTABLE}
+ \"\${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas\")
+ endif (WIN32 OR \"\$ENV{DESTDIR}\" STREQUAL \"\")")
+
install (DIRECTORY share/gui share/library
DESTINATION share/${CMAKE_PROJECT_NAME})
@@ -266,7 +299,8 @@ if (WIN32)
${WIN32_DEPENDS_PATH}/bin/
DESTINATION .
FILES_MATCHING PATTERN "*.dll"
- PATTERN "libgettext*" EXCLUDE)
+ PATTERN "libgettext*" EXCLUDE
+ PATTERN "libintl*" EXCLUDE)
install (DIRECTORY
${WIN32_DEPENDS_PATH}/etc/
DESTINATION etc)