vcpkg/ports/lzfse/portfile.cmake
Jack·Boos·Yu 8ead9c2674
[many ports]switch to vcpkg-cmake / vckg-cmake-config part 3 (#29883)
* [many ports]switch to vcpkg-cmake / vckg-cmake-config part 3

* version

* typo

* version

* typo

* version

* Fix params

* version

* deprecated vcpkg_extract_source_archive_ex

* version

* fix arguments

* version

* Rename argument

* version

* Deprecate vcpkg_extract_source_archive_ex

* version

---------

Co-authored-by: jyu49 <yu_jack@apple.com>
2023-03-07 14:14:52 -08:00

35 lines
1.0 KiB
CMake

if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
message(FATAL_ERROR "ARM build not supported")
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO lzfse/lzfse
REF lzfse-1.0
SHA512 9d7ca44e6d3d2bdf4b82b0eb66c14922369b8b6fe2cf891187a77c6708b8d26c2c1b2ccddec6059e85dbbbb37c497419549f02812b5f34d06238ac246a8cf912
HEAD_REF master
PATCHES
disable-cli-option.patch
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DLZFSE_DISABLE_TESTS=ON
-DLZFSE_DISABLE_CLI=ON)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(READ "${CURRENT_PACKAGES_DIR}/include/lzfse.h" LZFSE_H)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
string(REPLACE "defined(LZFSE_DLL)" "1" LZFSE_H "${LZFSE_H}")
else()
string(REPLACE "defined(LZFSE_DLL)" "0" LZFSE_H "${LZFSE_H}")
endif()
file(WRITE "${CURRENT_PACKAGES_DIR}/include/lzfse.h" "${LZFSE_H}")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)