Set cmake_minimum_required to 3.5 for all dependencies to build with cmake 4

This commit is contained in:
lod 2025-03-30 11:53:44 +02:00
parent db4f210098
commit b325a2ce7c
4 changed files with 100 additions and 4 deletions

View file

@ -41,7 +41,11 @@ pkgbase = orca-slicer
options = !emptydirs options = !emptydirs
source = orca-slicer::git+https://github.com/SoftFever/OrcaSlicer.git#tag=v2.3.0 source = orca-slicer::git+https://github.com/SoftFever/OrcaSlicer.git#tag=v2.3.0
source = https://github.com/Open-Cascade-SAS/OCCT/commit/7236e83dcc1e7284e66dc61e612154617ef715d6.patch source = https://github.com/Open-Cascade-SAS/OCCT/commit/7236e83dcc1e7284e66dc61e612154617ef715d6.patch
source = cmake-min-version.patch
source = wxWidgets-cmake-min-version.patch
b2sums = 543653c5769e2f022877608c14bad64ea05dbc30d41a58dc1a82eaca6615c0183f7573ced790a263b8509f6a4abdfa6b259ae0701a2468e10c15eb40d1926555 b2sums = 543653c5769e2f022877608c14bad64ea05dbc30d41a58dc1a82eaca6615c0183f7573ced790a263b8509f6a4abdfa6b259ae0701a2468e10c15eb40d1926555
b2sums = cc7791841533e07787a4921b688fdd885782a67320936d445ad04102a68e8e044b5bf52a58d987d158ae522ae4f02a56a3525ccfd1831ef6a3b6459be14bd408 b2sums = cc7791841533e07787a4921b688fdd885782a67320936d445ad04102a68e8e044b5bf52a58d987d158ae522ae4f02a56a3525ccfd1831ef6a3b6459be14bd408
b2sums = 562dcd07530faef0d9fdddf1e009075f67105c8239e4b1402cd890f7a89be8b11671dd6ecc7b55a155f2d05247070bb0b8ff84f2170ce2454ab818018be80e48
b2sums = 1459ce126dd80a891006d2c40a001e75dc146ac9eb6ad8e975a3e4672ebb914baabecd8a4048742fab03e2820242f614449dd23a8e721bd5c945c8765e986a5a
pkgname = orca-slicer pkgname = orca-slicer

View file

