From 965d1e430fff077203141319fb10084116db2c3b Mon Sep 17 00:00:00 2001 From: rginon314 Date: Fri, 3 Apr 2026 10:13:36 +0200 Subject: [PATCH 1/2] build: bump cmake_minimum_required to 3.5 for CMake 4.x compatibility CMake 4.0 removed compatibility with versions < 3.5, causing a hard error when configuring the build. Update all three CMakeLists.txt files from VERSION 2.8.12.1 to VERSION 3.5. Fixes build on CMake >= 4.0 (e.g. CMake 4.2.x). --- CMakeLists.txt | 2 +- examples/CMakeLists.txt | 2 +- tools/streamer_recorder/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8ef04736..f6e6802c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12.1) +CMAKE_MINIMUM_REQUIRED(VERSION 3.5) SET(PROJECT_VER_MAJOR 0) SET(PROJECT_VER_MINOR 2) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 8741f67fd..bd79025b1 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12.1) +CMAKE_MINIMUM_REQUIRED(VERSION 3.5) if(WIN32 AND NOT MINGW) if(NOT DEFINED CMAKE_DEBUG_POSTFIX) diff --git a/tools/streamer_recorder/CMakeLists.txt b/tools/streamer_recorder/CMakeLists.txt index 77f203f5e..9986ebced 100644 --- a/tools/streamer_recorder/CMakeLists.txt +++ b/tools/streamer_recorder/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12.1) +CMAKE_MINIMUM_REQUIRED(VERSION 3.5) if(WIN32 AND NOT MINGW) if(NOT DEFINED CMAKE_DEBUG_POSTFIX) From 5c5ecf050adabf20904309243d519a75271f103b Mon Sep 17 00:00:00 2001 From: rginon314 Date: Fri, 3 Apr 2026 10:14:17 +0200 Subject: [PATCH 2/2] fix: undefine CL_ICDL_VERSION macro before local declaration OpenCL headers >= 3.0.16 (cl_ext.h) define CL_ICDL_VERSION as a preprocessor macro with value 2. This conflicts with the local variable declaration 'const int CL_ICDL_VERSION = 2;' in both OpenCL processor files, causing a compile error: error: expected unqualified-id before numeric constant Add a conditional #undef before the local declaration to resolve the macro collision on modern OpenCL header versions. Affected files: - src/opencl_depth_packet_processor.cpp - src/opencl_kde_depth_packet_processor.cpp --- src/opencl_depth_packet_processor.cpp | 3 +++ src/opencl_kde_depth_packet_processor.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/opencl_depth_packet_processor.cpp b/src/opencl_depth_packet_processor.cpp index d8db14d3c..d95f50981 100644 --- a/src/opencl_depth_packet_processor.cpp +++ b/src/opencl_depth_packet_processor.cpp @@ -251,6 +251,9 @@ class OpenCLDepthPacketProcessorImpl: public WithPerfLogging newIrFrame(); newDepthFrame(); +#ifdef CL_ICDL_VERSION +#undef CL_ICDL_VERSION +#endif const int CL_ICDL_VERSION = 2; typedef cl_int (*icdloader_func)(int, size_t, void*, size_t*); #ifdef _MSC_VER diff --git a/src/opencl_kde_depth_packet_processor.cpp b/src/opencl_kde_depth_packet_processor.cpp index 98dbdff54..9d38ac5aa 100644 --- a/src/opencl_kde_depth_packet_processor.cpp +++ b/src/opencl_kde_depth_packet_processor.cpp @@ -259,6 +259,9 @@ class OpenCLKdeDepthPacketProcessorImpl: public WithPerfLogging newIrFrame(); newDepthFrame(); +#ifdef CL_ICDL_VERSION +#undef CL_ICDL_VERSION +#endif const int CL_ICDL_VERSION = 2; typedef cl_int (*icdloader_func)(int, size_t, void*, size_t*); #ifdef _MSC_VER