[cppfs] Fix ssh dependendencies (#32286)

This commit is contained in:
Kai Pastor 2023-06-29 23:32:40 +02:00 committed by GitHub
parent a293ce5897
commit 20e22191dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 35 additions and 71 deletions

View File

@ -1,46 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ea9fd15..c62c6fd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -124,7 +124,7 @@ endif()
if((UNIX AND SYSTEM_DIR_INSTALL) OR OPTION_FORCE_SYSTEM_DIR_INSTALL)
# Install into the system (/usr/bin or /usr/local/bin)
set(INSTALL_ROOT "share/${project}") # /usr/[local]/share/<project>
- set(INSTALL_CMAKE "share/${project}/cmake") # /usr/[local]/share/<project>/cmake
+ set(INSTALL_CMAKE "share/${project}") # /usr/[local]/share/<project>
set(INSTALL_EXAMPLES "share/${project}") # /usr/[local]/share/<project>
set(INSTALL_DATA "share/${project}") # /usr/[local]/share/<project>
set(INSTALL_BIN "bin") # /usr/[local]/bin
@@ -183,7 +183,7 @@ add_subdirectory(deploy)
install(FILES "${PROJECT_BINARY_DIR}/VERSION" DESTINATION ${INSTALL_ROOT} COMPONENT runtime)
# Install cmake find script for the project
-install(FILES ${META_PROJECT_NAME}-config.cmake DESTINATION ${INSTALL_ROOT} COMPONENT dev)
+# install(FILES ${META_PROJECT_NAME}-config.cmake DESTINATION ${INSTALL_ROOT} COMPONENT dev)
# Install the project meta files
install(FILES AUTHORS DESTINATION ${INSTALL_ROOT} COMPONENT runtime)
diff --git a/source/cppfs/CMakeLists.txt b/source/cppfs/CMakeLists.txt
index aa37eda..e8a59e0 100644
--- a/source/cppfs/CMakeLists.txt
+++ b/source/cppfs/CMakeLists.txt
@@ -283,7 +283,7 @@ perform_health_checks(
# Library
install(TARGETS ${target}
- EXPORT "${target}-export" COMPONENT dev
+ EXPORT "${target}-config" COMPONENT dev
RUNTIME DESTINATION ${INSTALL_BIN} COMPONENT runtime
LIBRARY DESTINATION ${INSTALL_SHARED} COMPONENT runtime
ARCHIVE DESTINATION ${INSTALL_LIB} COMPONENT dev
@@ -302,8 +302,8 @@ install(DIRECTORY
)
# CMake config
-install(EXPORT ${target}-export
+install(EXPORT ${target}-config
NAMESPACE ${META_PROJECT_NAME}::
- DESTINATION ${INSTALL_CMAKE}/${target}
+ DESTINATION ${INSTALL_CMAKE}
COMPONENT dev
)

View File

@ -5,27 +5,41 @@ vcpkg_from_github(
SHA512 da1e09f79d9e65e7676784f47196645aabe1e1284f0ea5e48e845a244f5d49f5ea4b032f9e2e38c8e6a29657ebe636c9b1c9a4601c4bbc7637e7f592c52a8961
HEAD_REF master
PATCHES
LibCrypto-fix.patch
cmake-export-fix.patch
ssh-dependencies.diff
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
ssh OPTION_BUILD_SSH_BACKEND
ssh CMAKE_REQUIRE_FIND_PACKAGE_LibSSH2
ssh CMAKE_REQUIRE_FIND_PACKAGE_OpenSSL
ssh CMAKE_REQUIRE_FIND_PACKAGE_ZLIB
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DOPTION_BUILD_TESTS=Off
-DOPTION_FORCE_SYSTEM_DIR_INSTALL=On
-DCMAKE_DISABLE_FIND_PACKAGE_cppcheck=ON
-DCMAKE_DISABLE_FIND_PACKAGE_clang_tidy=ON
-DOPTION_BUILD_TESTS=OFF
-DOPTION_FORCE_SYSTEM_DIR_INSTALL=ON
${FEATURE_OPTIONS}
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup()
vcpkg_cmake_config_fixup(CONFIG_PATH "share/cppfs/cmake/cppfs")
# Overwriting original config
file(WRITE "${CURRENT_PACKAGES_DIR}/share/cppfs/cppfs-config.cmake" "
if(NOT \"${BUILD_SHARED_LIBS}\" AND \"${OPTION_BUILD_SSH_BACKEND}\")
include(CMakeFindDependencyMacro)
find_dependency(Libssh2 CONFIG)
find_dependency(OpenSSL)
find_dependency(ZLIB)
endif()
include(\"\${CMAKE_CURRENT_LIST_DIR}/cppfs-export.cmake\")
")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

View File

@ -15,29 +15,19 @@ diff --git a/source/cppfs/CMakeLists.txt b/source/cppfs/CMakeLists.txt
index aa37eda..d29176a 100644
--- a/source/cppfs/CMakeLists.txt
+++ b/source/cppfs/CMakeLists.txt
@@ -4,18 +4,18 @@
@@ -4,9 +4,9 @@
#
find_package(LibSSH2)
-find_package(LibSSH2)
-find_package(LibCrypto)
+# find_package(LibCrypto)
+find_package(LibSSH2 NAMES Libssh2)
find_package(ZLIB)
find_package(OpenSSL)
+set(LibCrypto_FOUND "${OpenSSL_FOUND}")
-if (LibSSH2_FOUND AND LibCrypto_FOUND AND ZLIB_FOUND AND OpenSSL_FOUND)
+if (LibSSH2_FOUND AND ZLIB_FOUND AND OpenSSL_FOUND)
if (LibSSH2_FOUND AND LibCrypto_FOUND AND ZLIB_FOUND AND OpenSSL_FOUND)
set(SSH_DEPS_MET TRUE)
else()
set(SSH_DEPS_MET FALSE)
endif()
if (OPTION_BUILD_SSH_BACKEND AND NOT SSH_DEPS_MET)
- message(FATAL_ERROR "Requested to build ssh module but not all dependencies are found! LibSSH2: ${LibSSH2_FOUND}, LibCrypto: ${LibCrypto_FOUND}, ZLIB: ${ZLIB_FOUND}, OpenSSL: ${OpenSSL_FOUND}")
+ message(FATAL_ERROR "Requested to build ssh module but not all dependencies are found! LibSSH2: ${LibSSH2_FOUND}, ZLIB: ${ZLIB_FOUND}, OpenSSL: ${OpenSSL_FOUND}")
endif()
@@ -207,10 +207,9 @@ target_link_libraries(${target}
@@ -207,10 +207,10 @@ target_link_libraries(${target}
if (OPTION_BUILD_SSH_BACKEND)
target_link_libraries(${target}
PRIVATE
@ -45,8 +35,9 @@ index aa37eda..d29176a 100644
- ${LIBSSH2_LIBRARY}
- ${LIBCRYPTO_LIBRARY}
- ${ZLIB_LIBRARY}
+ Libssh2::libssh2
+ OpenSSL::SSL OpenSSL::Crypto
+ OpenSSL::SSL
+ $<IF:$<TARGET_EXISTS:Libssh2::libssh2_shared>,Libssh2::libssh2_shared,Libssh2::libssh2_static>
+ OpenSSL::Crypto
+ ZLIB::ZLIB
)

View File

@ -1,7 +1,7 @@
{
"name": "cppfs",
"version": "1.3.0",
"port-version": 2,
"port-version": 3,
"description": "Cross-platform C++ file system library supporting multiple backends",
"license": "MIT",
"supports": "!uwp",

View File

@ -1798,7 +1798,7 @@
},
"cppfs": {
"baseline": "1.3.0",
"port-version": 2
"port-version": 3
},
"cppgraphqlgen": {
"baseline": "4.5.3",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "effae8e598d06cff2d1c7b0a084e6394ff1ee6ed",
"version": "1.3.0",
"port-version": 3
},
{
"git-tree": "d018bbc2767ee2fec0398bd1131e5ae70d1ad5cf",
"version": "1.3.0",