zeromq: Backport patches to support builds with CMake 4+

There hasn't been a new upstream release yet that ships the required changes.

Signed-off-by: Moritz Haase <Moritz.Haase@bmw.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Moritz Haase 2025-07-11 12:00:18 +02:00 committed by Khem Raj
parent 08c7985bba
commit 1911d0d2fc
No known key found for this signature in database
GPG Key ID: BB053355919D3314
3 changed files with 99 additions and 0 deletions

View File

@ -0,0 +1,41 @@
From 34f7fa22022bed9e0e390ed3580a1c83ac4a2834 Mon Sep 17 00:00:00 2001
From: rp42 <rp42@users.noreply.github.com>
Date: Mon, 30 Dec 2024 11:01:39 +0000
Subject: [PATCH] cmake_minimum_required() before project()
* Without this CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded (MT) Windows builds still produced incompatible MultiThreadedDLL (MD) output.
* Resolves following warning:
CMake Warning (dev) at CMakeLists.txt:2 (project):
cmake_minimum_required() should be called prior to this top-level project()
call.
* Use ${CMAKE_HOST_SYSTEM_NAME} as ${CMAKE_SYSTEM_NAME} not set before project().
Signed-off-by: Moritz Haase <Moritz.Haase@bmw.de>
Upstream-Status: Backport [34f7fa22022bed9e0e390ed3580a1c83ac4a2834]
---
CMakeLists.txt | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 861164ad..e4ce8a3d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,12 +1,13 @@
# CMake build script for ZeroMQ
-project(ZeroMQ)
-if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
+if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL Darwin)
cmake_minimum_required(VERSION 3.0.2)
else()
cmake_minimum_required(VERSION 2.8.12)
endif()
+project(ZeroMQ)
+
include(CheckIncludeFiles)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)

View File

@ -0,0 +1,56 @@
From b91a6201307b72beb522300366aad763d19b1456 Mon Sep 17 00:00:00 2001
From: Min RK <benjaminrk@gmail.com>
Date: Thu, 20 Mar 2025 14:51:18 +0100
Subject: [PATCH] set upper bound in cmake_minimum_required
setting an upper bound improves forward-compatibility as legacy version support is dropped
- 3.5 compat is deprecated in 3.27 (2023), removed in 4.0 (2025)
- 3.10 compat is deprecated in 3.31 (2024)
Signed-off-by: Moritz Haase <Moritz.Haase@bmw.de>
Upstream-Status: Backport [b91a6201307b72beb522300366aad763d19b1456]
---
CMakeLists.txt | 4 ++--
tests/CMakeLists.txt | 2 +-
unittests/CMakeLists.txt | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e4ce8a3d..3ab2259e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,9 +1,9 @@
# CMake build script for ZeroMQ
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL Darwin)
- cmake_minimum_required(VERSION 3.0.2)
+ cmake_minimum_required(VERSION 3.0.2...3.31)
else()
- cmake_minimum_required(VERSION 2.8.12)
+ cmake_minimum_required(VERSION 2.8.12...3.31)
endif()
project(ZeroMQ)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index a8dfa8f2..eb59de29 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,5 +1,5 @@
# CMake build script for ZeroMQ tests
-cmake_minimum_required(VERSION "2.8.1")
+cmake_minimum_required(VERSION 2.8.1...3.31)
# On Windows: solution file will be called tests.sln
project(tests)
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt
index 64198eeb..58ea875b 100644
--- a/unittests/CMakeLists.txt
+++ b/unittests/CMakeLists.txt
@@ -1,5 +1,5 @@
# CMake build script for ZeroMQ unit tests
-cmake_minimum_required(VERSION "2.8.1")
+cmake_minimum_required(VERSION 2.8.1...3.31)
set(unittests
unittest_ypipe

View File

@ -8,6 +8,8 @@ PACKAGECONFIG[libsodium] = "-DWITH_LIBSODIUM=ON,-DWITH_LIBSODIUM=OFF, libsodium"
SRC_URI = "http://github.com/zeromq/libzmq/releases/download/v${PV}/zeromq-${PV}.tar.gz \
file://0001-CMakeLists-txt-Avoid-host-specific-path-to-libsodium.patch \
file://0002-cmake_minimum_required-before-project.patch \
file://0003-set-upper-bound-in-cmake_minimum_required.patch \
file://run-ptest \
"
SRC_URI[sha256sum] = "6653ef5910f17954861fe72332e68b03ca6e4d9c7160eb3a8de5a5a913bfab43"