summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorCorentin Noël <corentin@elementary.io>2016-12-21 00:23:39 +0100
committerCorentin Noël <corentin@elementary.io>2016-12-21 00:23:39 +0100
commitd62b0908b6ec74f342e9b39d6c9eff9e023b8a43 (patch)
tree9a286774867db2113ea8dd6099e9f43a4640b9f6 /CMakeLists.txt
parentbcab773e22770437a5bd40e08c5b20e017d9ed2c (diff)
downloadlibical-git-d62b0908b6ec74f342e9b39d6c9eff9e023b8a43.tar.gz
Generate Vala vapi file on the go
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b8f25222..caf80a21 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,6 +43,11 @@
# Requires GObject Introspection development package v0.6.7 or higher
# Default=false (do not generate the introspection files)
#
+# -DICAL_GLIB_VAPI=[true|false]
+# Set to build Vala "vapi" files
+# Requires Vala package
+# Default=false (build the libical-glib interface)
+#
# -DICAL_GLIB=[true|false]
# Set to build libical-glib (GObject) interface
# Requires glib development package v2.20 or higher
@@ -248,6 +253,23 @@ if(GOBJECT_INTROSPECTION)
endif()
endif()
+option(ICAL_GLIB_VAPI "Build Vala \"vapi\" files.")
+if(ICAL_GLIB_VAPI)
+ if(NOT GOBJECT_INTROSPECTION)
+ message(FATAL_ERROR "You requested to build the Vapi but have not enabled the GObject Introspection, please retry by passing -DGOBJECT_INTROSPECTION=True to CMake")
+ endif()
+
+ find_program(VALAC valac)
+ if(NOT VALAC)
+ message(FATAL_ERROR "The valac not found. Install it or disable Vala bindings with -DICAL_GLIB_VAPI=False")
+ endif()
+
+ find_program(VAPIGEN vapigen)
+ if(NOT VAPIGEN)
+ message(FATAL_ERROR "The vapigen not found. Install it or disable Vala bindings with -DICAL_GLIB_VAPI=False")
+ endif()
+endif()
+
set(MIN_GLIB "2.32")
set(MIN_LIBXML "2.7.3")
option(ICAL_GLIB "Build libical-glib interface. Requires glib ${MIN_GLIB} and libxml ${MIN_LIBXML} development packages or higher." True)