From 591014689f86f70e910fd2a638e9d399516194be Mon Sep 17 00:00:00 2001 From: LilyWangLL <94091114+LilyWangLL@users.noreply.github.com> Date: Wed, 16 Mar 2022 13:55:08 -0700 Subject: [PATCH] [unrar] Add vcpkg-cmake-wrapper and usage (#23482) * [unrar] Add vcpkg-cmake-wrapper and usage * update version * [unrar] Add Config.cmake * update version * Add license * update version * Remove usage * update version * Add unofficial * update version Co-authored-by: Lily Wang --- ports/unrar/Config.cmake.in | 22 ++++++++++++++++++++++ ports/unrar/portfile.cmake | 2 ++ ports/unrar/vcpkg.json | 3 ++- versions/baseline.json | 2 +- versions/u-/unrar.json | 5 +++++ 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 ports/unrar/Config.cmake.in diff --git a/ports/unrar/Config.cmake.in b/ports/unrar/Config.cmake.in new file mode 100644 index 0000000000..79add4e2fe --- /dev/null +++ b/ports/unrar/Config.cmake.in @@ -0,0 +1,22 @@ + +get_filename_component(_unrar_root "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_unrar_root "${_unrar_root}" PATH) +get_filename_component(_unrar_root "${_unrar_root}" PATH) + +set(_unrar_lib "${_unrar_root}/lib/unrar.lib") +if (EXISTS "${_unrar_lib}") + + add_library(unofficial::unrar::unrar INTERFACE IMPORTED) + set_target_properties(unofficial::unrar::unrar PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_unrar_root}/include") + set_target_properties(unofficial::unrar::unrar PROPERTIES IMPORTED_LOCATION "${_unrar_lib}") + set_property(TARGET unofficial::unrar::unrar APPEND PROPERTY IMPORTED_CONFIGURATIONS) + set(unrar_FOUND TRUE) + +else() + + set(unrar_FOUND FALSE) + +endif() +unset(_unrar_lib) + +unset(_unrar_root) diff --git a/ports/unrar/portfile.cmake b/ports/unrar/portfile.cmake index 05a22afeec..a7041a813b 100644 --- a/ports/unrar/portfile.cmake +++ b/ports/unrar/portfile.cmake @@ -36,5 +36,7 @@ file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/unrar.lib" DESTIN vcpkg_copy_pdbs() +configure_file("${CMAKE_CURRENT_LIST_DIR}/Config.cmake.in" "${CURRENT_PACKAGES_DIR}/share/unofficial-unrar/unofficial-unrar-config.cmake" @ONLY) + #COPYRIGHT file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/unrar/vcpkg.json b/ports/unrar/vcpkg.json index d76826ac3a..579dc62ea7 100644 --- a/ports/unrar/vcpkg.json +++ b/ports/unrar/vcpkg.json @@ -1,8 +1,9 @@ { "name": "unrar", "version": "5.8.1", - "port-version": 2, + "port-version": 3, "description": "rarlab's unrar library", "homepage": "https://www.rarlab.com", + "license": null, "supports": "windows & !uwp & !arm & !static" } diff --git a/versions/baseline.json b/versions/baseline.json index 8ffccbdf14..004a2cd9c1 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7138,7 +7138,7 @@ }, "unrar": { "baseline": "5.8.1", - "port-version": 2 + "port-version": 3 }, "upb": { "baseline": "2021-10-19", diff --git a/versions/u-/unrar.json b/versions/u-/unrar.json index 52998fbf95..0aa96d38a7 100644 --- a/versions/u-/unrar.json +++ b/versions/u-/unrar.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "d2ade299ed837817b3d02522f990af3a64cb938b", + "version": "5.8.1", + "port-version": 3 + }, { "git-tree": "4d39c9643a67338a3252672f3c5910891c6a87cd", "version": "5.8.1",