@ -13,9 +13,13 @@ makedepends=('cmake' 'extra-cmake-modules' 'git' 'glew' 'm4' 'ninja' 'pkgconf' '
options=('!debug' '!emptydirs') options=('!debug' '!emptydirs')
provides=("orca-slicer") provides=("orca-slicer")
source=("$pkgname::git+https://github.com/SoftFever/OrcaSlicer.git#tag=v$pkgver" source=("$pkgname::git+https://github.com/SoftFever/OrcaSlicer.git#tag=v$pkgver"
"https://github.com/Open-Cascade-SAS/OCCT/commit/7236e83dcc1e7284e66dc61e612154617ef715d6.patch") "https://github.com/Open-Cascade-SAS/OCCT/commit/7236e83dcc1e7284e66dc61e612154617ef715d6.patch"
"cmake-min-version.patch"
"wxWidgets-cmake-min-version.patch")
b2sums=('543653c5769e2f022877608c14bad64ea05dbc30d41a58dc1a82eaca6615c0183f7573ced790a263b8509f6a4abdfa6b259ae0701a2468e10c15eb40d1926555' b2sums=('543653c5769e2f022877608c14bad64ea05dbc30d41a58dc1a82eaca6615c0183f7573ced790a263b8509f6a4abdfa6b259ae0701a2468e10c15eb40d1926555'
'cc7791841533e07787a4921b688fdd885782a67320936d445ad04102a68e8e044b5bf52a58d987d158ae522ae4f02a56a3525ccfd1831ef6a3b6459be14bd408') 'cc7791841533e07787a4921b688fdd885782a67320936d445ad04102a68e8e044b5bf52a58d987d158ae522ae4f02a56a3525ccfd1831ef6a3b6459be14bd408'
'562dcd07530faef0d9fdddf1e009075f67105c8239e4b1402cd890f7a89be8b11671dd6ecc7b55a155f2d05247070bb0b8ff84f2170ce2454ab818018be80e48'
'1459ce126dd80a891006d2c40a001e75dc146ac9eb6ad8e975a3e4672ebb914baabecd8a4048742fab03e2820242f614449dd23a8e721bd5c945c8765e986a5a')
prepare() { prepare() {
# C++20 disallows the use of the Point<T> syntax in the constructor # C++20 disallows the use of the Point<T> syntax in the constructor
@ -27,6 +31,10 @@ prepare() {
# Fix xgettext: case-sensitive mismatches # Fix xgettext: case-sensitive mismatches
sed -i 's|src/slic3r/GUI/AMSMappingPopup.cpp|src/slic3r/GUI/AmsMappingPopup.cpp|g' $pkgname/localization/i18n/list.txt sed -i 's|src/slic3r/GUI/AMSMappingPopup.cpp|src/slic3r/GUI/AmsMappingPopup.cpp|g' $pkgname/localization/i18n/list.txt
sed -i 's|https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.bz2|https://www.mpfr.org/mpfr-4.2.1/mpfr-4.2.1.tar.bz2|' $pkgname/deps/MPFR/MPFR.cmake sed -i 's|https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.bz2|https://www.mpfr.org/mpfr-4.2.1/mpfr-4.2.1.tar.bz2|' $pkgname/deps/MPFR/MPFR.cmake
# Set cmake_minimum_required to 3.5 for all dependencies
cp wxWidgets-cmake-min-version.patch $pkgname/deps/wxWidgets/wxWidgets-cmake-min-version.patch
cd $pkgname
git apply ../cmake-min-version.patch
} }
build() { build() {
@ -37,7 +45,8 @@ build() {
-G Ninja \ -G Ninja \
-S deps \ -S deps \
-B deps/build \ -B deps/build \
-DDEP_WX_GTK3=ON -DDEP_WX_GTK3=ON \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
ninja -C deps/build ninja -C deps/build
cmake \ cmake \
@ -50,7 +59,8 @@ build() {
-DSLIC3R_STATIC=1 \ -DSLIC3R_STATIC=1 \
-DORCA_TOOLS=1 \ -DORCA_TOOLS=1 \
-DSLIC3R_FHS=1 \ -DSLIC3R_FHS=1 \
-DSLIC3R_GTK=3 -DSLIC3R_GTK=3 \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
ninja -C build ninja -C build
# add localizations # add localizations

44
cmake-min-version.patch Normal file
View file

@ -0,0 +1,44 @@
diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt
index b24ee20e2..e59edc7b6 100644
--- a/deps/CMakeLists.txt
+++ b/deps/CMakeLists.txt
@@ -128,6 +128,7 @@ if (NOT IS_CROSS_COMPILE OR NOT APPLE)
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
${_gen}
CMAKE_ARGS
+ -DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}
-DCMAKE_MODULE_PATH:STRING=${PROJECT_SOURCE_DIR}/../cmake/modules
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}
@@ -157,6 +158,7 @@ elseif(FLATPAK)
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
${_gen}
CMAKE_ARGS
+ -DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}
-DCMAKE_MODULE_PATH:STRING=${PROJECT_SOURCE_DIR}/../cmake/modules
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}
@@ -185,6 +187,7 @@ else()
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
${_gen}
CMAKE_ARGS
+ -DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}
-DBUILD_SHARED_LIBS:BOOL=OFF
diff --git a/deps/wxWidgets/wxWidgets.cmake b/deps/wxWidgets/wxWidgets.cmake
index 1097e6cfc..9cf27a790 100644
--- a/deps/wxWidgets/wxWidgets.cmake
+++ b/deps/wxWidgets/wxWidgets.cmake
@@ -25,9 +25,11 @@ endif ()
orcaslicer_add_cmake_project(
wxWidgets
GIT_REPOSITORY "https://github.com/SoftFever/Orca-deps-wxWidgets"
+ PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/wxWidgets-cmake-min-version.patch
GIT_SHALLOW ON
DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} ${TIFF_PKG} ${JPEG_PKG}
CMAKE_ARGS
+ -DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DwxBUILD_PRECOMP=ON
${_wx_toolkit}
"-DCMAKE_DEBUG_POSTFIX:STRING="

View file

@ -0,0 +1,38 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4063020..d498b78 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,7 @@
# Licence: wxWindows licence
#############################################################################
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.5)
if(NOT CMAKE_CONFIGURATION_TYPES)
get_property(HAVE_MULTI_CONFIG_GENERATOR GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
diff --git a/build/cmake/modules/cotire.cmake b/build/cmake/modules/cotire.cmake
index bb69643..e91f7e4 100644
--- a/build/cmake/modules/cotire.cmake
+++ b/build/cmake/modules/cotire.cmake
@@ -37,7 +37,7 @@ set(__COTIRE_INCLUDED TRUE)
if (NOT CMAKE_SCRIPT_MODE_FILE)
cmake_policy(PUSH)
endif()
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.5)
if (NOT CMAKE_SCRIPT_MODE_FILE)
cmake_policy(POP)
endif()
diff --git a/build/cmake/modules/cotire_test/CMakeLists.txt b/build/cmake/modules/cotire_test/CMakeLists.txt
index dd14262..6d865bc 100644
--- a/build/cmake/modules/cotire_test/CMakeLists.txt
+++ b/build/cmake/modules/cotire_test/CMakeLists.txt
@@ -1,6 +1,6 @@
# cotire example project
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.5)
if (POLICY CMP0058)
# Ninja requires custom command byproducts to be explicit