aboutsummaryrefslogtreecommitdiff
path: root/ports/libssh
diff options
context:
space:
mode:
authorGriffin Downs <35574547+grdowns@users.noreply.github.com>2019-04-12 02:30:59 -0700
committerGitHub <noreply@github.com>2019-04-12 02:30:59 -0700
commit0e000644053015b7f7a0985e14f0bd384c847d17 (patch)
tree7e456fd12b3bf281b28587338f1650017c8b32ab /ports/libssh
parent93ce6b4f27602cd18f4327c2cfd84093d472b8bb (diff)
parent39ba5b2b30c9f7b49e777a62093cdd49d05b53a9 (diff)
downloadvcpkg-0e000644053015b7f7a0985e14f0bd384c847d17.tar.gz
vcpkg-0e000644053015b7f7a0985e14f0bd384c847d17.zip
Merge branch 'master' into master
Diffstat (limited to 'ports/libssh')
-rw-r--r--ports/libssh/CONTROL8
-rw-r--r--ports/libssh/fix-config-cmake.patch77
-rw-r--r--ports/libssh/portfile.cmake13
-rw-r--r--ports/libssh/usage5
4 files changed, 99 insertions, 4 deletions
diff --git a/ports/libssh/CONTROL b/ports/libssh/CONTROL
index aff3dbdf1..9f652f461 100644
--- a/ports/libssh/CONTROL
+++ b/ports/libssh/CONTROL
@@ -1,4 +1,8 @@
Source: libssh
-Version: 0.7.6
+Version: 0.7.6-1
Description: libssh is a multiplatform C library implementing the SSHv2 and SSHv1 protocol on client and server side
-Build-Depends: zlib, openssl
+Build-Depends: openssl
+
+Feature: zlib
+Description: libssh with zlib
+Build-Depends: zlib
diff --git a/ports/libssh/fix-config-cmake.patch b/ports/libssh/fix-config-cmake.patch
new file mode 100644
index 000000000..bb369359f
--- /dev/null
+++ b/ports/libssh/fix-config-cmake.patch
@@ -0,0 +1,77 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a063556..68e559e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -11,6 +11,8 @@ set(APPLICATION_VERSION_MINOR "7")
+ set(APPLICATION_VERSION_PATCH "6")
+
+ set(APPLICATION_VERSION "${APPLICATION_VERSION_MAJOR}.${APPLICATION_VERSION_MINOR}.${APPLICATION_VERSION_PATCH}")
++set(CMAKE_INSTALL_DIR lib/cmake/libssh CACHE STRING
++ "The subdirectory where CMake package config files should be installed")
+
+ # SOVERSION scheme: CURRENT.AGE.REVISION
+ # If there was an incompatible interface change:
+@@ -114,14 +116,29 @@ endif (UNIX)
+ set(LIBSSH_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}ssh${CMAKE_SHARED_LIBRARY_SUFFIX})
+ set(LIBSSH_THREADS_LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}ssh${CMAKE_SHARED_LIBRARY_SUFFIX})
+
+-configure_file(${PROJECT_NAME}-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake @ONLY)
+-configure_file(${PROJECT_NAME}-config-version.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake @ONLY)
++include(CMakePackageConfigHelpers)
++configure_package_config_file(
++ ${PROJECT_NAME}-config.cmake.in
++ ${PROJECT_NAME}-config.cmake
++ INSTALL_DESTINATION ${CMAKE_INSTALL_DIR}
++ PATH_VARS
++ INCLUDE_INSTALL_DIR
++ CMAKE_INSTALL_DIR
++)
++configure_package_config_file(
++ ${PROJECT_NAME}-config-version.cmake.in
++ ${PROJECT_NAME}-config-version.cmake
++ INSTALL_DESTINATION ${CMAKE_INSTALL_DIR}
++ PATH_VARS
++ INCLUDE_INSTALL_DIR
++ CMAKE_INSTALL_DIR
++)
+ install(
+ FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
+ DESTINATION
+- ${CMAKE_INSTALL_DIR}/${PROJECT_NAME}
++ ${CMAKE_INSTALL_DIR}
+ COMPONENT
+ devel
+ )
+diff --git a/libssh-config.cmake.in b/libssh-config.cmake.in
+index fa9cecf..b17fdbd 100644
+--- a/libssh-config.cmake.in
++++ b/libssh-config.cmake.in
+@@ -1,13 +1,22 @@
+ get_filename_component(LIBSSH_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
++get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE)
+
+ if (EXISTS "${LIBSSH_CMAKE_DIR}/CMakeCache.txt")
+ # In build tree
+ include(${LIBSSH_CMAKE_DIR}/libssh-build-tree-settings.cmake)
+ else()
+- set(LIBSSH_INCLUDE_DIR @INCLUDE_INSTALL_DIR@)
++ set(LIBSSH_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include/")
++ set(LIBSSH_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include/")
+ endif()
+
+-set(LIBSSH_LIBRARY @LIB_INSTALL_DIR@/@LIBSSH_LIBRARY_NAME@)
+-set(LIBSSH_LIBRARIES @LIB_INSTALL_DIR@/@LIBSSH_LIBRARY_NAME@)
++if(CMAKE_BUILD_TYPE STREQUAL "Release")
++ set(LIBSSH_LIBRARY "${PACKAGE_PREFIX_DIR}/lib/ssh.lib")
++ set(LIBSSH_LIBRARIES "${PACKAGE_PREFIX_DIR}/lib/ssh.lib")
+
+-set(LIBSSH_THREADS_LIBRARY @LIB_INSTALL_DIR@/@LIBSSH_THREADS_LIBRARY_NAME@)
++ set(LIBSSH_THREADS_LIBRARY "${PACKAGE_PREFIX_DIR}/lib/ssh.lib")
++elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
++ set(LIBSSH_LIBRARY "${PACKAGE_PREFIX_DIR}/debug/lib/ssh.lib")
++ set(LIBSSH_LIBRARIES "${PACKAGE_PREFIX_DIR}/debug/lib/ssh.lib")
++
++ set(LIBSSH_THREADS_LIBRARY "${PACKAGE_PREFIX_DIR}/debug/lib/ssh.lib")
++endif()
diff --git a/ports/libssh/portfile.cmake b/ports/libssh/portfile.cmake
index 89d2af1fd..e137f823f 100644
--- a/ports/libssh/portfile.cmake
+++ b/ports/libssh/portfile.cmake
@@ -26,10 +26,17 @@ vcpkg_extract_source_archive_ex(
only-one-flavor-threads.patch
"${WINPATCH}"
missing-includes.patch
+ fix-config-cmake.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" WITH_STATIC_LIB)
+if(zlib IN_LIST FEATURES)
+ set(WITH_ZLIB ON)
+else()
+ set(WITH_ZLIB OFF)
+endif()
+
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
@@ -39,6 +46,8 @@ vcpkg_configure_cmake(
-DWITH_TESTING=OFF
-DWITH_NACL=OFF
-DWITH_GSSAPI=OFF
+ -DWITH_ZLIB=${WITH_ZLIB}
+ -DCMAKE_INSTALL_DIR=share/libssh
)
vcpkg_install_cmake()
@@ -62,7 +71,7 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/static ${CURRENT_PACKAGES_DIR}/d
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# The installed cmake config files are nonfunctional (0.7.5)
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake ${CURRENT_PACKAGES_DIR}/cmake)
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake ${CURRENT_PACKAGES_DIR}/lib/cmake)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libssh RENAME copyright)
+file(INSTALL ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/libssh) \ No newline at end of file
diff --git a/ports/libssh/usage b/ports/libssh/usage
new file mode 100644
index 000000000..3681ac112
--- /dev/null
+++ b/ports/libssh/usage
@@ -0,0 +1,5 @@
+The package libssh is compatible with built-in CMake targets:
+
+ find_package(libssh CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE ${LIBSSH_LIBRARIES})
+ target_include_directories(main PRIVATE ${LIBSSH_INCLUDE_DIRS})