2019-08-14 02:44:11 +08:00
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO nickbruun/hayai
|
|
|
|
REF 0234860c7a851362ab33efc6c018203cded3eb48
|
|
|
|
SHA512 e4c65d834eddaeb77e73a3bc24645a531b93d26e32ff1daffbe71c579b76b4b8b4865f6c7ea07b378cafbe2da3a698414d4135f28fc9821eef995ed78d0987f2
|
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
|
|
|
if(VCPKG_TARGET_IS_UWP)
|
|
|
|
set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
|
|
|
|
set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
|
|
|
|
endif()
|
|
|
|
|
2023-04-14 00:13:15 +08:00
|
|
|
vcpkg_cmake_configure(
|
2023-04-22 05:48:12 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-08-14 02:44:11 +08:00
|
|
|
OPTIONS
|
|
|
|
-DINSTALL_HAYAI=ON
|
|
|
|
-DBUILD_HAYAI_TESTS=OFF
|
|
|
|
-DBUILD_HAYAI_SAMPLES=OFF
|
|
|
|
)
|
|
|
|
|
2023-04-14 00:13:15 +08:00
|
|
|
vcpkg_cmake_install()
|
2019-08-14 02:44:11 +08:00
|
|
|
|
2023-04-22 05:48:12 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/CMake")
|
2023-04-14 00:13:15 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH CMake)
|
2023-04-22 05:48:12 +08:00
|
|
|
elseif(EXISTS "${CURRENT_PACKAGES_DIR}/lib/CMake/${PORT}")
|
2023-04-14 00:13:15 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/CMake/${PORT})
|
2019-08-14 02:44:11 +08:00
|
|
|
endif()
|
|
|
|
|
2023-04-22 05:48:12 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2019-08-14 02:44:11 +08:00
|
|
|
|
|
|
|
# Handle manual-link libraries
|
2023-04-22 05:48:12 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/hayai_main.lib")
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link")
|
2019-08-14 02:44:11 +08:00
|
|
|
file(RENAME
|
2023-04-22 05:48:12 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/lib/hayai_main.lib"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/hayai_main.lib"
|
2019-08-14 02:44:11 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_replace_string(
|
2023-04-22 05:48:12 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/share/${PORT}/hayai-targets-debug.cmake"
|
2019-08-14 02:44:11 +08:00
|
|
|
"\${CMAKE_CURRENT_LIST_DIR}/../../debug/lib/hayai_main.lib"
|
|
|
|
"\${CMAKE_CURRENT_LIST_DIR}/../../debug/lib/manual-link/hayai_main.lib"
|
2024-06-20 05:07:05 +08:00
|
|
|
IGNORE_UNCHANGED
|
2019-08-14 02:44:11 +08:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2023-04-22 05:48:12 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/hayai_main.lib")
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/manual-link")
|
2019-08-14 02:44:11 +08:00
|
|
|
file(RENAME
|
2023-04-22 05:48:12 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/lib/hayai_main.lib"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/lib/manual-link/hayai_main.lib"
|
2019-08-14 02:44:11 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_replace_string(
|
2023-04-22 05:48:12 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/share/${PORT}/hayai-targets-release.cmake"
|
2019-08-14 02:44:11 +08:00
|
|
|
"\${CMAKE_CURRENT_LIST_DIR}/../../lib/hayai_main.lib"
|
|
|
|
"\${CMAKE_CURRENT_LIST_DIR}/../../lib/manual-link/hayai_main.lib"
|
2024-06-20 05:07:05 +08:00
|
|
|
IGNORE_UNCHANGED
|
2019-08-14 02:44:11 +08:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Handle copyright
|
2023-04-22 05:48:12 +08:00
|
|
|
configure_file("${SOURCE_PATH}/LICENSE.md" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)
|