From aeae4182cb90cbf65b1c27cc877f62d2c7690aaf Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 4 Nov 2019 16:37:06 -0500 Subject: FindPostgreSQL: support version encoding used in pre-10 releases With the 10.x release, PostgreSQL upstream started encoding the version as `MMmmmm` where `M` is major and `m` is minor. Prior to that, `MMmmPP` was used where `P` was the patch number. Detect this difference and decode it based on the used encoding. Fixes: #19912 --- Modules/FindPostgreSQL.cmake | 21 ++++++++++++++++----- Tests/FindPostgreSQL/Test/main.c | 15 ++++++++++++--- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake index 4b5e60e..1631c9c 100644 --- a/Modules/FindPostgreSQL.cmake +++ b/Modules/FindPostgreSQL.cmake @@ -184,11 +184,22 @@ if (PostgreSQL_INCLUDE_DIR) endif() endforeach() if (_PostgreSQL_VERSION_NUM) - math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000") - math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000") - set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}") - unset(_PostgreSQL_major_version) - unset(_PostgreSQL_minor_version) + # 9.x and older encoding + if (_PostgreSQL_VERSION_NUM LESS 100000) + math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000") + math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000 / 100") + math(EXPR _PostgreSQL_patch_version "${_PostgreSQL_VERSION_NUM} % 100") + set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}.${_PostgreSQL_patch_version}") + unset(_PostgreSQL_major_version) + unset(_PostgreSQL_minor_version) + unset(_PostgreSQL_patch_version) + else () + math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000") + math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000") + set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}") + unset(_PostgreSQL_major_version) + unset(_PostgreSQL_minor_version) + endif () else () foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS}) if(EXISTS "${_PG_CONFIG_HEADER}") diff --git a/Tests/FindPostgreSQL/Test/main.c b/Tests/FindPostgreSQL/Test/main.c index 2cfeed0..a63377a 100644 --- a/Tests/FindPostgreSQL/Test/main.c +++ b/Tests/FindPostgreSQL/Test/main.c @@ -5,10 +5,19 @@ int main() { int version = PQlibVersion(); - int major = version / 10000; - int minor = version % 10000; char version_string[100]; - snprintf(version_string, sizeof(version_string), "%d.%d", major, minor); + // 9.x and older encoding. + if (version < 100000) { + int major = version / 10000; + int minor = version % 10000 / 100; + int patch = version % 100; + snprintf(version_string, sizeof(version_string), "%d.%d.%d", major, minor, + patch); + } else { + int major = version / 10000; + int minor = version % 10000; + snprintf(version_string, sizeof(version_string), "%d.%d", major, minor); + } printf("Found PostgreSQL version %s, expected version %s\n", version_string, CMAKE_EXPECTED_POSTGRESQL_VERSION); return strcmp(version_string, CMAKE_EXPECTED_POSTGRESQL_VERSION); -- cgit v0.12 From 0faeb6a4282f476eb5873b7a1e6d60760a06c3bd Mon Sep 17 00:00:00 2001 From: Deniz Bahadir Date: Tue, 5 Nov 2019 17:27:24 +0100 Subject: FindBoost: Prevent warning due to new meta-component "ALL" of Boost 1.73 --- Modules/FindBoost.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 078000f..af4947c 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -449,6 +449,9 @@ if (NOT Boost_NO_BOOST_CMAKE) # Convert component found variables to standard variables if required # Necessary for legacy boost-cmake and 1.70 builtin BoostConfig if(Boost_FIND_COMPONENTS) + # Ignore the meta-component "ALL", introduced by Boost 1.73 + list(REMOVE_ITEM Boost_FIND_COMPONENTS "ALL") + foreach(_comp IN LISTS Boost_FIND_COMPONENTS) if(DEFINED Boost_${_comp}_FOUND) continue() -- cgit v0.12 From e4b1b79abb2b6e1ad07d36d4734554972c9ce4a9 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Tue, 1 Oct 2019 23:06:02 +0200 Subject: FindGTK2: Add harfbuzz to GTK2_INCLUDE_DIRS Fixes: #19531 --- Modules/FindGTK2.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake index e3af676..83091f3 100644 --- a/Modules/FindGTK2.cmake +++ b/Modules/FindGTK2.cmake @@ -259,6 +259,7 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr) gtkmm-2.4 libglade-2.0 libglademm-2.4 + harfbuzz pango-1.0 pangomm-1.4 sigc++-2.0 @@ -711,6 +712,8 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS}) _GTK2_FIND_LIBRARY (PANGO pango false true) _GTK2_ADD_TARGET (PANGO GTK2_DEPENDS gobject glib) + _GTK2_FIND_INCLUDE_DIR(HARFBUZZ hb.h) + _GTK2_FIND_LIBRARY (PANGOCAIRO pangocairo false true) _GTK2_ADD_TARGET (PANGOCAIRO GTK2_DEPENDS pango cairo gobject glib) -- cgit v0.12 From 5b43aa775507c974284bbae2e6bd13e11caec80d Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 Dec 2019 10:21:27 -0500 Subject: CMake 3.15.6 --- Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 3bb8cc3..ba06c4f 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) -set(CMake_VERSION_PATCH 5) +set(CMake_VERSION_PATCH 6) #set(CMake_VERSION_RC 0) -- cgit v0.12