vcpkg/ports/abseil/portfile.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 eed36bfba04dbe8a08ec72e631c3b337e4f2db11
SHA512 250911ccca6f21fafbd636e1d45bff748c53e31d0867e8f04bd73b1fbb5ecd261aa9d8e6d07ff610d58daed1dbe14e67db48b1f32a4ce41b3ac0abdde4b14146
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)