isp-imx: fix build with cmake 4

OE-Core updated to CMake 4. This bumped the minimum CMake Version
to 3.5.
Patch the sources so that that the isp-imx can be built.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
This commit is contained in:
Max Krummenacher 2025-07-25 13:50:19 +02:00
parent 5250e1a1cc
commit 5f79343e90
6 changed files with 270 additions and 10 deletions

View File

@ -1,7 +1,7 @@
From 3443f18dc9ab8950071d6299c7a5da86055f3318 Mon Sep 17 00:00:00 2001
From d24c74528fefd1316f1633f0a7f1a5acea40454f Mon Sep 17 00:00:00 2001
From: Max Krummenacher <max.krummenacher@toradex.com>
Date: Thu, 19 Jan 2023 15:51:24 +0000
Subject: [PATCH] isp-imx: start_isp: don't report error if no camera is
Subject: [PATCH 1/5] isp-imx: start_isp: don't report error if no camera is
configured
The script currently returns '6' when no known camera is configured
@ -17,10 +17,10 @@ Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/imx/start_isp.sh b/imx/start_isp.sh
index 95cbc19..d603f8f 100755
index d544b4ca2a57..22e7783437d6 100755
--- a/imx/start_isp.sh
+++ b/imx/start_isp.sh
@@ -74,5 +74,5 @@ elif [ $NR_DEVICE_TREE_OS08A20 -eq 2 ]; then
@@ -72,5 +72,5 @@ elif [ $NR_DEVICE_TREE_OS08A20 -eq 2 ]; then
else
# no device tree found exit with code no device or address
echo "No device tree found for Basler camera or os08a20, check dtb file!" >&2
@ -28,4 +28,5 @@ index 95cbc19..d603f8f 100755
+ exit 0
fi
--
2.35.3
2.42.0

View File

@ -0,0 +1,134 @@
From 5b69b60bd4d0d5ed1474c6457561d48cdbabc778 Mon Sep 17 00:00:00 2001
From: Max Krummenacher <max.krummenacher@toradex.com>
Date: Fri, 25 Jul 2025 09:19:58 +0000
Subject: [PATCH 2/5] appshell: cmake: bump min version to 3.5
CMake 4 no longer supports min version set to before 3.5
| CMake Error at CMakeLists.txt:28 (cmake_minimum_required):
| Compatibility with CMake < 3.5 has been removed from CMake.
Upstream-Status: Pending
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
---
appshell/CMakeLists.txt | 2 +-
appshell/display/CMakeLists.txt | 2 +-
appshell/display/wayland-client/CMakeLists.txt | 2 +-
appshell/v4l_drm_test/CMakeLists.txt | 2 +-
appshell/vvext/CMakeLists.txt | 2 +-
appshell/yuv/CMakeLists.txt | 2 +-
units/CMakeLists.txt | 2 +-
units/isi/CMakeLists.txt | 2 +-
units/isi/drv/OS08a20/CMakeLists.txt | 2 +-
units/isi/drv/OS08a20/calib/CMakeLists.txt | 2 +-
10 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/appshell/CMakeLists.txt b/appshell/CMakeLists.txt
index 22092ce975b5..cf14e254c812 100644
--- a/appshell/CMakeLists.txt
+++ b/appshell/CMakeLists.txt
@@ -25,7 +25,7 @@
# *****************************************************************************/
-cmake_minimum_required(VERSION 3.1.0)
+cmake_minimum_required(VERSION 3.5.0)
project(ISP_APP_SHELL)
if(DEFINED QTLESS)
diff --git a/appshell/display/CMakeLists.txt b/appshell/display/CMakeLists.txt
index 491f086adf55..458a46b165b4 100755
--- a/appshell/display/CMakeLists.txt
+++ b/appshell/display/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 3.6)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC")
diff --git a/appshell/display/wayland-client/CMakeLists.txt b/appshell/display/wayland-client/CMakeLists.txt
index 78247528b0e4..0639d79d8346 100644
--- a/appshell/display/wayland-client/CMakeLists.txt
+++ b/appshell/display/wayland-client/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 3.6)
set(WAYLAND_XML_PRIFIX ${SDKTARGETSYSROOT}/usr/share/wayland-protocols)
set(GEN_INSTALL_PREFIX ${PROJECT_SOURCE_DIR}/display/wayland-client)
diff --git a/appshell/v4l_drm_test/CMakeLists.txt b/appshell/v4l_drm_test/CMakeLists.txt
index cf4685c84204..309e5d465e99 100755
--- a/appshell/v4l_drm_test/CMakeLists.txt
+++ b/appshell/v4l_drm_test/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 3.5)
project(ISP_V4L_DRM_TEST)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
diff --git a/appshell/vvext/CMakeLists.txt b/appshell/vvext/CMakeLists.txt
index a5d6c12929fa..63c1eb5f7073 100755
--- a/appshell/vvext/CMakeLists.txt
+++ b/appshell/vvext/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 3.5)
project(ISP_V4L_DRM_TEST)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
diff --git a/appshell/yuv/CMakeLists.txt b/appshell/yuv/CMakeLists.txt
index 131766fcb5d4..0f3591918e08 100755
--- a/appshell/yuv/CMakeLists.txt
+++ b/appshell/yuv/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 3.5)
set (CMAKE_CXX_FLAGS_DEBUG "")
set (CMAKE_C_FLAGS_DEBUG "")
diff --git a/units/CMakeLists.txt b/units/CMakeLists.txt
index 37fa65ed4ea8..10abbef1c16c 100755
--- a/units/CMakeLists.txt
+++ b/units/CMakeLists.txt
@@ -24,7 +24,7 @@
# *
# *****************************************************************************/
-cmake_minimum_required(VERSION 3.1.0)
+cmake_minimum_required(VERSION 3.5.0)
project(ISPcore_SW_STACK)
if( NOT DEFINED APPSHELL_TOP_COMPILE)
diff --git a/units/isi/CMakeLists.txt b/units/isi/CMakeLists.txt
index a91699b4a1a5..ea01aa7d9424 100755
--- a/units/isi/CMakeLists.txt
+++ b/units/isi/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 3.5)
# define module name
set (module isi)
diff --git a/units/isi/drv/OS08a20/CMakeLists.txt b/units/isi/drv/OS08a20/CMakeLists.txt
index d27dc97f7945..12c6e9ef993a 100755
--- a/units/isi/drv/OS08a20/CMakeLists.txt
+++ b/units/isi/drv/OS08a20/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 3.5)
# define module name & interface version
set (module os08a20)
diff --git a/units/isi/drv/OS08a20/calib/CMakeLists.txt b/units/isi/drv/OS08a20/calib/CMakeLists.txt
index b44b08248135..18119086b967 100755
--- a/units/isi/drv/OS08a20/calib/CMakeLists.txt
+++ b/units/isi/drv/OS08a20/calib/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 3.5)
# use upper level module name
--
2.42.0

