From c0838bf1f280250d63c2cf449018b7903eec21cd Mon Sep 17 00:00:00 2001 From: Vinayak Y B <89510107+Vinayak-YB@users.noreply.github.com> Date: Wed, 5 Jul 2023 18:10:02 +0530 Subject: [PATCH] Adding thirdparty libraries to vcpkg (#246) * thirdpart libs initial commit * Updated builder file * Updating other builder files * Changes in portfile, vcpkg baseline commit updated * vcpkg.json was changed in a prev commit fixing it * new changes in libraries * path update changes in vcpkg * vcpkg.json file changes in previous commit fixed * Fix for libmp4 windows build issue * Removing gstreamer dependency from aprapipes (#253) * initial commit * builder files changed to remove gstreamer * Removing gst based modules, other gstreamer files * small yml file fix --------- Co-authored-by: Vinayak Bhustali * thirdpart libs initial commit * Updated builder file * Updating other builder files * Changes in portfile, vcpkg baseline commit updated * vcpkg.json was changed in a prev commit fixing it * new changes in libraries * path update changes in vcpkg * vcpkg.json file changes in previous commit fixed * Fix for libmp4 windows build issue --------- Co-authored-by: Vinayak Bhustali --- .../workflows/build-test-lin-container.yml | 7 - .github/workflows/build-test-lin-wsl.yml | 9 -- .github/workflows/build-test-lin.yml | 6 - .github/workflows/build-test-win.yml | 6 - .gitmodules | 4 - base/CMakeLists.txt | 17 +-- base/vcpkg.json | 135 ++++++++++-------- thirdparty/libmp4 | 1 - vcpkg | 2 +- 9 files changed, 81 insertions(+), 106 deletions(-) delete mode 160000 thirdparty/libmp4 diff --git a/.github/workflows/build-test-lin-container.yml b/.github/workflows/build-test-lin-container.yml index ff11e42a6..0f582f352 100644 --- a/.github/workflows/build-test-lin-container.yml +++ b/.github/workflows/build-test-lin-container.yml @@ -138,15 +138,8 @@ jobs: with: path: | ${{ inputs.cache-path }} - ./thirdparty/libmp4/build key: ${{ inputs.flav }}-4-${{ hashFiles( 'base/vcpkg.json', 'vcpkg/baseline.json', 'submodule_ver.txt') }} restore-keys: ${{ inputs.flav }}- - - - - name: Build libmp4 when it is not cached - if: ${{ steps.cache-all.outputs.cache-hit != 'true' }} - working-directory: ${{github.workspace}}/thirdparty/libmp4 - run: ./build.cmd - name: Make build folder run: mkdir -p build diff --git a/.github/workflows/build-test-lin-wsl.yml b/.github/workflows/build-test-lin-wsl.yml index 4b7df4215..b373201c0 100644 --- a/.github/workflows/build-test-lin-wsl.yml +++ b/.github/workflows/build-test-lin-wsl.yml @@ -141,21 +141,12 @@ jobs: with: path: | ${{ inputs.cache-path }} - ./thirdparty/libmp4/build key: ${{ inputs.flav }}-4-${{ hashFiles( 'base/vcpkg.json', 'vcpkg/baseline.json', 'submodule_ver.txt') }} restore-keys: ${{ inputs.flav }}- - name: On WSL prep the thirdparty build scripts working-directory: ${{github.workspace}}/thirdparty run: | - (dos2unix libmp4/build.cmd) || true - chmod a+x libmp4/build.cmd - shell: wsl-bash {0} - - - name: Build libmp4 when it is not cached - if: ${{ steps.cache-all.outputs.cache-hit != 'true' }} - working-directory: ${{github.workspace}}/thirdparty/libmp4 - run: ./build.cmd shell: wsl-bash {0} - name: Make build folder diff --git a/.github/workflows/build-test-lin.yml b/.github/workflows/build-test-lin.yml index 378395282..c7de93584 100644 --- a/.github/workflows/build-test-lin.yml +++ b/.github/workflows/build-test-lin.yml @@ -134,15 +134,9 @@ jobs: with: path: | ${{ inputs.cache-path }} - ./thirdparty/libmp4/build key: ${{ inputs.flav }}-4-${{ hashFiles( 'base/vcpkg.json', 'vcpkg/baseline.json', 'submodule_ver.txt') }} restore-keys: ${{ inputs.flav }}- - - name: Build libmp4 when it is not cached - if: ${{ steps.cache-all.outputs.cache-hit != 'true' }} - working-directory: ${{github.workspace}}/thirdparty/libmp4 - run: ./build.cmd - - name: Make build folder run: mkdir -p build continue-on-error: true diff --git a/.github/workflows/build-test-win.yml b/.github/workflows/build-test-win.yml index 2bee05ebb..4bcc01d6a 100644 --- a/.github/workflows/build-test-win.yml +++ b/.github/workflows/build-test-win.yml @@ -137,14 +137,8 @@ jobs: with: path: | ${{ inputs.cache-path }} - ${{ github.workspace }}/thirdparty/libmp4/build/Release/mp4lib.lib key: ${{ inputs.flav }}-3-${{ hashFiles( 'base/vcpkg.json', 'vcpkg/baseline.json', 'submodule_ver.txt') }} restore-keys: ${{ inputs.flav }}- - - - name: Build libmp4 when it is not cached - if: ${{ steps.cache-all.outputs.cache-hit != 'true' }} - working-directory: ${{github.workspace}}/thirdparty/libmp4 - run: ./build.cmd && new-item build/Release -ItemType directory -Force && copy-item ./build/RelWithDebInfo/mp4lib.lib -Destination ./build/Release/ -Force - name: Make build folder run: mkdir -p build diff --git a/.gitmodules b/.gitmodules index a076b053a..5a9bc36cb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,3 @@ [submodule "vcpkg"] path = vcpkg url = https://github.com/Apra-Labs/vcpkg -[submodule "thirdparty/libmp4"] - path = thirdparty/libmp4 - url = https://github.com/Apra-Labs/libmp4.git - branch = forApraPipes diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt index 05a38c996..971b04372 100755 --- a/base/CMakeLists.txt +++ b/base/CMakeLists.txt @@ -34,19 +34,9 @@ set(CMAKE_CXX_STANDARD 14) project(APRAPIPES) -set ( LIBMP4_LIB_DIR "../thirdparty/libmp4/build/") -set ( LIBMP4_INC_DIR "../thirdparty/libmp4/include/") - -IF(ENABLE_WINDOWS) - set (LIBMP4_LIB_DIR "${CMAKE_SOURCE_DIR}/../thirdparty/libmp4/build/${CMAKE_BUILD_TYPE}") -ENDIF(ENABLE_WINDOWS) message(STATUS $ENV{PKG_CONFIG_PATH}">>>>>> PKG_CONFIG_PATH") -message(STATUS ${LIBMP4_LIB_DIR} ">>>>>> LIBMP4_LIB_DIR") -message(STATUS ${LIBMP4_INC_DIR} ">>>>>> LIBMP4_INC_DIR") -list(APPEND CMAKE_PREFIX_PATH ${LIBMP4_LIB_DIR}) -find_library(LIBMP4_LIB NAMES mp4lib.lib libmp4lib.a REQUIRED) find_package(PkgConfig REQUIRED) @@ -84,6 +74,8 @@ IF(ENABLE_CUDA) find_library(NVBUFUTILSLIB nvbuf_utils REQUIRED) find_library(EGLSTREAM_CAMCONSUMER_LIB nveglstream_camconsumer REQUIRED) find_library(NVARGUS_SOCKETCLINET_LIB nvargus_socketclient REQUIRED) + find_library(LIBRE_LIB NAMES libre.so libre.a REQUIRED) + find_library(BARESIP_LIB NAMES libbaresip.so REQUIRED) find_package(Curses REQUIRED) SET(JETSON_LIBS @@ -101,6 +93,8 @@ IF(ENABLE_CUDA) ELSEIF(ENABLE_LINUX) find_library(LIBNVCUVID libnvcuvid.so PATHS ../thirdparty/Video_Codec_SDK_10.0.26/Lib/linux/stubs/x86_64 NO_DEFAULT_PATH) find_library(LIBNVENCODE libnvidia-encode.so PATHS ../thirdparty/Video_Codec_SDK_10.0.26/Lib/linux/stubs/x86_64 NO_DEFAULT_PATH) + find_library(LIBRE_LIB NAMES libre.so libre.a REQUIRED) + find_library(BARESIP_LIB NAMES libbaresip.so REQUIRED) SET(NVCODEC_LIB ${LIBNVCUVID} ${LIBNVENCODE}) SET(NVCUDAToolkit_LIBS libcuda.so @@ -450,6 +444,8 @@ ${FFMPEG_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${LIBMP4_INC_DIR} +${BARESIP_INC_DIR} +${LIBRE_INC_DIR} ${NVCODEC_INCLUDE_DIR} ) @@ -570,6 +566,7 @@ ENDIF (ENABLE_CUDA) find_library(OPENH264_LIB NAMES openh264.lib libopenh264.a REQUIRED) +find_library(LIBMP4_LIB NAMES mp4lib.lib libmp4lib.a REQUIRED) target_link_libraries(aprapipesut aprapipes diff --git a/base/vcpkg.json b/base/vcpkg.json index 7a15be350..d68a86bb6 100644 --- a/base/vcpkg.json +++ b/base/vcpkg.json @@ -1,64 +1,75 @@ { - "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json", - "name": "apra-pipes-cuda", - "version": "0.0.1", - "builtin-baseline": "4e8ee452bcec49209042e7876800ec68e8477d14", - "dependencies": [ - { - "name": "opencv4", - "default-features": false, - "features": [ - "contrib", - "cuda", - "cudnn", - "dnn", - "jpeg", - "nonfree", - "png", - "tiff", - "webp" - ] - }, - "libjpeg-turbo", - "openh264", - "ffmpeg", - "bigint", - "boost-math", - "boost-system", - "boost-thread", - "boost-filesystem", - "boost-serialization", - "boost-log", - "boost-chrono", - "boost-test", - "boost-iostreams", - "boost-dll", - "nu-book-zxing-cpp", - "liblzma", - "bzip2", - "zlib", - "sfml", - { - "name": "glib", - "default-features": false, - "features": [ - "libmount" - ], - "platform": "(linux \u0026 x64)", - "$reason": "skip linux:arm64 and windows" - }, - { - "name": "glib", - "default-features": true, - "platform": "windows" - }, - { - "name": "hiredis", - "platform": "!arm64" - }, - { - "name": "redis-plus-plus", - "platform": "!arm64" - } + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json", + "name": "apra-pipes-cuda", + "version": "0.0.1", + "builtin-baseline": "b0053dfa8bbaabd1cfc602b27d3cf7295987a073", + "dependencies": [ + { + "name": "opencv4", + "default-features": false, + "features": [ + "contrib", + "cuda", + "cudnn", + "dnn", + "jpeg", + "nonfree", + "png", + "tiff", + "webp" + ] + }, + "libjpeg-turbo", + "openh264", + "ffmpeg", + "bigint", + "boost-math", + "boost-system", + "boost-thread", + "boost-filesystem", + "boost-serialization", + "boost-log", + "boost-chrono", + "boost-test", + "boost-iostreams", + "boost-dll", + "nu-book-zxing-cpp", + "liblzma", + "bzip2", + "zlib", + "sfml", + { + "name": "glib", + "default-features": false, + "features": [ + "libmount" + ], + "platform": "(linux \u0026 x64)", + "$reason": "skip linux:arm64 and windows" + }, + { + "name": "glib", + "default-features": true, + "platform": "windows" + }, + { + "name": "hiredis", + "platform": "!arm64" + }, + { + "name": "redis-plus-plus", + "platform": "!arm64" + }, + { + "name": "re", + "platform": "!windows" + }, + { + "name": "baresip", + "platform": "!windows" + }, + { + "name": "libmp4" + } ] -} \ No newline at end of file + } \ No newline at end of file diff --git a/thirdparty/libmp4 b/thirdparty/libmp4 deleted file mode 160000 index ae73a3b07..000000000 --- a/thirdparty/libmp4 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ae73a3b07a8b6d8015276a2d7a87158b67f4b334 diff --git a/vcpkg b/vcpkg index 4e8ee452b..b0053dfa8 160000 --- a/vcpkg +++ b/vcpkg @@ -1 +1 @@ -Subproject commit 4e8ee452bcec49209042e7876800ec68e8477d14 +Subproject commit b0053dfa8bbaabd1cfc602b27d3cf7295987a073