summaryrefslogtreecommitdiff
path: root/cmake/modules
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/FindGLib.cmake17
-rw-r--r--cmake/modules/FindGObjectIntrospection.cmake29
-rw-r--r--cmake/modules/FindLibXML.cmake19
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()