summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2021-01-12 10:54:03 -0500
committerAllen Winter <allen.winter@kdab.com>2021-01-12 10:54:03 -0500
commite327804ef5acfdd4f9d29b885e1c2e85a3a6cb42 (patch)
treea4cec1f6b4a22ab6ea75727c1f4bb30d29156252 /CMakeLists.txt
parentb988c6377663c5439bcc9c87ee92bb20d60bc203 (diff)
parent1dd6065e857093d55ce818755be6cf21f0a43a64 (diff)
downloadlibical-git-e327804ef5acfdd4f9d29b885e1c2e85a3a6cb42.tar.gz
Merge branch '3.0'
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt56
1 files changed, 35 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e035bc0..5415d876 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,7 +39,7 @@
#
# -DGOBJECT_INTROSPECTION=[true|false]
# Set to build GObject introspection "typelib" files
-# Requires GObject Introspection development package v0.6.7 or higher
+# Requires GObject Introspection development package (version MIN_GOBJECT_INTROSPECTION)
# Default=false (do not generate the introspection files)
#
# -DICAL_BUILD_DOCS=[true|false]
@@ -53,7 +53,8 @@
#
# -DICAL_GLIB=[true|false]
# Set to build libical-glib (GObject) interface
-# Requires glib development package v2.20 or higher
+# Requires glib 2.0 development package (version MIN_GLIB).
+# Requires libxml2.0 development package (version MIN_LIBXML).
# Default=true (build the libical-glib interface)
#
# -DENABLE_GTK_DOC=[true|false]
@@ -136,7 +137,7 @@ if(WITH_CXX_BINDINGS)
else()
message(STATUS
"Warning: Building the C++ bindings is not possible since a C++ compiler could not be found. "
- "Turning-off C++ bindings"
+ "Turning-off C++ bindings."
)
set(WITH_CXX_BINDINGS False)
endif()
@@ -310,7 +311,7 @@ if(WIN32 OR WINCE)
#Always use builtin tzdata on Windows systems.
if(NOT USE_BUILTIN_TZDATA)
message(STATUS
- "Currently unable to use system tzdata on Windows. Falling back to builtin tzdata"
+ "Currently unable to use system tzdata on Windows. Falling back to builtin tzdata."
)
set(USE_BUILTIN_TZDATA 1)
endif()
@@ -326,14 +327,26 @@ set(INSTALL_TARGETS_DEFAULT_ARGS
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
)
+#Look for PkgConfig
+#if not found then cannot proceed for GLib+LibXML or GObjectIntrospection.
+#(unless/until they can be handled without pkg-config some day)
+find_package(PkgConfig QUIET)
+
set(MIN_GOBJECT_INTROSPECTION "0.6.7")
libical_option(GOBJECT_INTROSPECTION "Build GObject introspection \"typelib\" files. Requires GObject Introspection development package ${MIN_GOBJECT_INTROSPECTION} or higher." False)
if(GOBJECT_INTROSPECTION)
+ if(NOT PKG_CONFIG_FOUND)
+ message(FATAL_ERROR
+ "You are attempting to build with GObject Introspection enabled, however that option is "
+ "not supported unless pkg-config can be found. Please install pkg-config and try again. "
+ "You can disable GObject Introspection by passing -DGOBJECT_INTROSPECTION=False to cmake.")
+ endif()
+
find_package(GObjectIntrospection ${MIN_GOBJECT_INTROSPECTION})
set_package_properties(GObjectIntrospection PROPERTIES
TYPE OPTIONAL
URL "https://wiki.gnome.org/Projects/GObjectIntrospection"
- PURPOSE "Required in order to build the GObject introspection \"typelib\" files."
+ PURPOSE "Needed in order to build the GObject introspection \"typelib\" files."
)
if(GObjectIntrospection_FOUND)
set(HAVE_INTROSPECTION TRUE)
@@ -358,24 +371,21 @@ if(ICAL_GLIB_VAPI)
if(NOT GOBJECT_INTROSPECTION)
message(FATAL_ERROR
"You requested to build the Vala vapi but have not enabled the GObject Introspection. "
- "Please try again also passing -DGOBJECT_INTROSPECTION=True to cmake"
- )
+ "Please try again also passing -DGOBJECT_INTROSPECTION=True to cmake.")
endif()
find_program(VALAC valac DOC "the Vala compiler")
if(NOT VALAC)
message(FATAL_ERROR
"valac, the Vala compiler was not found. "
- "Install it or disable Vala bindings with -DICAL_GLIB_VAPI=False"
- )
+ "Install it or disable Vala bindings with -DICAL_GLIB_VAPI=False.")
endif()
find_program(VAPIGEN vapigen DOC "tool to generate the Vala API")
if(NOT VAPIGEN)
message(FATAL_ERROR
"vapigen, the tool for generating the Vala API was not found. "
- "Install it or disable Vala bindings with -DICAL_GLIB_VAPI=False"
- )
+ "Install it or disable Vala bindings with -DICAL_GLIB_VAPI=False.")
endif()
endif()
@@ -383,6 +393,13 @@ set(MIN_GLIB "2.44")
set(MIN_LIBXML "2.7.3")
libical_option(ICAL_GLIB "Build libical-glib interface. Requires glib ${MIN_GLIB} and libxml ${MIN_LIBXML} development packages or higher." True)
if(ICAL_GLIB)
+ if(NOT PKG_CONFIG_FOUND)
+ message(FATAL_ERROR
+ "You requested to build libical-glib, however that option is not supported "
+ "unless pkg-config can be found. Please install pkg-config and try again. "
+ "Alternatively, disable the libical-glib build (by passing -DICAL_GLIB=False to cmake).")
+ endif()
+
find_package(GLib ${MIN_GLIB})
set_package_properties(GLib PROPERTIES
TYPE OPTIONAL
@@ -401,21 +418,18 @@ if(ICAL_GLIB)
message(FATAL_ERROR
"You requested to build libical-glib, but the necessary development package "
"is missing or too low a version (libxml ${MIN_LIBXML} or higher is required). "
- "Alternatively, disable the libical-glib build (by passing -DICAL_GLIB=False to cmake)"
- )
+ "Alternatively, disable the libical-glib build (by passing -DICAL_GLIB=False to cmake).")
elseif(LIBXML_FOUND)
message(FATAL_ERROR
"You requested to build libical-glib, but the necessary development package "
"is missing or too low a version (glib ${MIN_GLIB} or higher is required. "
- "Alternatively, disable the libical-glib build (by passing -DICAL_GLIB=False to cmake)"
- )
+ "Alternatively, disable the libical-glib build (by passing -DICAL_GLIB=False to cmake).")
else()
message(FATAL_ERROR
"You requested to build libical-glib, but the necessary development packages "
"are missing or too low a version "
"(glib ${MIN_GLIB} and libxml ${MIN_LIBXML} or higher are required). "
- "Alternatively, disable the libical-glib build (by passing -DICAL_GLIB=False to cmake)"
- )
+ "Alternatively, disable the libical-glib build (by passing -DICAL_GLIB=False to cmake).")
endif()
endif()
@@ -484,14 +498,14 @@ if(ADDRESS_SANITIZER)
if(GOBJECT_INTROSPECTION)
message(STATUS
"Warning: Building the address sanitizer with GObject Introspection is is not supported. "
- "Turning-off GObject Introspection"
+ "Turning-off GObject Introspection."
)
set(HAVE_INTROSPECTION False)
endif()
if(ICAL_GLIB)
message(STATUS
"Warning: Building the address sanitizer with the GObject interface is not supported. "
- "Turning-off the GObject interface"
+ "Turning-off the GObject interface."
)
set(ICAL_GLIB False)
endif()
@@ -510,14 +524,14 @@ if(THREAD_SANITIZER)
if(GOBJECT_INTROSPECTION)
message(STATUS
"Warning: Building the thread sanitizer with GObject Introspection is is not supported. "
- "Turning-off GObject Introspection"
+ "Turning-off GObject Introspection."
)
set(HAVE_INTROSPECTION False)
endif()
if(ICAL_GLIB)
message(STATUS
"Warning: Building the thread sanitizer with the GObject interface is not supported. "
- "Turning-off the GObject interface"
+ "Turning-off the GObject interface."
)
set(ICAL_GLIB False)
endif()