2022-07-13 02:08:08 +08:00
|
|
|
set(UNRAR_VERSION "6.1.7")
|
|
|
|
set(UNRAR_SHA512 b1a95358ff66b0e049597bbc4e1786d0bc909a8aff4aca94ee793d0d5a3c8b052eb347d88f44b6bc2e6231e777f1b711c198711118ae9ffbe8db2f72e7fbe846)
|
2017-08-22 13:21:54 +08:00
|
|
|
set(UNRAR_FILENAME unrarsrc-${UNRAR_VERSION}.tar.gz)
|
2019-09-09 23:59:05 +08:00
|
|
|
set(UNRAR_URL https://www.rarlab.com/rar/${UNRAR_FILENAME})
|
2017-08-22 13:21:54 +08:00
|
|
|
|
2019-05-03 13:57:43 +08:00
|
|
|
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
|
2017-08-22 13:21:54 +08:00
|
|
|
|
|
|
|
#SRC
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
|
|
|
URLS ${UNRAR_URL}
|
|
|
|
FILENAME ${UNRAR_FILENAME}
|
|
|
|
SHA512 ${UNRAR_SHA512}
|
|
|
|
)
|
2019-09-07 07:21:43 +08:00
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
REF ${UNRAR_VERSION}
|
|
|
|
PATCHES msbuild-use-default-sma.patch
|
|
|
|
)
|
2017-08-22 13:21:54 +08:00
|
|
|
|
|
|
|
vcpkg_build_msbuild(
|
|
|
|
PROJECT_PATH "${SOURCE_PATH}/UnRARDll.vcxproj"
|
|
|
|
OPTIONS_DEBUG /p:OutDir=../../${TARGET_TRIPLET}-dbg/
|
|
|
|
OPTIONS_RELEASE /p:OutDir=../../${TARGET_TRIPLET}-rel/
|
|
|
|
OPTIONS /VERBOSITY:Diagnostic /DETAILEDSUMMARY
|
|
|
|
)
|
|
|
|
|
|
|
|
#INCLUDE (named dll.hpp in source, and unrar.h in all rarlabs distributions)
|
2022-01-21 07:53:24 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/dll.hpp" DESTINATION "${CURRENT_PACKAGES_DIR}/include" RENAME unrar.h)
|
2017-08-22 13:21:54 +08:00
|
|
|
|
|
|
|
#DLL & LIB
|
2022-01-21 07:53:24 +08:00
|
|
|
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/unrar.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
|
|
|
|
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/unrar.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
|
|
|
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/unrar.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/unrar.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
2018-02-24 14:26:31 +08:00
|
|
|
|
2017-08-22 13:21:54 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2022-03-17 04:55:08 +08:00
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/Config.cmake.in" "${CURRENT_PACKAGES_DIR}/share/unofficial-unrar/unofficial-unrar-config.cmake" @ONLY)
|
|
|
|
|
2017-08-22 13:21:54 +08:00
|
|
|
#COPYRIGHT
|
2022-01-21 07:53:24 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|