mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 08:19:10 +08:00
38 lines
1.3 KiB
CMake
38 lines
1.3 KiB
CMake
include(vcpkg_common_functions)
|
|
|
|
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
message(FATAL_ERROR "Abseil currently only supports being built for desktop")
|
|
endif()
|
|
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO abseil/abseil-cpp
|
|
REF 94f0f79ecd2d9e5271a21bc4ededea9b58c60674
|
|
SHA512 b1309a371b886e4d5d8e963407ddfcd005c041b35880e0af45f07c778875fb69c76f0a1ef7802af3f1eab3497fb40020d8d503c5eb2788fff50dd74b557bf182
|
|
HEAD_REF master
|
|
)
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
|
|
|
vcpkg_configure_cmake(
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
PREFER_NINJA
|
|
)
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-abseil)
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/abseil ${CURRENT_PACKAGES_DIR}/share/unofficial-abseil)
|
|
|
|
file(GLOB_RECURSE HEADERS ${CURRENT_PACKAGES_DIR}/include/*)
|
|
foreach(FILE ${HEADERS})
|
|
file(READ "${FILE}" _contents)
|
|
string(REPLACE "std::min(" "(std::min)(" _contents "${_contents}")
|
|
string(REPLACE "std::max(" "(std::max)(" _contents "${_contents}")
|
|
file(WRITE "${FILE}" "${_contents}")
|
|
endforeach()
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/abseil RENAME copyright)
|