From 2a210e23c63b9a145b0a9f0a2d43f789103a6c0e Mon Sep 17 00:00:00 2001 From: Brian Rosenberg Date: Wed, 10 Dec 2025 12:47:05 -0500 Subject: [PATCH] Upgrade to ubuntu 24 --- detection/api/CMakeLists.txt | 2 +- .../AudioOnlyComponent/CMakeLists.txt | 3 +- .../examples/GenericComponent/CMakeLists.txt | 3 +- .../HelloWorldComponent/CMakeLists.txt | 3 +- .../ImageTransformerComponent/CMakeLists.txt | 3 +- .../VideoCaptureComponent/CMakeLists.txt | 3 +- detection/testUtils/CMakeLists.txt | 2 +- detection/utils/CMakeLists.txt | 2 +- .../CopySharedLibDependencies.cmake | 46 ++----------------- 9 files changed, 11 insertions(+), 56 deletions(-) diff --git a/detection/api/CMakeLists.txt b/detection/api/CMakeLists.txt index 10c0528..53a68da 100644 --- a/detection/api/CMakeLists.txt +++ b/detection/api/CMakeLists.txt @@ -30,7 +30,7 @@ project(openmpf-cpp-component-api) set(CMAKE_CXX_STANDARD 17) -find_package(OpenCV 4.9.0 EXACT REQUIRED PATHS /opt/opencv-4.9.0 +find_package(OpenCV 4.13.0 EXACT REQUIRED PATHS /opt/opencv-4.13.0 COMPONENTS opencv_core opencv_imgcodecs opencv_imgproc opencv_videoio) diff --git a/detection/examples/AudioOnlyComponent/CMakeLists.txt b/detection/examples/AudioOnlyComponent/CMakeLists.txt index 25878c4..a7d257b 100644 --- a/detection/examples/AudioOnlyComponent/CMakeLists.txt +++ b/detection/examples/AudioOnlyComponent/CMakeLists.txt @@ -34,7 +34,7 @@ include(../ComponentSetup.cmake) find_package(mpfComponentInterface REQUIRED) find_package(mpfDetectionComponentApi REQUIRED) -find_package(OpenCV 4.9.0 EXACT REQUIRED PATHS /opt/opencv-4.9.0 COMPONENTS opencv_core) +find_package(OpenCV 4.13.0 EXACT REQUIRED PATHS /opt/opencv-4.13.0 COMPONENTS opencv_core) set(AUDIO_ONLY_COMPONENT_SOURCES AudioOnly.cpp AudioOnly.h) @@ -47,4 +47,3 @@ configure_mpf_component(AudioOnlyComponent TARGETS mpfAudioOnly) add_executable(sample_audio_only_detector sample_audio_only_detector.cpp) target_link_libraries(sample_audio_only_detector mpfAudioOnly) - diff --git a/detection/examples/GenericComponent/CMakeLists.txt b/detection/examples/GenericComponent/CMakeLists.txt index 9e06c30..3f10c7b 100644 --- a/detection/examples/GenericComponent/CMakeLists.txt +++ b/detection/examples/GenericComponent/CMakeLists.txt @@ -34,7 +34,7 @@ include(../ComponentSetup.cmake) find_package(mpfComponentInterface REQUIRED) find_package(mpfDetectionComponentApi REQUIRED) -find_package(OpenCV 4.9.0 EXACT REQUIRED PATHS /opt/opencv-4.9.0 COMPONENTS opencv_core) +find_package(OpenCV 4.13.0 EXACT REQUIRED PATHS /opt/opencv-4.13.0 COMPONENTS opencv_core) set(GENERIC_COMPONENT_SOURCES GenericComponent.cpp GenericComponent.h) @@ -47,4 +47,3 @@ configure_mpf_component(GenericComponent TARGETS mpfGeneric) add_executable(sample_generic_detector sample_generic_detector.cpp) target_link_libraries(sample_generic_detector mpfGeneric) - diff --git a/detection/examples/HelloWorldComponent/CMakeLists.txt b/detection/examples/HelloWorldComponent/CMakeLists.txt index 9eb61fe..bfb7618 100644 --- a/detection/examples/HelloWorldComponent/CMakeLists.txt +++ b/detection/examples/HelloWorldComponent/CMakeLists.txt @@ -34,7 +34,7 @@ include(../ComponentSetup.cmake) find_package(mpfComponentInterface REQUIRED) find_package(mpfDetectionComponentApi REQUIRED) -find_package(OpenCV 4.9.0 EXACT REQUIRED PATHS /opt/opencv-4.9.0 COMPONENTS opencv_core) +find_package(OpenCV 4.13.0 EXACT REQUIRED PATHS /opt/opencv-4.13.0 COMPONENTS opencv_core) find_package(PkgConfig) pkg_search_module(LOG4CXX REQUIRED liblog4cxx) @@ -52,4 +52,3 @@ configure_mpf_component(HelloWorldComponent TARGETS mpfHelloWorld mpfStreamingHe add_executable(sample_hello_world_detector sample_hello_world_detector.cpp) target_link_libraries(sample_hello_world_detector mpfHelloWorld) - diff --git a/detection/examples/ImageTransformerComponent/CMakeLists.txt b/detection/examples/ImageTransformerComponent/CMakeLists.txt index cd1c28b..cfc3a64 100644 --- a/detection/examples/ImageTransformerComponent/CMakeLists.txt +++ b/detection/examples/ImageTransformerComponent/CMakeLists.txt @@ -34,7 +34,7 @@ include(../ComponentSetup.cmake) find_package(mpfComponentInterface REQUIRED) find_package(mpfDetectionComponentApi REQUIRED) -find_package(OpenCV 4.9.0 EXACT REQUIRED PATHS /opt/opencv-4.9.0 COMPONENTS opencv_core opencv_highgui) +find_package(OpenCV 4.13.0 EXACT REQUIRED PATHS /opt/opencv-4.13.0 COMPONENTS opencv_core opencv_highgui) set(IMAGE_TRANSFORMER_COMPONENT_SOURCES ImageTransformerComponent.h ImageTransformerComponent.cpp) @@ -47,4 +47,3 @@ configure_mpf_component(ImageTransformerComponent TARGETS mpfImageTransformer) add_executable(sample_image_transformer sample_image_transformer.cpp) target_link_libraries(sample_image_transformer mpfImageTransformer) - diff --git a/detection/examples/VideoCaptureComponent/CMakeLists.txt b/detection/examples/VideoCaptureComponent/CMakeLists.txt index 9bb8e81..11ea04a 100644 --- a/detection/examples/VideoCaptureComponent/CMakeLists.txt +++ b/detection/examples/VideoCaptureComponent/CMakeLists.txt @@ -34,7 +34,7 @@ include(../ComponentSetup.cmake) find_package(mpfComponentInterface REQUIRED) find_package(mpfDetectionComponentApi REQUIRED) -find_package(OpenCV 4.9.0 EXACT REQUIRED PATHS /opt/opencv-4.9.0 COMPONENTS opencv_core opencv_highgui) +find_package(OpenCV 4.13.0 EXACT REQUIRED PATHS /opt/opencv-4.13.0 COMPONENTS opencv_core opencv_highgui) set(VIDEO_CAPTURE_COMPONENT_SOURCES VideoCaptureComponent.h VideoCaptureComponent.cpp) @@ -47,4 +47,3 @@ configure_mpf_component(VideoCaptureComponent TARGETS mpfVideoCapture) add_executable(sample_video_capture_component sample_video_capture_component.cpp) target_link_libraries(sample_video_capture_component mpfVideoCapture) - diff --git a/detection/testUtils/CMakeLists.txt b/detection/testUtils/CMakeLists.txt index 02a7f5e..d38b3dc 100644 --- a/detection/testUtils/CMakeLists.txt +++ b/detection/testUtils/CMakeLists.txt @@ -30,7 +30,7 @@ project(openmpf-cpp-component-test-utils) set(CMAKE_CXX_STANDARD 17) -find_package(OpenCV 4.9.0 EXACT REQUIRED PATHS /opt/opencv-4.9.0 +find_package(OpenCV 4.13.0 EXACT REQUIRED PATHS /opt/opencv-4.13.0 COMPONENTS opencv_core opencv_imgcodecs opencv_imgproc opencv_videoio opencv_highgui) include_directories(include) diff --git a/detection/utils/CMakeLists.txt b/detection/utils/CMakeLists.txt index 03f5ea4..4dba41d 100644 --- a/detection/utils/CMakeLists.txt +++ b/detection/utils/CMakeLists.txt @@ -29,7 +29,7 @@ project(openmpf-cpp-component-utils) set(CMAKE_CXX_STANDARD 17) -find_package(OpenCV 4.9.0 EXACT REQUIRED PATHS /opt/opencv-4.9.0 +find_package(OpenCV 4.13.0 EXACT REQUIRED PATHS /opt/opencv-4.13.0 COMPONENTS opencv_core opencv_imgcodecs opencv_imgproc opencv_videoio) find_package(PkgConfig) diff --git a/mpf-cmake-helpers/CopySharedLibDependencies.cmake b/mpf-cmake-helpers/CopySharedLibDependencies.cmake index c358f2b..0faa814 100644 --- a/mpf-cmake-helpers/CopySharedLibDependencies.cmake +++ b/mpf-cmake-helpers/CopySharedLibDependencies.cmake @@ -24,7 +24,7 @@ # limitations under the License. # ############################################################################# -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.15) include(GetPrerequisites) @@ -70,41 +70,6 @@ function(is_std_linux_lib lib_path result) endfunction() -# Can't use the built-in: get_filename_component( REALPATH) -# because when there is a link to a link to file it only returns the file -# and does not return the intermediate links. -function(resolve_single_link file result) - execute_process(COMMAND readlink ${file} - OUTPUT_VARIABLE readlink_output - OUTPUT_STRIP_TRAILING_WHITESPACE) - - if(IS_ABSOLUTE ${readlink_output}) - set(${result} ${readlink_output} PARENT_SCOPE) - else() - # When the link's target is relative, we must use the link's directory - # to resolve the full path. - get_filename_component(file_dir ${file} DIRECTORY) - get_filename_component(target_absolute_path ${readlink_output} - ABSOLUTE - BASE_DIR ${file_dir}) - set(${result} ${target_absolute_path} PARENT_SCOPE) - endif() -endfunction() - - - -function(get_link_chain file result) - set(link_chain ${file}) - while(IS_SYMLINK ${file}) - resolve_single_link(${file} link_target) - set(file ${link_target}) - list(APPEND link_chain ${file}) - endwhile() - set(${result} ${link_chain} PARENT_SCOPE) -endfunction() - - - separate_arguments(EXTRA_LIB_DIRS) message(STATUS "Copying dependent libraries to ${DEP_LIBS_INSTALL_LOCATION}") @@ -117,14 +82,9 @@ foreach(dependency_file_relative ${DEPENDENCIES}) is_std_linux_lib(${dependency_abs_path} is_std_lib) if (NOT ${is_std_lib}) - get_link_chain(${dependency_abs_path} link_chain) - # Reverse the chain so that the links' target is copied before the link itself. - list(REVERSE link_chain) - foreach(lib_file ${link_chain}) - file(COPY ${lib_file} DESTINATION ${DEP_LIBS_INSTALL_LOCATION}) - endforeach() + file(COPY ${dependency_file_relative} DESTINATION ${DEP_LIBS_INSTALL_LOCATION} FOLLOW_SYMLINK_CHAIN) endif() endforeach() -file(LOCK ${lock_file_name} RELEASE) \ No newline at end of file +file(LOCK ${lock_file_name} RELEASE)