vcpkg/ports/flecs/portfile.cmake
MonicaLiu 5988576f00
[flecs] Update to 3.1.4. (#29275)
* update flecs

* update version

---------

Co-authored-by: MonicaLiu <v-liumonica@microsoft.com>
2023-01-30 17:02:51 -08:00

38 lines
1.1 KiB
CMake

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO SanderMertens/flecs
REF "v${VERSION}"
SHA512 06901a137ee4b6b1f6463ca6c35ec7271d21e138be08d3af8fbbf17d6e254242fadcc0e0d944de8ce1c89a6a2babe4e611142f227ef758c6e6b1f48db16740d8
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")