Fix build with CMake 4.0 (resolves rhbz#2380720, rhbz#2381254)

This commit is contained in:
Dominik 'Rathann' Mierzejewski 2026-02-22 22:51:57 +01:00
commit b964645d41
3 changed files with 43 additions and 17 deletions

View file

@ -1,12 +0,0 @@
diff -up ./cmake_modules/SetupDirectories.cmake.libdir ./cmake_modules/SetupDirectories.cmake
--- ./cmake_modules/SetupDirectories.cmake.libdir 2014-05-05 18:27:34.066386294 -0400
+++ ./cmake_modules/SetupDirectories.cmake 2014-05-05 18:28:14.961891390 -0400
@@ -8,7 +8,7 @@ ENDIF (PROJECT_OS_WIN)
STRING (TOLOWER ${PROJECT_NAME} projectNameLower)
SET (PROJECT_INCLUDE_INSTALL_DIR "include/${projectNameLower}")
SET (PROJECT_MANPAGE_INSTALL_DIR "share/man")
-SET (PROJECT_LIBRARY_INSTALL_DIR "lib")
+SET (PROJECT_LIBRARY_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "Library installation directory")
MESSAGE (STATUS "${PROJECT_NAME} will be installed to ${CMAKE_INSTALL_PREFIX}")
MESSAGE (STATUS "Headers will be installed to ${CMAKE_INSTALL_PREFIX}/${PROJECT_INCLUDE_INSTALL_DIR}")

View file

@ -0,0 +1,35 @@
diff -up libfreenect-0.7.5/CMakeLists.txt.libdir libfreenect-0.7.5/CMakeLists.txt
--- libfreenect-0.7.5/CMakeLists.txt.libdir 2024-01-06 17:57:12.000000000 +0100
+++ libfreenect-0.7.5/CMakeLists.txt 2026-02-22 22:41:06.225976309 +0100
@@ -30,7 +30,7 @@
# CMake directives
######################################################################################
-cmake_minimum_required(VERSION 2.8.12...3.12)
+cmake_minimum_required(VERSION 3.5...3.12)
######################################################################################
# Project declaration and options
diff -up libfreenect-0.7.5/cmake_modules/SetupDirectories.cmake.libdir libfreenect-0.7.5/cmake_modules/SetupDirectories.cmake
--- libfreenect-0.7.5/cmake_modules/SetupDirectories.cmake.libdir 2024-01-06 17:57:12.000000000 +0100
+++ libfreenect-0.7.5/cmake_modules/SetupDirectories.cmake 2026-02-22 22:46:01.707846221 +0100
@@ -2,13 +2,18 @@
IF (PROJECT_OS_WIN)
SET (CMAKE_INSTALL_PREFIX "C:\\Program Files\\libfreenect" CACHE PATH "Installation directory")
ELSE (PROJECT_OS_WIN)
+ include(GNUInstallDirs)
SET (CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation directory")
ENDIF (PROJECT_OS_WIN)
STRING (TOLOWER ${PROJECT_NAME} projectNameLower)
SET (PROJECT_INCLUDE_INSTALL_DIR "include/${projectNameLower}")
SET (PROJECT_MANPAGE_INSTALL_DIR "share/man")
-SET (PROJECT_LIBRARY_INSTALL_DIR "lib")
+IF(CMAKE_INSTALL_LIBDIR MATCHES "lib64$")
+SET (PROJECT_LIBRARY_INSTALL_DIR "lib64" CACHE PATH "Library installation directory")
+ELSE ()
+SET (PROJECT_LIBRARY_INSTALL_DIR "lib" CACHE PATH "Library installation directory")
+ENDIF ()
MESSAGE (STATUS "${PROJECT_NAME} will be installed to ${CMAKE_INSTALL_PREFIX}")
MESSAGE (STATUS "Headers will be installed to ${CMAKE_INSTALL_PREFIX}/${PROJECT_INCLUDE_INSTALL_DIR}")

View file

@ -1,6 +1,6 @@
Name: libfreenect
Version: 0.7.5
Release: 6%{?dist}
Release: 7%{?dist}
Summary: Device driver for the Kinect
# Core libfreenect is available as Apache-2.0 OR GPL-2.0-only
# OpenNI driver is available as Apache-2.0
@ -14,8 +14,8 @@ Source0: https://github.com/OpenKinect/%{name}/archive/v%{version}/%{name
Patch0: %{name}-0.5.7-videogroup.patch
# Freenect openni driver is a plugin lib, and doesn't need soversion symlinks
Patch1: %{name}-openni2.patch
# Allow for proper libdir
Patch3: %{name}-0.4.2-libdir.patch
# Allow for proper libdir and work with CMake 4.0
Patch3: %{name}-0.7.5-cmake.patch
# BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1143912
Patch4: secarch.patch
# Fix the installation path for python libs
@ -27,7 +27,7 @@ Patch6: %{name}-0.7.5-notimestamp.patch
ExcludeArch: %{ix86}
BuildRequires: gcc-c++
BuildRequires: cmake3
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: freeglut-devel
BuildRequires: libusb1-devel
@ -104,7 +104,7 @@ rm -rv platform/windows
%patch -P 0 -p0 -b .videogroup
%patch -P 1 -p1 -b .openni2
%patch -P 3 -p0 -b .libdir
%patch -P 3 -p1 -b .cmake
%patch -P 4 -p1 -b .secarch
%patch -P 5 -p1 -b .py3
%patch -P 6 -p1 -b .tstamp
@ -201,6 +201,9 @@ mv %{buildroot}%{_libdir}/OpenNI2-FreenectDriver %{buildroot}%{_libdir}/openni2/
%{_libdir}/openni2
%changelog
* Sun Feb 22 2026 Dominik Mierzejewski <dominik@greysector.net> - 0.7.5-7
- Fix build with CMake 4.0 (resolves rhbz#2380720, rhbz#2381254)
* Thu Jan 29 2026 Nicolas Chauvet <kwizart@gmail.com> - 0.7.5-6
- Rebuilt for OpenCV 4.13