Repository navigation
Replies: 2 comments 1 reply
|
Possibly the same issue came up with libcurl, with this suggestion: curl/curl#11646 Does this patch make any improvement for you? (beware: untested, feel free to tweak): diff --git a/cmake/libssh2-config.cmake.in b/cmake/libssh2-config.cmake.in
index 84b98cb2..45d3919a 100644
--- a/cmake/libssh2-config.cmake.in
+++ b/cmake/libssh2-config.cmake.in
@@ -3,8 +3,5 @@
include("${CMAKE_CURRENT_LIST_DIR}/libssh2-targets.cmake")
-# Alias for either shared or static library
-add_library(libssh2::libssh2 ALIAS libssh2::@LIB_SELECTED@)
-
# Compatibility alias
add_library(Libssh2::libssh2 ALIAS libssh2::@LIB_SELECTED@)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index cae1f27b..5a954065 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -139,6 +139,9 @@ if(BUILD_SHARED_LIBS)
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>)
endif()
+# export libcurl alias as target name
+set_property(TARGET ${LIB_SELECTED} PROPERTY EXPORT_NAME "libssh2")
+
## Installation
install(FILES |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I have tried following the INSTALL_CMAKE.md guide for building and installing libssh2 on an Linux based system. The Readme file states that 'You still have to make libssh2 available on your system first. You can install it in the traditional way shown above...'
'cmake
cmake --build .
cmake --build . --target install'
Then using the prescribed way to find the libssh2 package on the system 'find_package(libssh2 REQUIRED CONFIG)', I run into the following error:
In the generated libssh2-targets.cmake the libssh2::libssh2_static imported target is not set to GLOBAL.

Is my usage described above(build and install on system using Cmake as described in the Readme) incorrect? Do I miss something?
NOTE:
All reactions