From 10871d8d630db65db2242472f024c3b528dfbcf5 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 26 Nov 2018 13:05:44 +0100 Subject: [PATCH 1/2] Patch cv_bridge to fix static linking problem --- do_everything.sh | 5 ++- patches/cv_bridge.patch | 69 +++++++++++++++++++---------------------- 2 files changed, 34 insertions(+), 40 deletions(-) diff --git a/do_everything.sh b/do_everything.sh index fccd824..69a1eb6 100755 --- a/do_everything.sh +++ b/do_everything.sh @@ -245,9 +245,8 @@ if [[ $skip -ne 1 ]] ; then # https://source.android.com/reference/com/android/tradefed/testtype/GTest.html # apply_patch $my_loc/patches/camera_info_manager.patch - # Patch cv_bridge - remove Python dependencies - # TODO: https://github.com/ros-perception/vision_opencv/pull/55 merged, need to wait until new version (current 1.11.7) - # apply_patch $my_loc/patches/cv_bridge.patch + # Patch cv_bridge - fix transitive linking in cv_bridge-extras.cmake + apply_patch $my_loc/patches/cv_bridge.patch # Patch robot_pose_ekf - Add bfl library cmake variables, also, remove tests # TODO: The correct way to handle this would be to create .cmake files for bfl and do a findpackage(orocos-bfl) diff --git a/patches/cv_bridge.patch b/patches/cv_bridge.patch index a15690d..513f77a 100644 --- a/patches/cv_bridge.patch +++ b/patches/cv_bridge.patch @@ -1,39 +1,34 @@ ---- catkin_ws/src/vision_opencv/cv_bridge/CMakeLists.txt 2014-12-16 13:23:41.106085276 -0300 -+++ catkin_ws/src/vision_opencv/cv_bridge/CMakeLists.txt 2014-12-16 13:25:29.358088880 -0300 -@@ -3,7 +3,11 @@ +--- catkin_ws/src/vision_opencv/cv_bridge/CMakeLists.txt ++++ catkin_ws/src/vision_opencv/cv_bridge/CMakeLists.txt +@@ -25,7 +25,6 @@ catkin_package( + INCLUDE_DIRS include + LIBRARIES ${PROJECT_NAME} + CATKIN_DEPENDS rosconsole sensor_msgs +- DEPENDS OpenCV + CFG_EXTRAS cv_bridge-extras.cmake + ) - find_package(catkin REQUIRED COMPONENTS rosconsole sensor_msgs) +--- catkin_ws/src/vision_opencv/cv_bridge/cmake/cv_bridge-extras.cmake.in ++++ catkin_ws/src/vision_opencv/cv_bridge/cmake/cv_bridge-extras.cmake.in +@@ -1,12 +1,7 @@ +-set(OpenCV_VERSION @OpenCV_VERSION@) +-set(OpenCV_VERSION_MAJOR @OpenCV_VERSION_MAJOR@) +-set(OpenCV_VERSION_MINOR @OpenCV_VERSION_MINOR@) +-set(OpenCV_VERSION_PATCH @OpenCV_VERSION_PATCH@) +-set(OpenCV_SHARED @OpenCV_SHARED@) +-set(OpenCV_CONFIG_PATH @OpenCV_CONFIG_PATH@) +-set(OpenCV_INSTALL_PATH @OpenCV_INSTALL_PATH@) +-set(OpenCV_LIB_COMPONENTS @OpenCV_LIB_COMPONENTS@) +-set(OpenCV_USE_MANGLED_PATHS @OpenCV_USE_MANGLED_PATHS@) +-set(OpenCV_MODULES_SUFFIX @OpenCV_MODULES_SUFFIX@) +- ++find_package(OpenCV 3 REQUIRED ++ COMPONENTS ++ opencv_core ++ opencv_imgproc ++ opencv_imgcodecs ++ CONFIG ++) -+if(NOT ANDROID) - find_package(Boost REQUIRED python) -+else() -+find_package(Boost REQUIRED) -+endif() - find_package(OpenCV REQUIRED) - if (OpenCV_VERSION VERSION_EQUAL "3") - add_definitions("-DOPENCV3=1") -@@ -21,7 +25,9 @@ - include_directories(SYSTEM ${Boost_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS}) - include_directories(include ${catkin_INCLUDE_DIRS}) - -+if(NOT ANDROID) - add_subdirectory(python) -+endif() - add_subdirectory(src) - if(CATKIN_ENABLE_TESTING) - add_subdirectory(test) ---- catkin_ws/src/vision_opencv/cv_bridge/src/CMakeLists.txt 2014-12-12 14:16:26.261088783 -0300 -+++ catkin_ws/src/vision_opencv/cv_bridge/src/CMakeLists.txt 2014-12-12 14:17:17.117087617 -0300 -@@ -5,6 +5,7 @@ - - install(TARGETS ${PROJECT_NAME} DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}) - -+if(NOT ANDROID) - # add a Boost Python library - find_package(PythonInterp REQUIRED) - find_package(PythonLibs "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") -@@ -54,3 +55,4 @@ - endif() - - install(TARGETS ${PROJECT_NAME}_boost DESTINATION ${CATKIN_PACKAGE_PYTHON_DESTINATION}/boost/) -+endif() ++list(APPEND @PROJECT_NAME@_LIBRARIES ${OpenCV_LIBRARIES}) ++list(APPEND @PROJECT_NAME@_INCLUDE_DIRS ${OpenCV_INCLUDE_DIRS}) From e5a956cd35a9f758b594c460b960284a8aeeba98 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 26 Nov 2018 13:16:46 +0100 Subject: [PATCH 2/2] Install opencv README and license file to share/OpenCV --- patches/opencv.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/patches/opencv.patch b/patches/opencv.patch index d2491d9..5151670 100644 --- a/patches/opencv.patch +++ b/patches/opencv.patch @@ -88,3 +88,17 @@ # ---------------------------------------------------------------------------- # Finalization: generate configuration-based files +@@ -850,11 +845,11 @@ + if(ANDROID OR NOT UNIX) + install(FILES ${OPENCV_LICENSE_FILE} + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ +- DESTINATION ./ COMPONENT libs) ++ DESTINATION ${OPENCV_OTHER_INSTALL_PATH} COMPONENT libs) + if(OPENCV_README_FILE) + install(FILES ${OPENCV_README_FILE} + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ +- DESTINATION ./ COMPONENT libs) ++ DESTINATION ${OPENCV_OTHER_INSTALL_PATH} COMPONENT libs) + endif() + endif() +