aboutsummaryrefslogtreecommitdiff
path: root/main/CMakeLists.txt
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-04-15 22:02:05 +0200
committerMarvin W <git@larma.de>2017-04-15 22:02:05 +0200
commit653c361420d658097a4affeb8bf256f02cc9bb2a (patch)
treedc18bc8afebe4ee46ca97be4f68e9c97a3640ec0 /main/CMakeLists.txt
parenta0b2a66ef0e71918b27207889519f3dc270ebb43 (diff)
downloaddino-653c361420d658097a4affeb8bf256f02cc9bb2a.tar.gz
dino-653c361420d658097a4affeb8bf256f02cc9bb2a.zip
Make gdk-x11 optional
Diffstat (limited to 'main/CMakeLists.txt')
-rw-r--r--main/CMakeLists.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt
index 010ff221..8baa393b 100644
--- a/main/CMakeLists.txt
+++ b/main/CMakeLists.txt
@@ -57,6 +57,14 @@ compile_gresources(
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/data
)
+unset(MAIN_EXTRA_OPTIONS)
+unset(MAIN_EXTRA_PACKAGES)
+find_package(GDK3)
+if(GDK3_WITH_X11)
+ set(MAIN_EXTRA_OPTIONS ${MAIN_EXTRA_OPTIONS} -D GDK3_WITH_X11)
+ set(MAIN_EXTRA_PACKAGES ${MAIN_EXTRA_PACKAGES} gdk-x11-3.0)
+endif(GDK3_WITH_X11)
+
vala_precompile(MAIN_VALA_C
SOURCES
src/main.vala
@@ -107,9 +115,11 @@ CUSTOM_VAPIS
${CMAKE_BINARY_DIR}/exports/dino_internal.vapi
PACKAGES
${MAIN_PACKAGES}
- gdk-x11-3.0
+ ${MAIN_EXTRA_PACKAGES}
GRESOURCES
${MAIN_GRESOURCES_XML}
+OPTIONS
+ ${MAIN_EXTRA_OPTIONS}
)
add_definitions(${VALA_CFLAGS} -DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DLOCALE_INSTALL_DIR=\"${LOCALE_INSTALL_DIR}\")