Skip to content

Commit

Permalink
[unrar] Add vcpkg-cmake-wrapper and usage (microsoft#23482)
Browse files Browse the repository at this point in the history
* [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 <[email protected]>
  • Loading branch information
LilyWangLL and Lily Wang authored Mar 16, 2022
1 parent 61f40a1 commit 5910146
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
22 changes: 22 additions & 0 deletions ports/unrar/Config.cmake.in
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions ports/unrar/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 2 additions & 1 deletion ports/unrar/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7138,7 +7138,7 @@
},
"unrar": {
"baseline": "5.8.1",
"port-version": 2
"port-version": 3
},
"upb": {
"baseline": "2021-10-19",
Expand Down
5 changes: 5 additions & 0 deletions versions/u-/unrar.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "d2ade299ed837817b3d02522f990af3a64cb938b",
"version": "5.8.1",
"port-version": 3
},
{
"git-tree": "4d39c9643a67338a3252672f3c5910891c6a87cd",
"version": "5.8.1",
Expand Down

0 comments on commit 5910146

Please sign in to comment.