mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 12:28:59 +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 bf7fc9986e20f664958fc227547fd8d2fdcf863e
|
|
SHA512 c80a1f850d40e2470db50dd0904730e615378fd1530e1bfef0908ec7ef7bf06ff7e1c6bbb1fe9aeb71e0f2df3fc2b7c516261d0521ff2822fd7f962a287b5718
|
|
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)
|