diff --git a/ports/alsa/portfile.cmake b/ports/alsa/portfile.cmake index 81fa92c00f..bd1bd80946 100644 --- a/ports/alsa/portfile.cmake +++ b/ports/alsa/portfile.cmake @@ -57,6 +57,8 @@ vcpkg_configure_make( vcpkg_install_make() vcpkg_fixup_pkgconfig() +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share" diff --git a/ports/alsa/vcpkg-cmake-wrapper.cmake b/ports/alsa/vcpkg-cmake-wrapper.cmake new file mode 100644 index 0000000000..ae3b078abe --- /dev/null +++ b/ports/alsa/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,96 @@ +find_path( + ALSA_INCLUDE_DIR + NAMES alsa/asoundlib.h + PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" + NO_DEFAULT_PATH +) + +find_library( + ALSA_LIBRARY_DEBUG + NAMES asound + PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" + NO_DEFAULT_PATH +) + +find_library( + ALSA_LIBRARY_RELEASE + NAMES asound + PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" + NO_DEFAULT_PATH +) + +include(SelectLibraryConfigurations) +select_library_configurations(ALSA) +unset(ALSA_FOUND) + +if(NOT ALSA_INCLUDE_DIR OR NOT ALSA_LIBRARY) + message(FATAL_ERROR "Broken installation of the alsa vcpkg port") +endif() + +_find_package(${ARGS}) + +if(TARGET ALSA::ALSA) + if(ALSA_LIBRARY_DEBUG) + set_property( + TARGET ALSA::ALSA + APPEND + PROPERTY IMPORTED_CONFIGURATIONS DEBUG + ) + set_target_properties( + ALSA::ALSA + PROPERTIES + IMPORTED_LOCATION_DEBUG "${ALSA_LIBRARY_DEBUG}" + ) + endif() + if(ALSA_LIBRARY_RELEASE) + set_property( + TARGET ALSA::ALSA + APPEND + PROPERTY IMPORTED_CONFIGURATIONS RELEASE + ) + set_target_properties( + ALSA::ALSA + PROPERTIES + IMPORTED_LOCATION_RELEASE "${ALSA_LIBRARY_RELEASE}" + ) + endif() + + find_library(Z_VCPKG_HAS_LIBM NAMES m) + if(Z_VCPKG_HAS_LIBM) + list(APPEND ALSA_LIBRARIES m) + set_property( + TARGET ALSA::ALSA + APPEND + PROPERTY INTERFACE_LINK_LIBRARIES m + ) + endif() + + if(CMAKE_DL_LIBS) + list(APPEND ALSA_LIBRARIES ${CMAKE_DL_LIBS}) + set_property( + TARGET ALSA::ALSA + APPEND + PROPERTY INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS} + ) + endif() + + find_package(Threads) + if(TARGET Threads::Threads) + list(APPEND ALSA_LIBRARIES Threads::Threads) + set_property( + TARGET ALSA::ALSA + APPEND + PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads + ) + endif() + + find_library(Z_VCPKG_HAS_LIBRT NAMES rt) + if(Z_VCPKG_HAS_LIBRT) + list(APPEND ALSA_LIBRARIES rt) + set_property( + TARGET ALSA::ALSA + APPEND + PROPERTY INTERFACE_LINK_LIBRARIES rt + ) + endif() +endif() diff --git a/ports/alsa/vcpkg.json b/ports/alsa/vcpkg.json index 0c9d05d1f9..abd0244acc 100644 --- a/ports/alsa/vcpkg.json +++ b/ports/alsa/vcpkg.json @@ -1,6 +1,7 @@ { "name": "alsa", "version": "1.2.8", + "port-version": 1, "description": "The Advanced Linux Sound Architecture (ALSA) - library", "homepage": "https://www.alsa-project.org/", "license": "LGPL-2.1-or-later", diff --git a/versions/a-/alsa.json b/versions/a-/alsa.json index c6e315bd2d..6b89ccc12d 100644 --- a/versions/a-/alsa.json +++ b/versions/a-/alsa.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "18d67806b319dea0e3c2e9c921a1864901af1d22", + "version": "1.2.8", + "port-version": 1 + }, { "git-tree": "1e4f79a1681c6c40c4b500bf4c8c5d3746916bab", "version": "1.2.8", diff --git a/versions/baseline.json b/versions/baseline.json index d3adc472b1..413e5ce299 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -90,7 +90,7 @@ }, "alsa": { "baseline": "1.2.8", - "port-version": 0 + "port-version": 1 }, "amd-amf": { "baseline": "1.4.29",