2019-09-09 20:31:43 +02:00
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO google/cityhash
|
|
|
|
REF 8af9b8c2b889d80c22d6bc26ba0df1afb79a30db
|
|
|
|
SHA512 5878a6a4f8ee99593412d446d96c05be1f89fa7771eca49ff4a52ce181de8199ba558170930996d36f6df80a65889d93c81ab2611868b015d8db913e2ecd2eb9
|
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
2021-10-28 14:10:49 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
2019-09-09 20:31:43 +02:00
|
|
|
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2021-10-28 14:10:49 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/config.h" DESTINATION "${SOURCE_PATH}/src")
|
2019-09-09 20:31:43 +02:00
|
|
|
else()
|
2021-10-28 14:10:49 +08:00
|
|
|
file(MAKE_DIRECTORY "${SOURCE_PATH}/out")
|
2019-09-09 20:31:43 +02:00
|
|
|
vcpkg_execute_required_process(
|
2021-10-28 14:10:49 +08:00
|
|
|
COMMAND "${SOURCE_PATH}/configure"
|
|
|
|
WORKING_DIRECTORY "${SOURCE_PATH}/out"
|
2019-09-09 20:31:43 +02:00
|
|
|
LOGNAME configure-${TARGET_TRIPLET}
|
|
|
|
)
|
2021-10-28 14:10:49 +08:00
|
|
|
file(COPY "${SOURCE_PATH}/out/config.h" DESTINATION "${SOURCE_PATH}/src")
|
2019-09-09 20:31:43 +02:00
|
|
|
endif()
|
|
|
|
|
2021-10-28 14:10:49 +08:00
|
|
|
if (VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND "sse" IN_LIST FEATURES)
|
|
|
|
message(FATAL_ERROR "Feature 'sse' does not support Windows x86 triplet.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
"sse" ENABLE_SSE
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_cmake_configure(
|
2019-09-09 20:31:43 +02:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2021-10-28 14:10:49 +08:00
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
2019-09-09 20:31:43 +02:00
|
|
|
)
|
|
|
|
|
2021-10-28 14:10:49 +08:00
|
|
|
vcpkg_cmake_install()
|
2019-09-09 20:31:43 +02:00
|
|
|
vcpkg_copy_pdbs()
|
2021-10-28 14:10:49 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH share/cmake/cityhash)
|
2019-09-09 20:31:43 +02:00
|
|
|
|
2021-10-28 14:10:49 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share")
|
2019-09-09 20:31:43 +02:00
|
|
|
|
2021-10-28 14:10:49 +08:00
|
|
|
configure_file("${SOURCE_PATH}/COPYING" "${CURRENT_PACKAGES_DIR}/share/cityhash/copyright" COPYONLY)
|