vcpkg/ports/cpu-features/portfile.cmake

44 lines
1.4 KiB
CMake
Raw Normal View History

2020-09-01 07:17:32 +08:00
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO google/cpu_features
REF "v${VERSION}"
SHA512 4e732f46b3b9efe48f0b6d06cfa87b3b25ed00e51c42de84c74cbbd4d66bd0974ff1a757b91574c6a3064cba6e5c2460117dd23b79b4136e5d1cd7e78dda47b1
2020-09-01 07:17:32 +08:00
HEAD_REF master
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools BUILD_EXECUTABLE
)
vcpkg_cmake_configure(
2020-09-01 07:17:32 +08:00
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
${FEATURE_OPTIONS}
-DBUILD_TESTING=OFF
2020-09-01 07:17:32 +08:00
)
vcpkg_cmake_install()
2020-09-01 07:17:32 +08:00
if(VCPKG_TARGET_IS_ANDROID)
vcpkg_cmake_config_fixup(PACKAGE_NAME "CpuFeatures" CONFIG_PATH "lib/cmake/CpuFeatures" DO_NOT_DELETE_PARENT_CONFIG_PATH)
vcpkg_cmake_config_fixup(PACKAGE_NAME "CpuFeaturesNdkCompat" CONFIG_PATH "lib/cmake/CpuFeaturesNdkCompat")
else()
vcpkg_cmake_config_fixup(PACKAGE_NAME "CpuFeatures" CONFIG_PATH "lib/cmake/CpuFeatures")
endif()
2020-09-01 07:17:32 +08:00
if("tools" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES "list_cpu_features" AUTO_CLEAN)
2020-09-01 07:17:32 +08:00
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
2020-09-01 07:17:32 +08:00
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
if(VCPKG_TARGET_IS_ANDROID)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage_android" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME "usage")
else()
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
endif()