vcpkg/ports/flecs/portfile.cmake

38 lines
1.1 KiB
CMake
Raw Normal View History

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO SanderMertens/flecs
REF "v${VERSION}"
2023-03-11 04:17:13 +08:00
SHA512 683a65f0187f65806b96557fa8230a082aec4d4c04922af906c60e780c6b59ac377944fa16c134f07555b6172aa47421738ff9482d7c7489d8c651f13c93abbc
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(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")