public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Cristian Le <git@lecris.dev>
To: git-commits@fedoraproject.org
Subject: [rpms/lib3mf] rawhide: Allow to build with CMake 4.0 (rhbz#2380705)
Date: Thu, 30 Jul 2026 12:08:12 GMT [thread overview]
Message-ID: <178541329223.1.4919483800231422464.rpms-lib3mf-7f297581482d@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/lib3mf
Branch : rawhide
Commit : 7f297581482dfd34913828c8485412be0150b17f
Author : Cristian Le <git@lecris.dev>
Date : 2026-07-29T16:58:30+00:00
Stats : +112/-20 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/lib3mf/c/7f297581482dfd34913828c8485412be0150b17f?branch=rawhide
Log:
Allow to build with CMake 4.0 (rhbz#2380705)
- Use standard CMake macros (rhbz#2381033)
- Various spec file cleanups
---
diff --git a/cmake4.0.patch b/cmake4.0.patch
new file mode 100644
index 0000000..38c62ef
--- /dev/null
+++ b/cmake4.0.patch
@@ -0,0 +1,103 @@
+diff -ru lib3mf-2.2.0/CMakeLists.txt lib3mf-2.2.0-new/CMakeLists.txt
+--- lib3mf-2.2.0/CMakeLists.txt 2021-08-24 11:11:45.000000000 +0200
++++ lib3mf-2.2.0-new/CMakeLists.txt 2026-01-09 19:51:37.491679692 +0100
+@@ -1,12 +1,7 @@
+-cmake_minimum_required (VERSION 2.8)
+-
+-cmake_policy(SET CMP0054 NEW)
+-cmake_policy(SET CMP0048 NEW)
++cmake_minimum_required (VERSION 3.5...4.0)
+
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+
+-include(GNUInstallDirs)
+-
+ # Define Version
+ set(LIB3MF_VERSION_MAJOR 2) # increase on every backward-compatibility breaking change of the API
+ set(LIB3MF_VERSION_MINOR 2) # increase on every backward compatible change of the API
+@@ -18,9 +13,9 @@
+ DESCRIPTION "An implementation of the 3D Manufacturing Format file standard"
+ )
+
+-set(CMAKE_INSTALL_BINDIR bin CACHE PATH "directory for installing binary files")
+-set(CMAKE_INSTALL_LIBDIR lib CACHE PATH "directory for installing library files")
+-set(CMAKE_INSTALL_INCLUDEDIR include/lib3mf CACHE PATH "directory for installing header files")
++include(GNUInstallDirs)
++
++set(LIB3MF_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/lib3mf CACHE PATH "directory for installing header files")
+
+ option(USE_INCLUDED_ZLIB "Use included zlib" ON)
+ option(USE_INCLUDED_LIBZIP "Use included libzip" ON)
+@@ -220,7 +215,7 @@
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+-install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR_AUTOGENERATED}/Bindings DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
++install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR_AUTOGENERATED}/Bindings DESTINATION "${LIB3MF_INSTALL_INCLUDEDIR}")
+
+ #########################################################
+ option(LIB3MF_TESTS "Switch whether the tests of lib3mf should be build" ON)
+diff -ru lib3mf-2.2.0/Documentation/source/Cpp/CMakeLists_dynamic.txt lib3mf-2.2.0-new/Documentation/source/Cpp/CMakeLists_dynamic.txt
+--- lib3mf-2.2.0/Documentation/source/Cpp/CMakeLists_dynamic.txt 2021-08-24 11:11:45.000000000 +0200
++++ lib3mf-2.2.0-new/Documentation/source/Cpp/CMakeLists_dynamic.txt 2026-01-09 17:59:43.030053825 +0100
+@@ -1,4 +1,4 @@
+-cmake_minimum_required(VERSION 3.5)
++cmake_minimum_required(VERSION 3.5...4.0)
+
+ set(CMAKE_CURRENT_BINDING_DIR ${CMAKE_CURRENT_SOURCE_DIR}/.)
+ project(Lib3MFExample_CPPDynamic)
+diff -ru lib3mf-2.2.0/Documentation/source/Cpp/CMakeLists_implicit.txt lib3mf-2.2.0-new/Documentation/source/Cpp/CMakeLists_implicit.txt
+--- lib3mf-2.2.0/Documentation/source/Cpp/CMakeLists_implicit.txt 2021-08-24 11:11:45.000000000 +0200
++++ lib3mf-2.2.0-new/Documentation/source/Cpp/CMakeLists_implicit.txt 2026-01-09 17:59:52.972543195 +0100
+@@ -1,4 +1,4 @@
+-cmake_minimum_required(VERSION 3.5)
++cmake_minimum_required(VERSION 3.5...4.0)
+
+ set(CMAKE_CURRENT_BINDING_DIR ${CMAKE_CURRENT_SOURCE_DIR}/.)
+ project(Lib3MFExample_CPPImplicit)
+diff -ru lib3mf-2.2.0/SDK/Examples/CDynamic/CMakeLists.txt lib3mf-2.2.0-new/SDK/Examples/CDynamic/CMakeLists.txt
+--- lib3mf-2.2.0/SDK/Examples/CDynamic/CMakeLists.txt 2021-08-24 11:11:45.000000000 +0200
++++ lib3mf-2.2.0-new/SDK/Examples/CDynamic/CMakeLists.txt 2026-01-09 18:00:48.354007291 +0100
+@@ -34,7 +34,7 @@
+
+ ]]
+
+-cmake_minimum_required(VERSION 3.5)
++cmake_minimum_required(VERSION 3.5...4.0)
+
+ project(Lib3MFExample_CDynamic C)
+ if (WIN32)
+diff -ru lib3mf-2.2.0/SDK/Examples/Cpp/CMakeLists.txt lib3mf-2.2.0-new/SDK/Examples/Cpp/CMakeLists.txt
+--- lib3mf-2.2.0/SDK/Examples/Cpp/CMakeLists.txt 2021-08-24 11:11:45.000000000 +0200
++++ lib3mf-2.2.0-new/SDK/Examples/Cpp/CMakeLists.txt 2026-01-09 18:00:20.922244017 +0100
+@@ -1,4 +1,4 @@
+-cmake_minimum_required (VERSION 2.6)
++cmake_minimum_required (VERSION 3.5...4.0)
+
+ set(CMAKE_CXX_STANDARD 11)
+
+diff -ru lib3mf-2.2.0/SDK/Examples/CppDynamic/CMakeLists.txt lib3mf-2.2.0-new/SDK/Examples/CppDynamic/CMakeLists.txt
+--- lib3mf-2.2.0/SDK/Examples/CppDynamic/CMakeLists.txt 2021-08-24 11:11:45.000000000 +0200
++++ lib3mf-2.2.0-new/SDK/Examples/CppDynamic/CMakeLists.txt 2026-01-09 18:00:33.280289950 +0100
+@@ -34,7 +34,7 @@
+
+ ]]
+
+-cmake_minimum_required(VERSION 3.5)
++cmake_minimum_required(VERSION 3.5...4.0)
+
+ project(Example_ExtractInfo)
+ set(CMAKE_CXX_STANDARD 11)
+diff -ru lib3mf-2.2.0/Tests/CPP_Bindings/CMakeLists.txt lib3mf-2.2.0-new/Tests/CPP_Bindings/CMakeLists.txt
+--- lib3mf-2.2.0/Tests/CPP_Bindings/CMakeLists.txt 2021-08-24 11:11:45.000000000 +0200
++++ lib3mf-2.2.0-new/Tests/CPP_Bindings/CMakeLists.txt 2026-01-09 18:09:29.362977041 +0100
+@@ -47,9 +47,6 @@
+ target_compile_options(${TESTNAME} PUBLIC "$<$<CONFIG:RELEASE>:/O2;/sdl;/WX;/Oi;/Gy;/FC;/MD;/wd4996>")
+ endif()
+
+-add_dependencies(${TESTNAME} ssl)
+-add_dependencies(${TESTNAME} crypto)
+-
+ target_include_directories(${TESTNAME} PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/Include
+ ${gtest_SOURCE_DIR}/include
diff --git a/lib3mf.spec b/lib3mf.spec
index 4a681b4..9039241 100644
--- a/lib3mf.spec
+++ b/lib3mf.spec
@@ -18,11 +18,13 @@ Patch290: https://github.com/3MFConsortium/lib3mf/pull/290.patch
# Fix build with GCC 15, #include <cstdint> for uint64_t definition
Patch407: https://github.com/3MFConsortium/lib3mf/pull/407.patch
+# https://github.com/3MFConsortium/lib3mf/issues/446
+Patch: cmake4.0.patch
+
BuildRequires: act
-BuildRequires: cmake3
+BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: libzip-devel
-BuildRequires: make
BuildRequires: openssl-devel
BuildRequires: zlib-devel
@@ -40,9 +42,6 @@ ExcludeArch: %{ix86}
# https://github.com/ReneNyffenegger/cpp-base64
Provides: bundled(cpp-base64) = 1.01.00
-# Get the pre-Fedora 33 behavior for now until diverged from EPEL 7
-%define __cmake_in_source_build 1
-
%global _description %{expand:
lib3mf is a C++ implementation of the 3D Manufacturing Format standard.
This is a 3D printing standard for representing geometry as meshes.}
@@ -81,23 +80,18 @@ sed -i -e 's|Libraries/libzip/zip.h|zip.h|' \
%build
-mkdir -p build
-cd build
-%cmake3 %{!?with_tests:-DLIB3MF_TESTS=OFF} \
+%cmake \
+ %{!?with_tests:-DLIB3MF_TESTS=OFF} \
-DUSE_INCLUDED_ZLIB=OFF \
-DUSE_INCLUDED_LIBZIP=OFF \
-DUSE_INCLUDED_GTEST=OFF \
-DUSE_INCLUDED_SSL=OFF \
- -DSTRIP_BINARIES=OFF \
- -DCMAKE_INSTALL_LIBDIR=%{_lib} \
- -DCMAKE_INSTALL_INCLUDEDIR=include/%{name} \
- ..
-%make_build
-cd ..
+ -DSTRIP_BINARIES=OFF
+%cmake_build
%install
-%make_install -C build
+%cmake_install
# Also include the other headers
cp -a Include/* %{buildroot}%{_includedir}/%{name}/
@@ -119,15 +113,10 @@ ln -s lib3mf.pc %{buildroot}%{_libdir}/pkgconfig/lib3MF.pc
%if %{with tests}
%check
-cd build
%ctest --rerun-failed --output-on-failure
-cd ..
%endif
-%ldconfig_scriptlets
-
-
%files
%doc README.md
%license LICENSE
reply other threads:[~2026-07-30 12:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178541329223.1.4919483800231422464.rpms-lib3mf-7f297581482d@fedoraproject.org \
--to=git@lecris.dev \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox