vcpkg/ports/abseil/portfile.cmake
2018-07-03 21:44:16 -07: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 134496a31d8b324f762de3bee9a002658c984456
SHA512 40c506ab591528619686d81eaaa47171d24b03582cafe9dc8c5f6a5d4b20cb14c259098a9c7f80c73e9cf3a7d709830941e4e6df4da4c16a42c13902ff915c94
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)