~ubuntu-branches/ubuntu/precise/libssh/precise

« back to all changes in this revision

Viewing changes to debian/patches/0001-rename-threads-static.patch

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Bigonville
  • Date: 2011-06-15 15:48:07 UTC
  • mfrom: (1.1.10 upstream) (4.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20110615154807-3muklcqfftr1vtch
Tags: 0.5.0-2
* debian/patches/0002-Check-for-NULL-pointers-in-string-c.patch:
  Consolidate patch (Should fix previous REJECT)
* Support multiarch spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 71fa0dc6bb5066e65e43aad90ac3be6219d8b67d Mon Sep 17 00:00:00 2001
 
2
From: Andreas Schneider <asn@cryptomilk.org>
 
3
Date: Wed, 01 Jun 2011 12:52:27 +0000
 
4
Subject: cmake: Fix static .lib overwriting on Windows.
 
5
 
 
6
(cherry picked from commit 1880ef54d2c97c60ce9a29676f0214814c20d57b)
 
7
---
 
8
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
 
9
index 2b47853..e158665 100644
 
10
--- a/src/CMakeLists.txt
 
11
+++ b/src/CMakeLists.txt
 
12
@@ -184,6 +184,11 @@ install(
 
13
 if (WITH_STATIC_LIB)
 
14
   add_library(${LIBSSH_STATIC_LIBRARY} STATIC ${libssh_SRCS})
 
15
 
 
16
+  if (MSVC)
 
17
+    set(OUTPUT_SUFFIX static)
 
18
+  else (MSVC)
 
19
+    set(OUTPUT_SUFFIX )
 
20
+  endif (MSVC)
 
21
   set_target_properties(
 
22
     ${LIBSSH_STATIC_LIBRARY}
 
23
       PROPERTIES
 
24
@@ -193,6 +198,8 @@ if (WITH_STATIC_LIB)
 
25
           ${LIBRARY_SOVERSION}
 
26
         OUTPUT_NAME
 
27
           ssh
 
28
+        ARCHIVE_OUTPUT_DIRECTORY
 
29
+          ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_SUFFIX}
 
30
   )
 
31
 
 
32
   if (WIN32)
 
33
@@ -208,7 +215,7 @@ if (WITH_STATIC_LIB)
 
34
     TARGETS
 
35
       ${LIBSSH_STATIC_LIBRARY}
 
36
     DESTINATION
 
37
-      ${LIB_INSTALL_DIR}
 
38
+      ${LIB_INSTALL_DIR}/${OUTPUT_SUFFIX}
 
39
     COMPONENT
 
40
       libraries
 
41
   )
 
42
diff --git a/src/threads/CMakeLists.txt b/src/threads/CMakeLists.txt
 
43
index 0373fee..b95525e 100644
 
44
--- a/src/threads/CMakeLists.txt
 
45
+++ b/src/threads/CMakeLists.txt
 
46
@@ -86,6 +86,12 @@ install(
 
47
 if (WITH_STATIC_LIB)
 
48
   add_library(${LIBSSH_THREADS_STATIC_LIBRARY} STATIC ${libssh_threads_SRCS})
 
49
 
 
50
+  if (MSVC)
 
51
+    set(OUTPUT_SUFFIX static)
 
52
+  else (MSVC)
 
53
+    set(OUTPUT_SUFFIX )
 
54
+  endif (MSVC)
 
55
+
 
56
   set_target_properties(
 
57
     ${LIBSSH_THREADS_STATIC_LIBRARY}
 
58
       PROPERTIES
 
59
@@ -93,15 +99,26 @@ if (WITH_STATIC_LIB)
 
60
           ${LIBRARY_VERSION}
 
61
         SOVERSION
 
62
           ${LIBRARY_SOVERSION}
 
63
-        COMPILE_FLAGS
 
64
-          "-DLIBSSH_STATIC"
 
65
+        OUTPUT_NAME
 
66
+          ssh_threads
 
67
+        ARCHIVE_OUTPUT_DIRECTORY
 
68
+          ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_SUFFIX}
 
69
+  )
 
70
+
 
71
+  if (WIN32)
 
72
+    set_target_properties(
 
73
+        ${LIBSSH_THREADS_STATIC_LIBRARY}
 
74
+            PROPERTIES
 
75
+                COMPILE_FLAGS
 
76
+                    "-DLIBSSH_STATIC"
 
77
   )
 
78
+  endif (WIN32)
 
79
 
 
80
   install(
 
81
     TARGETS
 
82
       ${LIBSSH_THREADS_STATIC_LIBRARY}
 
83
     DESTINATION
 
84
-      ${LIB_INSTALL_DIR}
 
85
+      ${LIB_INSTALL_DIR}/${OUTPUT_SUFFIX}
 
86
     COMPONENT
 
87
       libraries
 
88
   )
 
89
--
 
90
cgit v0.9