Ai
8 Star 0 Fork 31

src-openEuler/libdnf
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-build-Increase-CMake-minimal-version-to-3.5.0.patch 2.91 KB
一键复制 编辑 原始数据 按行查看 历史
Funda Wang 提交于 2025-07-02 21:05 +08:00 . fix build with cmake 4.0
From 099600ca94f3b205461cc010dd257d9d1abd068d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Fri, 28 Feb 2025 15:33:33 +0100
Subject: [PATCH] build: Increase CMake minimal version to 3.5.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
CMake 4.0.0 removed a support for CMake < 3.5, causing a configure
error:
CMake Error at CMakeLists.txt:7 (cmake_minimum_required):
Compatibility with CMake < 3.5 has been removed from CMake.
Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
to tell CMake that the project requires at least <min> but has been updated
to work with policies introduced by <max> or earlier.
Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
This patch moves CMakeList.txt to the earliest supported version,
3.5.0. It also ports the script to CMP0005 policy which cannot be
disabled anymore. It also moves GNUInstallDirs inclusion after
project() as it requires it for probing a library path.
New CMake deprecation warnigs will be resolved later.
Resolves #1699
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
CMakeLists.txt | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6bd46a6..76670959 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,17 +1,16 @@
-# print initial information about the project
-message("Running CMake on libdnf...")
-project(libdnf C CXX)
-
-
# cmake requirements and policies
-cmake_minimum_required(VERSION 2.8.5)
-cmake_policy(SET CMP0005 OLD)
+cmake_minimum_required(VERSION 3.5.0)
# Avoid a warning because "hth" links to
# the in-tree libhawkey, but uses pkg-config to find
# GLib. There may be a better way to do this...
cmake_policy(SET CMP0003 NEW)
-include(GNUInstallDirs)
+# print initial information about the project
+message("Running CMake on libdnf...")
+project(libdnf C CXX)
+
+# GNUInstallDirs requires a language set with project()
+include(GNUInstallDirs)
# use project specific cmake modules
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
@@ -122,20 +121,20 @@
set(CMAKE_MACOSX_RPATH 0)
# package/project version
-add_definitions(-DPACKAGE_VERSION=\\"${LIBDNF_VERSION}\\")
+add_definitions(-DPACKAGE_VERSION="${LIBDNF_VERSION}")
# The libdnf API is under development now. This enables it for internal usage.
add_definitions(-DLIBDNF_UNSTABLE_API)
# gettext
-add_definitions(-DGETTEXT_DOMAIN=\\"libdnf\\")
-add_definitions(-DG_LOG_DOMAIN=\\"libdnf\\")
+add_definitions(-DGETTEXT_DOMAIN="libdnf")
+add_definitions(-DG_LOG_DOMAIN="libdnf")
# gpgme: LargeFile Support is required on 32bit architectures
add_definitions(-D_FILE_OFFSET_BITS=64)
# tests
-add_definitions(-DTESTDATADIR=\\"${CMAKE_SOURCE_DIR}/data/tests\\")
+add_definitions(-DTESTDATADIR="${CMAKE_SOURCE_DIR}/data/tests")
# librhsm
if(ENABLE_RHSM_SUPPORT)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/libdnf.git
git@gitee.com:src-openeuler/libdnf.git
src-openeuler
libdnf
libdnf
master

搜索帮助