Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion detection/api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
3 changes: 1 addition & 2 deletions detection/examples/AudioOnlyComponent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

3 changes: 1 addition & 2 deletions detection/examples/GenericComponent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

3 changes: 1 addition & 2 deletions detection/examples/HelloWorldComponent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

3 changes: 1 addition & 2 deletions detection/examples/ImageTransformerComponent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

3 changes: 1 addition & 2 deletions detection/examples/VideoCaptureComponent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

2 changes: 1 addition & 1 deletion detection/testUtils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion detection/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
46 changes: 3 additions & 43 deletions mpf-cmake-helpers/CopySharedLibDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# limitations under the License. #
#############################################################################

cmake_minimum_required(VERSION 3.6)
cmake_minimum_required(VERSION 3.15)

include(GetPrerequisites)

Expand Down Expand Up @@ -70,41 +70,6 @@ function(is_std_linux_lib lib_path result)
endfunction()


# Can't use the built-in: get_filename_component(<VAR> <FileName> 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}")
Expand All @@ -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)
file(LOCK ${lock_file_name} RELEASE)