vcpkg/ports/miniupnpc/portfile.cmake

43 lines
1.6 KiB
CMake
Raw Normal View History

2023-09-06 13:35:09 +08:00
string(REPLACE "." "_" MINIUPNPC_VERSION "${VERSION}")
2018-11-15 16:28:43 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO miniupnp/miniupnp
2023-09-06 13:35:09 +08:00
REF "miniupnpc_${MINIUPNPC_VERSION}"
SHA512 575d6be8271c11bb48f95c7f0a7aed82619e9cb871a530d75a47867ef663807e888a6e66be0cd201f29ef3c7df860ee855481d464edb65881e83a6f16279ba76
2018-11-15 16:28:43 +08:00
HEAD_REF master
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" MINIUPNPC_BUILD_SHARED)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" MINIUPNPC_BUILD_STATIC)
2018-11-15 16:28:43 +08:00
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/miniupnpc"
2018-11-15 16:28:43 +08:00
OPTIONS
-DUPNPC_BUILD_STATIC=${MINIUPNPC_BUILD_STATIC}
-DUPNPC_BUILD_SHARED=${MINIUPNPC_BUILD_SHARED}
-DUPNPC_BUILD_TESTS=OFF
-DUPNPC_BUILD_SAMPLE=OFF
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
2018-11-15 16:28:43 +08:00
2023-09-06 13:35:09 +08:00
vcpkg_cmake_config_fixup(CONFIG_PATH "/lib/cmake/${PORT}")
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
2023-09-06 13:35:09 +08:00
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
else()
file(GLOB DEBUG_TOOLS "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe")
file(GLOB RELEASE_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe")
file(
INSTALL ${RELEASE_TOOLS}
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}"
)
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")
file(REMOVE ${DEBUG_TOOLS} ${RELEASE_TOOLS})
endif()
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")