代码拉取完成,页面将自动刷新
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)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。