vcpkg/ports/flecs/portfile.cmake

39 lines
1.2 KiB
CMake
Raw Normal View History

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO SanderMertens/flecs
REF "v${VERSION}"
2024-07-13 22:12:27 +08:00
SHA512 5208ff0e526531dce32f97723609375a900b32d0039a7701797325116a4dc755d9f1351ab3316bea6eb939897861d858342fa4728c419572d9c94b830f487ffc
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")