View File

@ -0,0 +1,37 @@
From db07010535d47d7d7eaf3865d97dcec045e19930 Mon Sep 17 00:00:00 2001
From: Max Krummenacher <max.krummenacher@toradex.com>
Date: Fri, 25 Jul 2025 09:57:22 +0000
Subject: [PATCH 3/5] appshell: cmake: drop deprecated use of
target_link_libraries
Works around:
| CMake Error at display/CMakeLists.txt:48 (target_link_libraries):
| Cannot specify link libraries for target "wayland-client" which is not
| built by this project.
caused by CMake 4 deprecating https://cmake.org/cmake/help/v3.5/policy/CMP0016.html
CMP0016 states that the command is silently ignored, thus drop it.
Upstream-Status: Pending
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
---
appshell/display/CMakeLists.txt | 1 -
1 file changed, 1 deletion(-)
diff --git a/appshell/display/CMakeLists.txt b/appshell/display/CMakeLists.txt
index 458a46b165b4..160755312368 100755
--- a/appshell/display/CMakeLists.txt
+++ b/appshell/display/CMakeLists.txt
@@ -43,7 +43,6 @@ if (WAYLAND_SUPPORT)
file(GLOB pub_headers *.h)
file(GLOB libsources *.cpp ./wayland-client/*.c)
include_directories(./wayland-client)
- target_link_libraries(wayland-client)
else (WAYLAND_SUPPORT)
file(GLOB pub_headers *.h)
file(GLOB libsources *.cpp)
--
2.42.0

View File

@ -0,0 +1,51 @@
From d7e06f57c067e50d86369577b8dc3bccdde6fd40 Mon Sep 17 00:00:00 2001
From: Max Krummenacher <max.krummenacher@toradex.com>
Date: Fri, 25 Jul 2025 10:44:40 +0000
Subject: [PATCH 4/5] units/targets.cmake: fix check if a target exists
| CMake Error at units/targets.cmake:35 (get_target_property):
| get_target_property() called with non-existent target "lib".
Upstream-Status: Pending
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
---
units/targets.cmake | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/units/targets.cmake b/units/targets.cmake
index 663a024d9129..d78dbf8b8a45 100755
--- a/units/targets.cmake
+++ b/units/targets.cmake
@@ -32,8 +32,7 @@ add_dependencies(create_alldir ${module}_create_dir)
# Settings for target LIB
###############################################################################
# check if lib target already exists and create it, this is to assure that only one target called lib will be generated
-get_target_property(LIB_TARGET lib TYPE)
-if(NOT LIB_TARGET)
+if(NOT TARGET lib)
add_custom_target(lib)
endif()
# the library itself is a dependency for the target lib
@@ -83,8 +82,7 @@ if(HAVE_PUBLIC_HEADERS)
endif()
# check if lib_install target already exists and create it
-get_target_property(LIB_INSTALL_TARGET lib_install TYPE)
-if(NOT LIB_INSTALL_TARGET)
+if(NOT TARGET lib_install)
add_custom_target(lib_install)
endif()
@@ -104,8 +102,7 @@ add_custom_target(${module}_copy_header
COMMENT "Copying Headers of ${module}")
# check if copy_header target already exists and create it
-get_target_property(COPY_HEADER_TARGET copy_header TYPE)
-if(NOT COPY_HEADER_TARGET)
+if(NOT TARGET copy_header)
add_custom_target(copy_header)
endif()
# if copy_header is selected, modulename_copy_header target must be created
--
2.42.0

View File

@ -0,0 +1,36 @@
From 72d6160d1efc9df8bdee4e3dc9da67560f2206b4 Mon Sep 17 00:00:00 2001
From: Max Krummenacher <max.krummenacher@toradex.com>
Date: Fri, 25 Jul 2025 10:52:52 +0000
Subject: [PATCH 5/5] units: cmake: fix use of add_dependencies
With CMake 4 we get during configure:
| CMake Error at isp-imx/4.2.2.25.2/sources/isp-imx-4.2.2.25.2-3cac1fb:
| The dependency target "drv/OS08a20" of target "copy_shell_libs_isi" does
| not exist.
Comment out that the add_dependencies. The driver for OS08a20 is still
part of the built packages.
Upstream-Status: Pending
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
---
units/isi/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/units/isi/CMakeLists.txt b/units/isi/CMakeLists.txt
index ea01aa7d9424..2f5c3d803e67 100755
--- a/units/isi/CMakeLists.txt
+++ b/units/isi/CMakeLists.txt
@@ -93,7 +93,7 @@ add_custom_target(copy_shell_libs_${module} ALL
COMMAND ${CMAKE_COMMAND} -E copy ${UNITS_TOP_DIRECTORY}/isi/drv/*/*.cfg ${LIB_ROOT}/${CMAKE_BUILD_TYPE}/bin/
COMMAND ${CMAKE_COMMAND} -E copy ${UNITS_TOP_DIRECTORY}/isi/drv/*.cfg ${LIB_ROOT}/${CMAKE_BUILD_TYPE}/bin/
)
-add_dependencies(copy_shell_libs_${module} drv/OS08a20)
+#add_dependencies(copy_shell_libs_${module} os08a20_shared)
endif (GENERATE_PARTITION_BUILD)
--
2.42.0

View File

@ -8,6 +8,10 @@ DEPENDS = "boost libdrm virtual/libg2d libtinyxml2 jsoncpp patchelf-native"
SRC_URI = " \
${FSL_MIRROR}/${BP}-${IMX_SRCREV_ABBREV}.bin;fsl-eula=true \
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${ISP_SYSTEMD_PATCH}', '', d)} \
file://0002-appshell-cmake-bump-min-version-to-3.5.patch \
file://0003-appshell-cmake-drop-deprecated-use-of-target_link_li.patch \
file://0004-units-targets.cmake-fix-check-if-a-target-exists.patch \
file://0005-units-cmake-fix-use-of-add_dependencies.patch \
"
ISP_SYSTEMD_PATCH = "file://0001-isp-imx-start_isp-don-t-report-error-if-no-camera-is.patch"
@ -16,7 +20,7 @@ S = "${UNPACKDIR}/${BP}-${IMX_SRCREV_ABBREV}"
SRC_URI[sha256sum] = "8fa5094da6438505287f4dcc8033dad3057ab81bf98c858884f7c3a2e521b252"
inherit fsl-eula-unpack cmake systemd use-imx-headers
inherit fsl-eula-unpack cmake pkgconfig systemd use-imx-headers
PACKAGECONFIG = ""
# Note: building with tuningext fails with boost 1.87.
@ -50,7 +54,7 @@ EXTRA_OECMAKE += " \
-Wno-dev \
"
do_configure:prepend () {
do_configure_disable:prepend () {
# FIXME: should be rebuild.
patchelf --replace-needed libjsoncpp.so.25 libjsoncpp.so.26 ${S}/mediacontrol/install/bin/isp_media_server
patchelf --replace-needed libjsoncpp.so.25 libjsoncpp.so.26 ${S}/mediacontrol/install/lib/libmedia_server.so
@ -61,9 +65,6 @@ do_configure:prepend () {
}
do_install() {
# FIXME: provided by the basler-camera package, do not install them here additionally
rm -f ${S}/dewarp/dewarp_config//daA3840_30mc*.json
# The Makefile unconditionally installs tuningext even if it is not built
if ${@bb.utils.contains('PACKAGECONFIG','tuningext','false','true',d)}; then
touch ${B}/generated/release/bin/tuningext