vcpkg/ports/abseil/portfile.cmake
2019-01-09 12:27:19 -08:00

37 lines
1.2 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 389ec3f906f018661a5308458d623d01f96d7b23
SHA512 20d2cc8d23eb729607692d861049dccbd6b4af56fc4ed7733492348e3fe879d7acc6316f0d6e1c683f98188f028d460a40cab35667856cf334aa5f00fc830911
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 TARGET_PATH 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)