diff options
author | Allen Winter <allen.winter@kdab.com> | 2021-01-11 12:57:01 -0500 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2021-01-11 12:57:01 -0500 |
commit | 866d98dc06f85fd216a38d50dcf5852a29473090 (patch) | |
tree | a9dc3f6b285ab92e05d2b4c7f0f6ff10013fdf6f /cmake | |
parent | 5f8fdc96aaa54e466d16934a6e1ead764f366c84 (diff) | |
download | libical-git-866d98dc06f85fd216a38d50dcf5852a29473090.tar.gz |
buildsystem - fix version discovery for Glib, LibXML, GObject
perhaps this changed with CMake3, but PACKAGE_FIND_VERSION
is no longer available; Use <PACKAGE>_FIND_VERSION now.
also, pkg-config is required if libical-glib or gobject-intro
is requested.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindGLib.cmake | 17 | ||||
-rw-r--r-- | cmake/modules/FindGObjectIntrospection.cmake | 29 | ||||
-rw-r--r-- | cmake/modules/FindLibXML.cmake | 19 |
3 files changed, 34 insertions, 31 deletions
diff --git a/cmake/modules/FindGLib.cmake b/cmake/modules/FindGLib.cmake index f2397eb4..9d075967 100644 --- a/cmake/modules/FindGLib.cmake +++ b/cmake/modules/FindGLib.cmake @@ -13,14 +13,15 @@ set_package_properties(GLib PROPERTIES find_package(PkgConfig) if(PKG_CONFIG_FOUND) - if(PACKAGE_FIND_VERSION_COUNT GREATER 0) - set(_glib_version_cmp ">=${PACKAGE_FIND_VERSION}") - endif() - pkg_check_modules(_pc_glib glib-2.0${_glib_version_cmp} gobject-2.0${_glib_version_cmp}) - if(_pc_glib_FOUND) - set(GLIB_FOUND TRUE) - set(GLIB_CFLAGS "${_pc_glib_CFLAGS}") - set(GLIB_LIBRARIES "${_pc_glib_LDFLAGS}") + if(DEFINED GLib_FIND_VERSION) + set(_glib_version_cmp ${GLib_FIND_VERSION}) + set(_glib_version_cmp ">=${_glib_version_cmp}") + pkg_check_modules(_pc_glib glib-2.0${_glib_version_cmp} gobject-2.0${_glib_version_cmp}) + if(_pc_glib_FOUND) + set(GLIB_FOUND TRUE) + set(GLIB_CFLAGS "${_pc_glib_CFLAGS}") + set(GLIB_LIBRARIES "${_pc_glib_LDFLAGS}") + endif() endif() endif() diff --git a/cmake/modules/FindGObjectIntrospection.cmake b/cmake/modules/FindGObjectIntrospection.cmake index eb014bb4..262c7025 100644 --- a/cmake/modules/FindGObjectIntrospection.cmake +++ b/cmake/modules/FindGObjectIntrospection.cmake @@ -1,4 +1,4 @@ -# - try to find gobject-introspection +# - try to find gobject-introspection 1.0 # # Once done this will define # @@ -34,19 +34,20 @@ endmacro(_GIR_GET_PKGCONFIG_VAR) find_package(PkgConfig) if(PKG_CONFIG_FOUND) - if(PACKAGE_FIND_VERSION_COUNT GREATER 0) - set(_gir_version_cmp ">=${PACKAGE_FIND_VERSION}") - endif() - pkg_check_modules(_pc_gir gobject-introspection-1.0${_gir_version_cmp}) - if(_pc_gir_FOUND) - set(GObjectIntrospection_FOUND TRUE) - _gir_get_pkgconfig_var(GObjectIntrospection_SCANNER "g_ir_scanner") - _gir_get_pkgconfig_var(GObjectIntrospection_COMPILER "g_ir_compiler") - _gir_get_pkgconfig_var(GObjectIntrospection_GENERATE "g_ir_generate") - _gir_get_pkgconfig_var(GObjectIntrospection_GIRDIR "girdir") - _gir_get_pkgconfig_var(GObjectIntrospection_TYPELIBDIR "typelibdir") - set(GObjectIntrospection_CFLAGS "${_pc_gir_CFLAGS}") - set(GObjectIntrospection_LIBS "${_pc_gir_LIBS}") + if(DEFINED GObjectIntrospection_FIND_VERSION) + set(_gir_version_cmp "${GObjectIntrospection_FIND_VERSION}") + set(_gir_version_cmp ">=${_gir_version_cmp}") + pkg_check_modules(_pc_gir gobject-introspection-1.0${_gir_version_cmp}) + if(_pc_gir_FOUND) + set(GObjectIntrospection_FOUND TRUE) + _gir_get_pkgconfig_var(GObjectIntrospection_SCANNER "g_ir_scanner") + _gir_get_pkgconfig_var(GObjectIntrospection_COMPILER "g_ir_compiler") + _gir_get_pkgconfig_var(GObjectIntrospection_GENERATE "g_ir_generate") + _gir_get_pkgconfig_var(GObjectIntrospection_GIRDIR "girdir") + _gir_get_pkgconfig_var(GObjectIntrospection_TYPELIBDIR "typelibdir") + set(GObjectIntrospection_CFLAGS "${_pc_gir_CFLAGS}") + set(GObjectIntrospection_LIBS "${_pc_gir_LIBS}") + endif() endif() endif() diff --git a/cmake/modules/FindLibXML.cmake b/cmake/modules/FindLibXML.cmake index 00120ec3..e99bf652 100644 --- a/cmake/modules/FindLibXML.cmake +++ b/cmake/modules/FindLibXML.cmake @@ -2,20 +2,21 @@ # # Once done this will define # -# LIBXML_FOUND - system has libxml +# LIBXML_FOUND - system has libxml 2.0 # LIBXML_CFLAGS # LIBXML_LIBRARIES find_package(PkgConfig) if(PKG_CONFIG_FOUND) - if(PACKAGE_FIND_VERSION_COUNT GREATER 0) - set(_libxml_version_cmp ">=${PACKAGE_FIND_VERSION}") - endif() - pkg_check_modules(_pc_libxml libxml-2.0${_libxml_version_cmp}) - if(_pc_libxml_FOUND) - set(LIBXML_FOUND TRUE) - set(LIBXML_CFLAGS "${_pc_libxml_CFLAGS}") - set(LIBXML_LIBRARIES "${_pc_libxml_LIBRARIES}") + if(DEFINED LibXML_FIND_VERSION) + set(_libxml_version_cmp ${LibXML_FIND_VERSION}) + set(_libxml_version_cmp ">=${_libxml_version_cmp}") + pkg_check_modules(_pc_libxml libxml-2.0${_libxml_version_cmp}) + if(_pc_libxml_FOUND) + set(LIBXML_FOUND TRUE) + set(LIBXML_CFLAGS "${_pc_libxml_CFLAGS}") + set(LIBXML_LIBRARIES "${_pc_libxml_LIBRARIES}") + endif() endif() endif() |