aboutsummaryrefslogtreecommitdiff
path: root/ports/libssh/0001-export-pkgconfig-file.patch
blob: c84510ce58661d573ba2003e2917e2f4873f3f53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1f5b0bf5..c51fb0d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -111,8 +111,28 @@ add_subdirectory(include)
 add_subdirectory(src)
 
 # pkg-config file
-if (UNIX)
 configure_file(libssh.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc)
+  file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc "Requires:")
+  if (WITH_ZLIB)
+    file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " zlib")
+  endif ()
+  if (WITH_GCRYPT)
+    file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc "\nLibs.private: -lgcrypt")
+  elseif (WITH_MBEDTLS)
+    file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc "\nLibs.private: -lmbedcrypto -lpthread")
+  else ()
+    if (WIN32)
+      file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc "\nLibs.private: -llibcrypto -lUser32 -lCrypt32")
+    else ()
+      file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " libcrypto\nLibs.private:")
+    endif ()
+  endif ()
+  if (CMAKE_USE_PTHREADS_INIT)
+    file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " -lpthread")
+  endif ()
+  if (WIN32)
+    file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc " -lws2_32 -lShell32 -lAdvapi32")
+  endif ()
 install(
   FILES
     ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc
@@ -121,7 +141,6 @@ install(
   COMPONENT
     pkgconfig
 )
-endif (UNIX)
 
 # CMake config files
 include(CMakePackageConfigHelpers)