[cppfs] Add new port (#5571)

* [cppfs] Add new port

* [cppfs] Remove explicit libcrypto dependency

* [cppfs] Use vcpkg targets

* [cppfs] Don't use local find modules

* [cppfs] Disable arm64 and uwp

* [cppfs] Make portfile indentation consistent
This commit is contained in:
Connor Fitzgerald 2019-03-06 16:16:52 -05:00 committed by Victor Romero
parent f6f2def009
commit 40c1a2305c
3 changed files with 107 additions and 0 deletions

7
ports/cppfs/CONTROL Normal file
View File

@ -0,0 +1,7 @@
Source: cppfs
Version: 1.2.0
Description: Cross-platform C++ file system library supporting multiple backends
Feature: ssh
Description: SSH backend for cppfs
Build-Depends: libssh2,openssl,zlib

View File

@ -0,0 +1,53 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ea9fd15..af63d1e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,7 @@
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
# Include cmake modules
-list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+# list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(GenerateExportHeader)
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 @@
#
find_package(LibSSH2)
-find_package(LibCrypto)
+# find_package(LibCrypto)
find_package(ZLIB)
find_package(OpenSSL)
-if (LibSSH2_FOUND AND LibCrypto_FOUND AND ZLIB_FOUND AND OpenSSL_FOUND)
+if (LibSSH2_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}
if (OPTION_BUILD_SSH_BACKEND)
target_link_libraries(${target}
PRIVATE
- ${OPENSSL_LIBRARIES}
- ${LIBSSH2_LIBRARY}
- ${LIBCRYPTO_LIBRARY}
- ${ZLIB_LIBRARY}
+ Libssh2::libssh2
+ OpenSSL::SSL OpenSSL::Crypto
+ ZLIB::ZLIB
)
if("${CMAKE_SYSTEM_NAME}" MATCHES "Windows")

View File

@ -0,0 +1,47 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO cginternals/cppfs
REF v1.2.0
SHA512 2e831978dd87bd40d14e5b6f5089f3a962481d41959bfd62db543339d05e306315a1167c3bc06b372517357cc314f7d06ac19605f9a2d5b4edddc9a1f3fa8d03
HEAD_REF master
PATCHES
LibCrypto-fix.patch
)
if(${TARGET_TRIPLET} MATCHES "uwp")
message(FATAL_ERROR "cppfs does not support uwp")
endif()
set(SHARED_LIBS Off)
if(${VCPKG_LIBRARY_LINKAGE} STREQUAL "dynamic")
set(SHARED_LIBS On)
endif()
set(SSH_BACKEND OFF)
if("ssh" IN_LIST FEATURES)
set(SSH_BACKEND ON)
if("${VCPKG_TARGET_ARCHITECTURE}" STREQUAL "arm64")
message(FATAL_ERROR "SSH backend of cppfs does not support arm64.")
endif()
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DOPTION_BUILD_SSH_BACKEND=${SSH_BACKEND}
-DOPTION_BUILD_TESTS=Off
-DBUILD_SHARED_LIBS=${SHARED_LIBS}
-DOPTION_FORCE_SYSTEM_DIR_INSTALL=On
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cppfs RENAME copyright)
vcpkg_test_cmake(PACKAGE_NAME cppfs)