From: Vesa-Pekka Palmu Date: Sun, 20 Nov 2022 18:20:09 +0000 (+0200) Subject: CMakeLists.txt: Detect glibmm-2.68 in addition to glibmm-2.4 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=33c5ac28f73aa35c5fc4bbcf69a5ae61c0b50989;p=pulseview.git CMakeLists.txt: Detect glibmm-2.68 in addition to glibmm-2.4 On OS X with homebrew only glibmm-2.68 series is available. As far as I can tell there are no breaking changes for PulseView on the glibmm-2.68 ABI change. This change still prefers glibmm-2.4 if found, and uses 2.4 if both 2.4 and 2.68 are available. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ffea00ef..d5469883 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,15 @@ include(memaccess) find_package(PkgConfig) list(APPEND PKGDEPS glib-2.0>=2.28.0) -list(APPEND PKGDEPS glibmm-2.4>=2.28.0) + +# Try to find the prefered glibmm-2.4. If not found then add glibmm-2.68 +# to the dependency list. +pkg_check_modules(GLIBMM_2_4 glibmm-2.4>2.28.0) +if(GLIBMM_2_4_FOUND) + list(APPEND PKGDEPS glibmm-2.4>=2.28.0) +else() + list(APPEND PKGDEPS glibmm-2.68>=2.68.0) +endif() if(ENABLE_FLOW) list(APPEND PKGDEPS gstreamermm-1.0>=1.8.0) @@ -226,7 +234,11 @@ memaccess_check_unaligned_le(HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS) set(PV_TITLE PulseView) set(PV_VERSION_STRING "0.5.0") -set(PV_GLIBMM_VERSION ${PKGDEPS_glibmm-2.4_VERSION}) +if(GLIBMM_2_4_FOUND) + set(PV_GLIBMM_VERSION ${PKGDEPS_glibmm-2.4_VERSION}) +else() + set(PV_GLIBMM_VERSION ${PKGDEPS_glibmm-2.68_VERSION}) +endif() include(GetGitRevisionDescription)