diff --git a/ports/aubio/CMakeLists.txt b/ports/aubio/CMakeLists.txt index e352acb34b..b711c9f39c 100644 --- a/ports/aubio/CMakeLists.txt +++ b/ports/aubio/CMakeLists.txt @@ -83,19 +83,47 @@ if(BUILD_TOOLS AND WITH_DEPENDENCIES) endif() install( - TARGETS aubio + TARGETS aubio EXPORT AubioTargets + INCLUDES DESTINATION include RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) -if(NOT DISABLE_INSTALL_HEADERS) - install( - DIRECTORY src/ - DESTINATION include/aubio - FILES_MATCHING - PATTERN "*.h" - PATTERN "*_priv.h" EXCLUDE - PATTERN "config.h" EXCLUDE - ) +install(EXPORT AubioTargets NAMESPACE Aubio:: DESTINATION share/aubio) + +install( + DIRECTORY src/ + DESTINATION include/aubio + FILES_MATCHING + PATTERN "*.h" + PATTERN "*_priv.h" EXCLUDE + PATTERN "config.h" EXCLUDE +) + +# Create CMake configuration export file. +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AubioConfig.cmake.in "@PACKAGE_INIT@\n") +if(WITH_DEPENDENCIES) +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AubioConfig.cmake.in " + include(CMakeFindDependencyMacro) + find_dependency(FFMPEG COMPONENTS avcodec avutil avformat swresample REQUIRED) + find_dependency(BZip2 REQUIRED) + find_dependency(LibLZMA REQUIRED) + find_dependency(SndFile REQUIRED) + ") endif() +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AubioConfig.cmake.in "include(\${CMAKE_CURRENT_LIST_DIR}/AubioTargets.cmake)") + +# Install CMake configuration export file. +include(CMakePackageConfigHelpers) +configure_package_config_file( + ${CMAKE_CURRENT_BINARY_DIR}/AubioConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/AubioConfig.cmake + INSTALL_DESTINATION share/aubio +) +install( + FILES + ${CMAKE_BINARY_DIR}/AubioConfig.cmake + DESTINATION + share/aubio +) diff --git a/ports/aubio/portfile.cmake b/ports/aubio/portfile.cmake index 4cb7f7f6c9..e8d49dce4c 100644 --- a/ports/aubio/portfile.cmake +++ b/ports/aubio/portfile.cmake @@ -15,7 +15,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS tools WITH_DEPENDENCIES ) -vcpkg_configure_cmake( +vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS ${FEATURE_OPTIONS} @@ -23,10 +23,13 @@ vcpkg_configure_cmake( -DTOOLS_INSTALLDIR=tools/aubio -DBUILD_TOOLS=ON OPTIONS_DEBUG - -DDISABLE_INSTALL_HEADERS=1 -DBUILD_TOOLS=OFF ) -vcpkg_install_cmake() +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") # Handle copyright and credentials file(COPY diff --git a/ports/aubio/vcpkg.json b/ports/aubio/vcpkg.json index bb9e7eda59..dd977ac924 100644 --- a/ports/aubio/vcpkg.json +++ b/ports/aubio/vcpkg.json @@ -1,9 +1,19 @@ { "name": "aubio", "version-semver": "0.4.9", - "port-version": 6, + "port-version": 7, "description": "Aubio is a tool designed for the extraction of annotations from audio signals. Its features include segmenting a sound file before each of its attacks, performing pitch detection, tapping the beat and producing midi streams from live audio.", "homepage": "https://github.com/aubio/aubio", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], "default-features": [ "tools" ], diff --git a/versions/a-/aubio.json b/versions/a-/aubio.json index 488d8b81fe..540f6d7eaf 100644 --- a/versions/a-/aubio.json +++ b/versions/a-/aubio.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "b7115b787e5f71bf65454f4c3cff3ec85b4eb264", + "version-semver": "0.4.9", + "port-version": 7 + }, { "git-tree": "0abf18908332cd2ccfe8e298f8fd90c0db42dcd9", "version-semver": "0.4.9", diff --git a/versions/baseline.json b/versions/baseline.json index 4b795ac57a..3c8e19aa22 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -214,7 +214,7 @@ }, "aubio": { "baseline": "0.4.9", - "port-version": 6 + "port-version": 7 }, "audiofile": { "baseline": "1.0.7",