mirror of https://github.com/microsoft/vcpkg.git
76 lines
2.0 KiB
Diff
76 lines
2.0 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 9877cd7..5177904 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -42,8 +42,11 @@ macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source buil
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
|
|
|
# search for libraries
|
|
+set(PC_LIBS_PRIVATE "")
|
|
+set(PC_REQUIRES_PRIVATE "")
|
|
if (WITH_ZLIB)
|
|
find_package(ZLIB REQUIRED)
|
|
+ string(APPEND PC_REQUIRES_PRIVATE "zlib")
|
|
endif (WITH_ZLIB)
|
|
|
|
if (WITH_GCRYPT)
|
|
@@ -53,6 +56,7 @@ elseif(WITH_MBEDTLS)
|
|
find_package(MbedTLS REQUIRED)
|
|
else()
|
|
find_package(OpenSSL 1.1.1 REQUIRED)
|
|
+ string(APPEND PC_REQUIRES_PRIVATE " libcrypto")
|
|
endif()
|
|
|
|
if (UNIT_TESTING)
|
|
@@ -96,7 +100,7 @@ add_subdirectory(include)
|
|
add_subdirectory(src)
|
|
|
|
# pkg-config file
|
|
-if (UNIX OR MINGW)
|
|
+if (1)
|
|
configure_file(libssh.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc @ONLY)
|
|
install(
|
|
FILES
|
|
@@ -106,7 +110,7 @@ install(
|
|
COMPONENT
|
|
pkgconfig
|
|
)
|
|
-endif (UNIX OR MINGW)
|
|
+endif (1)
|
|
|
|
# CMake config files
|
|
include(CMakePackageConfigHelpers)
|
|
diff --git a/libssh.pc.cmake b/libssh.pc.cmake
|
|
index f288b94..759525c 100644
|
|
--- a/libssh.pc.cmake
|
|
+++ b/libssh.pc.cmake
|
|
@@ -7,4 +7,6 @@ Name: @PROJECT_NAME@
|
|
Description: The SSH Library
|
|
Version: @PROJECT_VERSION@
|
|
Libs: -L${libdir} -lssh
|
|
+Libs.private: @PC_LIBS_PRIVATE@
|
|
+Requires.private: @PC_REQUIRES_PRIVATE@
|
|
Cflags: -I${includedir}
|
|
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
|
index e0243bb..b17d9e2 100644
|
|
--- a/src/CMakeLists.txt
|
|
+++ b/src/CMakeLists.txt
|
|
@@ -54,6 +54,8 @@ if (MINGW AND Threads_FOUND)
|
|
${LIBSSH_LINK_LIBRARIES}
|
|
Threads::Threads
|
|
)
|
|
+ string(APPEND PC_LIBS_PRIVATE " ${CMAKE_THREAD_LIBS_INIT}")
|
|
+ set(PC_LIBS_PRIVATE "${PC_LIBS_PRIVATE}" PARENT_SCOPE)
|
|
endif()
|
|
|
|
# The ws2_32 needs to be last for mingw to build
|
|
@@ -64,6 +66,8 @@ if (WIN32)
|
|
iphlpapi
|
|
ws2_32
|
|
)
|
|
+ string(APPEND PC_LIBS_PRIVATE " -liphlpapi -lws2_32 -lshell32 -ladvapi32")
|
|
+ set(PC_LIBS_PRIVATE "${PC_LIBS_PRIVATE}" PARENT_SCOPE)
|
|
endif (WIN32)
|
|
|
|
if (BUILD_STATIC_LIB)
|