2018-07-19 17:56:54 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO libssh2/libssh2
|
2023-06-27 04:07:06 +08:00
|
|
|
REF "libssh2-${VERSION}"
|
2024-10-22 13:05:39 +08:00
|
|
|
SHA512 616efcd7f5c1fb1046104ebce70549e4756e2a55150efa2df5bb7123051d3bf336023cedcbfe932cd7c690a0b4d1f1a93c760ea39f1dba50c2b06d0945dca958
|
2018-07-19 17:56:54 +08:00
|
|
|
HEAD_REF master
|
2017-01-11 09:39:13 +08:00
|
|
|
)
|
2018-07-19 17:56:54 +08:00
|
|
|
|
2022-03-04 04:52:10 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
2023-07-12 02:18:41 +08:00
|
|
|
zlib ENABLE_ZLIB_COMPRESSION
|
|
|
|
INVERTED_FEATURES
|
|
|
|
zlib CMAKE_DISABLE_FIND_PACKAGE_ZLIB # for use by the cryto backend
|
2022-03-04 04:52:10 +08:00
|
|
|
)
|
2023-07-12 02:18:41 +08:00
|
|
|
if("openssl" IN_LIST FEATURES)
|
|
|
|
list(APPEND FEATURE_OPTIONS "-DCRYPTO_BACKEND=OpenSSL")
|
|
|
|
elseif(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
list(APPEND FEATURE_OPTIONS "-DCRYPTO_BACKEND=WinCNG")
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Port ${PORT} only supports OpenSSL and WinCNG crypto backends.")
|
|
|
|
endif()
|
2023-06-27 04:07:06 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
list(APPEND FEATURE_OPTIONS "-DBUILD_STATIC_LIBS:BOOL=OFF")
|
|
|
|
endif()
|
2022-03-04 04:52:10 +08:00
|
|
|
|
|
|
|
vcpkg_cmake_configure(
|
2021-10-12 01:26:07 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2016-12-06 21:33:43 +08:00
|
|
|
OPTIONS
|
|
|
|
-DBUILD_EXAMPLES=OFF
|
|
|
|
-DBUILD_TESTING=OFF
|
2022-03-04 04:52:10 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2016-12-06 21:33:43 +08:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DENABLE_DEBUG_LOGGING=OFF
|
2023-07-12 02:18:41 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
CMAKE_DISABLE_FIND_PACKAGE_ZLIB
|
2016-12-06 21:33:43 +08:00
|
|
|
)
|
|
|
|
|
2022-03-04 04:52:10 +08:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_copy_pdbs()
|
2023-06-27 04:07:06 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2022-03-04 04:52:10 +08:00
|
|
|
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libssh2)
|
|
|
|
|
|
|
|
if (VCPKG_TARGET_IS_WINDOWS)
|
2024-10-22 13:05:39 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libssh2.h" "defined(_WINDLL)" "1")
|
2022-03-04 04:52:10 +08:00
|
|
|
endif()
|
2023-07-12 02:18:41 +08:00
|
|
|
if(VCPKG_TARGET_STATIC_LIBRARY_PREFIX STREQUAL "")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libssh2.pc" " -lssh2" " -llibssh2")
|
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libssh2.pc" " -lssh2" " -llibssh2")
|
|
|
|
endif()
|
|
|
|
endif()
|
2022-03-04 04:52:10 +08:00
|
|
|
endif()
|
2016-12-06 21:33:43 +08:00
|
|
|
|
2021-10-12 01:26:07 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2022-03-12 05:03:36 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/man")
|
2016-12-06 21:33:43 +08:00
|
|
|
|
2023-06-27 04:07:06 +08:00
|
|
|
file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2022-03-04 04:52:10 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|