Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-embedded/libftdi/files: libftdi-1.0-staticlibs.patch
Date: Fri, 01 Mar 2013 08:16:58
Message-Id: 20130301081655.7965A2171D@flycatcher.gentoo.org
1 vapier 13/03/01 08:16:55
2
3 Added: libftdi-1.0-staticlibs.patch
4 Log:
5 Version bump.
6
7 (Portage version: 2.2.0_alpha163/cvs/Linux x86_64, signed Manifest commit with key FB7C4156)
8
9 Revision Changes Path
10 1.1 dev-embedded/libftdi/files/libftdi-1.0-staticlibs.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-embedded/libftdi/files/libftdi-1.0-staticlibs.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-embedded/libftdi/files/libftdi-1.0-staticlibs.patch?rev=1.1&content-type=text/plain
14
15 Index: libftdi-1.0-staticlibs.patch
16 ===================================================================
17 make static libs optional. already sent upstream.
18
19 --- a/CMakeLists.txt
20 +++ b/CMakeLists.txt
21 @@ -46,6 +46,8 @@ set(CPACK_COMPONENT_SHAREDLIBS_GROUP "Development")
22 "Static library, good if you want to embed libftdi1 in your application.")
23 set(CPACK_COMPONENT_HEADERS_DESCRIPTION
24 "C/C++ header files.")
25 +
26 +option ( STATICLIBS "Build static libraries" ON )
27
28 set(CPACK_COMPONENT_SHAREDLIBS_GROUP "Development")
29 set(CPACK_COMPONENT_STATICLIBS_GROUP "Development")
30 --- a/ftdipp/CMakeLists.txt
31 +++ b/ftdipp/CMakeLists.txt
32 @@ -30,12 +30,16 @@ if (FTDIPP)
33 set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2)
34
35 # Static library
36 - add_library(ftdipp1-static STATIC ${cpp_sources})
37 - set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1")
38 + if (STATICLIBS)
39 + add_library(ftdipp1-static STATIC ${cpp_sources})
40 + set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1")
41 + endif (STATICLIBS)
42
43 # Prevent clobbering each other during the build
44 set_target_properties(ftdipp1 PROPERTIES CLEAN_DIRECT_OUTPUT 1)
45 - set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
46 + if (STATICLIBS)
47 + set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
48 + endif (STATICLIBS)
49
50 # Dependencies
51 target_link_libraries(ftdipp1 ftdi1 ${LIBUSB_LIBRARIES} ${BOOST_LIBRARIES})
52 @@ -46,10 +50,12 @@ if (FTDIPP)
53 LIBRARY DESTINATION lib${LIB_SUFFIX}
54 COMPONENT sharedlibs
55 )
56 - install( TARGETS ftdipp1-static
57 - ARCHIVE DESTINATION lib${LIB_SUFFIX}
58 - COMPONENT staticlibs
59 - )
60 + if (STATICLIBS)
61 + install( TARGETS ftdipp1-static
62 + ARCHIVE DESTINATION lib${LIB_SUFFIX}
63 + COMPONENT staticlibs
64 + )
65 + endif (STATICLIBS)
66 install( FILES ${cpp_headers}
67 DESTINATION include/${PROJECT_NAME}
68 COMPONENT headers
69 @@ -61,10 +67,12 @@ if (FTDIPP)
70 DESTINATION bin
71 COMPONENT sharedlibs
72 )
73 - install( TARGETS ftdipp1-static
74 - DESTINATION bin
75 - COMPONENT staticlibs
76 - )
77 + if (STATICLIBS)
78 + install( TARGETS ftdipp1-static
79 + DESTINATION bin
80 + COMPONENT staticlibs
81 + )
82 + endif (STATICLIBS)
83 install( FILES ${cpp_headers}
84 DESTINATION include/${PROJECT_NAME}
85 COMPONENT headers
86 --- a/src/CMakeLists.txt
87 +++ b/src/CMakeLists.txt
88 @@ -28,11 +28,15 @@ set_target_properties(ftdi1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}
89
90 # Static library
91 add_library(ftdi1-static STATIC ${c_sources})
92 -set_target_properties(ftdi1-static PROPERTIES OUTPUT_NAME "ftdi1")
93 +if (STATICLIBS)
94 + set_target_properties(ftdi1-static PROPERTIES OUTPUT_NAME "ftdi1")
95 +endif (STATICLIBS)
96
97 # Prevent clobbering each other during the build
98 set_target_properties(ftdi1 PROPERTIES CLEAN_DIRECT_OUTPUT 1)
99 -set_target_properties(ftdi1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
100 +if (STATICLIBS)
101 + set_target_properties(ftdi1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
102 +endif (STATICLIBS)
103
104 # Dependencies
105 target_link_libraries(ftdi1 ${LIBUSB_LIBRARIES})
106 @@ -45,10 +49,12 @@ if(${UNIX})
107 COMPONENT sharedlibs
108 )
109
110 - install( TARGETS ftdi1-static
111 - ARCHIVE DESTINATION lib${LIB_SUFFIX}
112 - COMPONENT staticlibs
113 - )
114 + if (STATICLIBS)
115 + install( TARGETS ftdi1-static
116 + ARCHIVE DESTINATION lib${LIB_SUFFIX}
117 + COMPONENT staticlibs
118 + )
119 + endif (STATICLIBS)
120
121 install( FILES ${c_headers}
122 DESTINATION include/${PROJECT_NAME}
123 @@ -64,10 +70,12 @@ if(${WIN32})
124 COMPONENT sharedlibs
125 )
126
127 - install( TARGETS ftdi1-static
128 - DESTINATION bin
129 - COMPONENT staticlibs
130 - )
131 + if (STATICLIBS)
132 + install( TARGETS ftdi1-static
133 + DESTINATION bin
134 + COMPONENT staticlibs
135 + )
136 + endif (STATICLIBS)
137
138 install( FILES ${c_headers}
139 DESTINATION include/${PROJECT_NAME}