vcpkg/ports/flecs/portfile.cmake
2024-11-11 00:16:33 -08:00

39 lines
1.2 KiB
CMake

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO SanderMertens/flecs
REF "v${VERSION}"
SHA512 da4986002e0b57619a349665fff0531053159b7c4775d1ba39b81095e9df91bc3ada7a3c7bf03f4ee1dadd0b5a1065bea2806c9fb9e8b51425662a67cb24b212
HEAD_REF master
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" FLECS_STATIC_LIBS)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" FLECS_SHARED_LIBS)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DFLECS_STATIC=${FLECS_STATIC_LIBS}
-DFLECS_SHARED=${FLECS_SHARED_LIBS}
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
if(FLECS_STATIC_LIBS)
vcpkg_replace_string(
"${CURRENT_PACKAGES_DIR}/include/${PORT}/bake_config.h"
"#ifndef flecs_STATIC"
"#if 0 // #ifndef flecs_STATIC"
)
endif()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")