From c7f3e5d50c7bd8393925e239fcd8340b3201cc79 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Thu, 9 Mar 2023 15:44:39 -0500 Subject: [PATCH 01/10] added cmake commands to copy dynamic libs to bin folder --- superbuild/CMakeLists.txt | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/superbuild/CMakeLists.txt b/superbuild/CMakeLists.txt index 4d3e23c..bc5c3f4 100644 --- a/superbuild/CMakeLists.txt +++ b/superbuild/CMakeLists.txt @@ -436,16 +436,41 @@ set_target_properties(${OpenCV_LIBS} PROPERTIES MAP_IMPORTED_CONFIG_RELWITHDEBIN if(OpenCV_FOUND) message(STATUS "OpenCV found ${_OpenCV_LIB_PATH}") message(STATUS "OpenCV found ${OpenCV_INSTALL_PATH}") + set(DEBUG_SUFFIX ${CMAKE_DEBUG_SUFFIX}) if(MSVC) message(STATUS "OpenCV for Windows Visual studio") - set(OPENCV_PATH ${_OpenCV_LIB_PATH} ) set(OPENCV_SUFIX "455" ) - set(DEBUG_SUFFIX ${CMAKE_DEBUG_SUFFIX}) + set(OPENCV_PATH ${_OpenCV_LIB_PATH} ) file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_videoio${OPENCV_SUFIX}${DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" ) file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_imgcodecs${OPENCV_SUFIX}${DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" ) file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_imgproc${OPENCV_SUFIX}${DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" ) file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_core${OPENCV_SUFIX}${DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" ) - endif() + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + message(STATUS "OpenCV for MacOS Clang++") + set(OPENCV_PATH ${OpenCV_INSTALL_PATH}/lib) + message(STATUS "OPENCV_PATH ${OPENCV_PATH}") + file(GLOB OPENCV_CORE_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_core*.dylib") + file(GLOB OPENCV_HIGHGUI_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_highgui*.dylib") + file(GLOB OPENCV_IMGCODECS_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_imgcodecs*.dylib") + file(GLOB OPENCV_IMGPROC_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_imgproc*.dylib") + file(GLOB OPENCV_ML_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_ml*.dylib") + file(GLOB OPENCV_VIDEOIO_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_videoio*.dylib") + file(GLOB OPENCV_VIDEO_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_video*.dylib") + file(GLOB LIBZ_DYNAMIC_LIBS "${OPENCV_PATH}/libz*") + file(GLOB GLEW_DYNAMIC_LIBS "${OPENCV_PATH}/libGLEW*.dylib") + message(STATUS "OPENCV_DYNAMIC_LIBS ${OPENCV_DYNAMIC_LIBS}") + file(COPY ${OPENCV_CORE_DYNAMIC_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) + file(COPY ${OPENCV_HIGHGUI_DYNAMIC_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) + file(COPY ${OPENCV_IMGCODECS_DYNAMIC_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) + file(COPY ${OPENCV_IMGPROC_DYNAMIC_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) + file(COPY ${OPENCV_ML_DYNAMIC_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) + file(COPY ${OPENCV_VIDEOIO_DYNAMIC_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) + file(COPY ${OPENCV_VIDEO_DYNAMIC_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) + file(COPY ${OPENCV_VIDEO_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) + file(COPY ${LIBZ_DYNAMIC_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) + file(COPY ${GLEW_DYNAMIC_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) + file(COPY "${OPENCV_PATH}/MinVR-2.0" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin") + endif() else() message(FATAL_ERROR "OpenCV NOT found ${_OpenCV_LIB_PATH}") endif() @@ -584,7 +609,6 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/install_${CMAKE_SYSTEM_NA set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/install_${CMAKE_SYSTEM_NAME}/lib) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/install_${CMAKE_SYSTEM_NAME}/bin) - add_executable(${PROJECT_NAME} ${source_files} ${header_files}) message(STATUS "CMAKE_DL_LIBS ${CMAKE_DL_LIBS}") From bc025712f0d1b767801bff4973ff0edd976b23c4 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Fri, 10 Mar 2023 14:24:42 -0500 Subject: [PATCH 02/10] add command to modify path to dynamic libs in executable --- .github/workflows/test-macos-release.yml | 58 ++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/test-macos-release.yml diff --git a/.github/workflows/test-macos-release.yml b/.github/workflows/test-macos-release.yml new file mode 100644 index 0000000..1215f4b --- /dev/null +++ b/.github/workflows/test-macos-release.yml @@ -0,0 +1,58 @@ +name: release-vr-volumeviewer + +on: workflow_dispatch + +env: + BUILD_TYPE: Release +jobs: + + build_mac: + + runs-on: macos-12 + steps: + - uses: actions/checkout@v2 + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.9 + with: + cmake-version: '3.20.3' + + - name: Clean superbuild folder + run: python3 superbuild/clean/clean.py + + - name: Open superbuild folder + run: cd superbuild + + - name: Configure CMake + run: | + cd superbuild + cmake -S . -B . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + - name: Build + run: | + cd superbuild + make + - name: Set path to dynamic libs + run: | + cd cd superbuild/install_Darwin/bin + install_name_tool -change @rpath/libGLEW.2.2.dylib @executable_path/libGLEW.2.2.dylib VR-Volumeviewer + install_name_tool -change @rpath/libopencv_highgui.405.dylib @executable_path/libopencv_highgui.405.dylib + install_name_tool -change @rpath/libopencv_highgui.405.dylib @executable_path/libopencv_highgui.405.dylib VR-Volumeviewer + install_name_tool -change @rpath/libopencv_ml.405.dylib @executable_path/libopencv_ml.405.dylib VR-Volumeviewer + install_name_tool -change @rpath/libopencv_photo.405.dylib @executable_path/libopencv_photo.405.dylib VR-Volumeviewer + install_name_tool -change @rpath/libopencv_video.405.dylib @executable_path/libopencv_video.405.dylib VR-Volumeviewer + install_name_tool -change @rpath/libopencv_videoio.405.dylib @executable_path/libopencv_videoio.405.dylib VR-Volumeviewer + install_name_tool -change libz.1.dylib @executable_path/libz.1.dylib VR-Volumeviewer + install_name_tool -change @rpath/libopencv_imgcodecs.405.dylib @executable_path/libopencv_imgcodecs.405.dylib VR-Volumeviewer + install_name_tool -change @rpath/libopencv_imgproc.405.dylib @executable_path/libopencv_imgproc.405.dylib VR-Volumeviewer + install_name_tool -change @rpath/libopencv_core.405.dylib @executable_path/libopencv_core.405.dylib VR-Volumeviewer + + - name: Zip bin folder + run: | + cd superbuild/install_Darwin + mv bin vr-volumeviewer + tar -a -c -f vr-volumeviewer-macos.zip ./vr-volumeviewer + - name: Upload app to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{github.workspace}}/superbuild/install_Darwin/vr-volumeviewer-macos.zip + tag: ${{ github.ref }} \ No newline at end of file From 1ee1c75c5acedca7e74af24572bfce013eaa3d0d Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Fri, 10 Mar 2023 15:16:59 -0500 Subject: [PATCH 03/10] changed workflow name --- .github/workflows/test-macos-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-macos-release.yml b/.github/workflows/test-macos-release.yml index 1215f4b..0e59a26 100644 --- a/.github/workflows/test-macos-release.yml +++ b/.github/workflows/test-macos-release.yml @@ -1,4 +1,4 @@ -name: release-vr-volumeviewer +name: test-macos-release on: workflow_dispatch From b7b74c2c430c279d6ae9b0e589849dd2f35f3aa3 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Fri, 10 Mar 2023 15:19:12 -0500 Subject: [PATCH 04/10] more work --- .github/workflows/test-macos-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-macos-release.yml b/.github/workflows/test-macos-release.yml index 0e59a26..693e7a1 100644 --- a/.github/workflows/test-macos-release.yml +++ b/.github/workflows/test-macos-release.yml @@ -1,6 +1,6 @@ name: test-macos-release -on: workflow_dispatch +on: pull_request env: BUILD_TYPE: Release From 6d877af91647788b1d30042c5fe3f709631b8a63 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Fri, 10 Mar 2023 15:20:23 -0500 Subject: [PATCH 05/10] added workflow dispatch --- .github/workflows/test-macos-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-macos-release.yml b/.github/workflows/test-macos-release.yml index 693e7a1..0e59a26 100644 --- a/.github/workflows/test-macos-release.yml +++ b/.github/workflows/test-macos-release.yml @@ -1,6 +1,6 @@ name: test-macos-release -on: pull_request +on: workflow_dispatch env: BUILD_TYPE: Release From 696c2617d905e90a29849ca32ff349c69cc95b70 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Fri, 10 Mar 2023 15:49:44 -0500 Subject: [PATCH 06/10] removing additional cd in command --- .github/workflows/test-macos-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-macos-release.yml b/.github/workflows/test-macos-release.yml index 0e59a26..62e73d9 100644 --- a/.github/workflows/test-macos-release.yml +++ b/.github/workflows/test-macos-release.yml @@ -32,7 +32,7 @@ jobs: make - name: Set path to dynamic libs run: | - cd cd superbuild/install_Darwin/bin + cd superbuild/install_Darwin/bin install_name_tool -change @rpath/libGLEW.2.2.dylib @executable_path/libGLEW.2.2.dylib VR-Volumeviewer install_name_tool -change @rpath/libopencv_highgui.405.dylib @executable_path/libopencv_highgui.405.dylib install_name_tool -change @rpath/libopencv_highgui.405.dylib @executable_path/libopencv_highgui.405.dylib VR-Volumeviewer From 280bd8748130beb18de30504f153380e7e6a1dda Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Fri, 10 Mar 2023 15:53:38 -0500 Subject: [PATCH 07/10] back to on pull_request action --- .github/workflows/test-macos-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-macos-release.yml b/.github/workflows/test-macos-release.yml index 62e73d9..5f6dbd6 100644 --- a/.github/workflows/test-macos-release.yml +++ b/.github/workflows/test-macos-release.yml @@ -1,6 +1,6 @@ name: test-macos-release -on: workflow_dispatch +on: pull_request env: BUILD_TYPE: Release From 9e04e535eb2b986143c7e0ac2859651e87b56595 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Fri, 10 Mar 2023 16:40:13 -0500 Subject: [PATCH 08/10] Update test-macos-release.yml deleted extra line on install_name_toll command --- .github/workflows/test-macos-release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-macos-release.yml b/.github/workflows/test-macos-release.yml index 5f6dbd6..dbb6ab9 100644 --- a/.github/workflows/test-macos-release.yml +++ b/.github/workflows/test-macos-release.yml @@ -33,8 +33,7 @@ jobs: - name: Set path to dynamic libs run: | cd superbuild/install_Darwin/bin - install_name_tool -change @rpath/libGLEW.2.2.dylib @executable_path/libGLEW.2.2.dylib VR-Volumeviewer - install_name_tool -change @rpath/libopencv_highgui.405.dylib @executable_path/libopencv_highgui.405.dylib + install_name_tool -change @rpath/libGLEW.2.2.dylib @executable_path/libGLEW.2.2.dylib VR-Volumeviewer install_name_tool -change @rpath/libopencv_highgui.405.dylib @executable_path/libopencv_highgui.405.dylib VR-Volumeviewer install_name_tool -change @rpath/libopencv_ml.405.dylib @executable_path/libopencv_ml.405.dylib VR-Volumeviewer install_name_tool -change @rpath/libopencv_photo.405.dylib @executable_path/libopencv_photo.405.dylib VR-Volumeviewer @@ -55,4 +54,4 @@ jobs: with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{github.workspace}}/superbuild/install_Darwin/vr-volumeviewer-macos.zip - tag: ${{ github.ref }} \ No newline at end of file + tag: ${{ github.ref }} From a33ab5ff84e14506a109b977e2275e7394dda941 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Mon, 13 Mar 2023 11:49:12 -0400 Subject: [PATCH 09/10] added copy coomand for libopencv photo --- superbuild/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/superbuild/CMakeLists.txt b/superbuild/CMakeLists.txt index 4602d7d..d044657 100644 --- a/superbuild/CMakeLists.txt +++ b/superbuild/CMakeLists.txt @@ -409,6 +409,7 @@ if(OpenCV_FOUND) file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_imgcodecs${OPENCV_SUFIX}${DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" ) file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_imgproc${OPENCV_SUFIX}${DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" ) file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_core${OPENCV_SUFIX}${DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" ) + file(COPY "${OPENCV_PATH}/${OPENCV_PREFIX}opencv_photo${OPENCV_SUFIX}${DEBUG_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin" ) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") message(STATUS "OpenCV for MacOS Clang++") set(OPENCV_PATH ${OpenCV_INSTALL_PATH}/lib) @@ -420,6 +421,7 @@ if(OpenCV_FOUND) file(GLOB OPENCV_ML_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_ml*.dylib") file(GLOB OPENCV_VIDEOIO_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_videoio*.dylib") file(GLOB OPENCV_VIDEO_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_video*.dylib") + file(GLOB OPENCV_VIDEO_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_photo*.dylib") file(GLOB LIBZ_DYNAMIC_LIBS "${OPENCV_PATH}/libz*") file(GLOB GLEW_DYNAMIC_LIBS "${OPENCV_PATH}/libGLEW*.dylib") message(STATUS "OPENCV_DYNAMIC_LIBS ${OPENCV_DYNAMIC_LIBS}") From 2a17d0176c4837666e1b2eabb6516b87db342854 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Mon, 13 Mar 2023 16:35:21 -0400 Subject: [PATCH 10/10] fixed missing coomand to copy libopencv video dynamic libs --- superbuild/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superbuild/CMakeLists.txt b/superbuild/CMakeLists.txt index d044657..8f69187 100644 --- a/superbuild/CMakeLists.txt +++ b/superbuild/CMakeLists.txt @@ -421,7 +421,7 @@ if(OpenCV_FOUND) file(GLOB OPENCV_ML_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_ml*.dylib") file(GLOB OPENCV_VIDEOIO_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_videoio*.dylib") file(GLOB OPENCV_VIDEO_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_video*.dylib") - file(GLOB OPENCV_VIDEO_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_photo*.dylib") + file(GLOB OPENCV_PHOTO_DYNAMIC_LIBS "${OPENCV_PATH}/libopencv_photo*.dylib") file(GLOB LIBZ_DYNAMIC_LIBS "${OPENCV_PATH}/libz*") file(GLOB GLEW_DYNAMIC_LIBS "${OPENCV_PATH}/libGLEW*.dylib") message(STATUS "OPENCV_DYNAMIC_LIBS ${OPENCV_DYNAMIC_LIBS}") @@ -432,7 +432,7 @@ if(OpenCV_FOUND) file(COPY ${OPENCV_ML_DYNAMIC_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) file(COPY ${OPENCV_VIDEOIO_DYNAMIC_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) file(COPY ${OPENCV_VIDEO_DYNAMIC_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) - file(COPY ${OPENCV_VIDEO_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) + file(COPY ${OPENCV_PHOTO_DYNAMIC_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) file(COPY ${LIBZ_DYNAMIC_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) file(COPY ${GLEW_DYNAMIC_LIBS} DESTINATION ${INSTALL_DIR_ABSOLUTE}/bin ) file(COPY "${OPENCV_PATH}/MinVR-2.0" DESTINATION "${INSTALL_DIR_ABSOLUTE}/bin")