upgpkg: ocaml-integers 0.5.0-1
[arch-packages.git] / libupnp / repos / extra-x86_64 / libupnp-optional-static.patch
blobe2fe6a42add504792eb362727ce4a6ec51d7eb3b
1 diff --git a/CMakeLists.txt b/CMakeLists.txt
2 index 55653f12..d35b499d 100644
3 --- a/CMakeLists.txt
4 +++ b/CMakeLists.txt
5 @@ -95,6 +95,8 @@ if (WIN32)
6 set (STATIC_POSTFIX s)
7 endif()
9 +option (UPNP_BUILD_SHARED "Build shared libraries" ON)
10 +option (UPNP_BUILD_STATIC "Build static libraries" ON)
11 option (BUILD_TESTING "Run Tests after compile" ON)
13 if (BUILD_TESTING)
14 diff --git a/ixml/CMakeLists.txt b/ixml/CMakeLists.txt
15 index e33a561e..184f65d0 100644
16 --- a/ixml/CMakeLists.txt
17 +++ b/ixml/CMakeLists.txt
18 @@ -15,6 +15,7 @@ set (IXML_SOURCES
19 src/nodeList.c
22 +if (UPNP_BUILD_SHARED)
23 add_library (ixml_shared SHARED
24 ${IXML_SOURCES}
26 @@ -54,7 +55,9 @@ install (TARGETS ixml_shared
27 INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/upnp
28 PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/upnp
30 +endif()
32 +if (UPNP_BUILD_STATIC)
33 add_library (ixml_static STATIC
34 ${IXML_SOURCES}
36 @@ -93,6 +96,7 @@ install (TARGETS ixml_static
37 DESTINATION ${CMAKE_INSTALL_LIBDIR}
38 INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/upnp
40 +endif()
42 install (EXPORT IXML
43 DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/IXML
44 diff --git a/ixml/test/CMakeLists.txt b/ixml/test/CMakeLists.txt
45 index 7dea06eb..1241e856 100644
46 --- a/ixml/test/CMakeLists.txt
47 +++ b/ixml/test/CMakeLists.txt
48 @@ -2,6 +2,7 @@ FILE (GLOB XML_FILES
49 ${CMAKE_CURRENT_SOURCE_DIR}/testdata/*.xml
52 +if (UPNP_BUILD_SHARED)
53 ADD_EXECUTABLE (test-ixml-shared
54 test_document.c
56 @@ -17,7 +18,9 @@ ADD_TEST (NAME test-ixml
57 SET_TESTS_PROPERTIES (test-ixml PROPERTIES
58 ENVIRONMENT "PATH=$<TARGET_FILE_DIR:ixml_shared>\;%PATH%"
60 +endif()
62 +if (UPNP_BUILD_STATIC)
63 ADD_EXECUTABLE (test-ixml-static
64 test_document.c
66 @@ -29,3 +32,4 @@ TARGET_LINK_LIBRARIES (test-ixml-static
67 ADD_TEST (NAME test-ixml-static
68 COMMAND test-ixml-static ${XML_FILES}
70 +endif()
71 diff --git a/upnp/CMakeLists.txt b/upnp/CMakeLists.txt
72 index d10336f9..c9d19f8d 100644
73 --- a/upnp/CMakeLists.txt
74 +++ b/upnp/CMakeLists.txt
75 @@ -83,6 +83,7 @@ if (uuid)
77 endif()
79 +if (UPNP_BUILD_SHARED)
80 add_library (upnp_shared SHARED
81 ${UPNP_SOURCES}
83 @@ -182,7 +183,9 @@ install (TARGETS upnp_shared
84 INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/upnp
85 PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/upnp
87 +endif()
89 +if (UPNP_BUILD_STATIC)
90 add_library (upnp_static STATIC
91 ${UPNP_SOURCES}
93 @@ -233,6 +236,7 @@ install (TARGETS upnp_static
94 DESTINATION ${CMAKE_INSTALL_LIBDIR}
95 INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/upnp
97 +endif()
99 install (EXPORT UPNP
100 DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/UPNP
101 diff --git a/upnp/test/CMakeLists.txt b/upnp/test/CMakeLists.txt
102 index 741f9a57..745f2148 100644
103 --- a/upnp/test/CMakeLists.txt
104 +++ b/upnp/test/CMakeLists.txt
105 @@ -4,6 +4,7 @@ if (WIN32)
106 string (APPEND TEST_ENV "%PATH%")
107 endif()
109 +if (UPNP_BUILD_SHARED)
110 add_executable (test-upnp-init ${WIN_EXE}
111 test_init.c
113 @@ -23,7 +24,9 @@ add_test (NAME test-upnp-init
114 set_tests_properties (test-upnp-init PROPERTIES
115 ENVIRONMENT "${TEST_ENV}"
117 +endif()
119 +if (UPNP_BUILD_STATIC)
120 add_executable (test-upnp-init-static
121 test_init.c
123 @@ -39,7 +42,9 @@ target_compile_definitions (test-upnp-init-static
124 add_test (NAME test-upnp-init-static
125 COMMAND test-upnp-init-static
127 +endif()
129 +if (UPNP_BUILD_SHARED)
130 add_executable (test-upnp-list
131 test_list.c
133 @@ -55,7 +60,9 @@ set_tests_properties (test-upnp-list PROPERTIES
134 target_link_libraries (test-upnp-list
135 upnp_shared
137 +endif()
139 +if (UPNP_BUILD_STATIC)
140 add_executable (test-upnp-list-static
141 test_list.c
143 @@ -67,7 +74,9 @@ target_link_libraries (test-upnp-list-static
144 add_test (NAME test-upnp-list-static
145 COMMAND test-upnp-list-static
147 +endif()
149 +if (UPNP_BUILD_SHARED)
150 add_executable (test-upnp-log
151 test_log.c
153 @@ -87,7 +96,9 @@ add_test (NAME test-upnp-log
154 set_tests_properties (test-upnp-log PROPERTIES
155 ENVIRONMENT "${TEST_ENV}"
157 +endif()
159 +if (UPNP_BUILD_STATIC)
160 add_executable (test-upnp-log-static
161 test_log.c
163 @@ -103,7 +114,9 @@ target_link_libraries (test-upnp-log-static
164 add_test (NAME test-upnp-log-static
165 COMMAND test-upnp-log-static
167 +endif()
169 +if (UPNP_BUILD_SHARED)
170 add_executable (test-upnp-url
171 test_url.c
173 @@ -119,7 +132,9 @@ add_test (NAME test-upnp-url
174 set_tests_properties (test-upnp-url PROPERTIES
175 ENVIRONMENT "${TEST_ENV}"
177 +endif()
179 +if (UPNP_BUILD_STATIC)
180 add_executable (test-upnp-url-static
181 test_url.c
183 @@ -131,3 +146,4 @@ target_link_libraries (test-upnp-url-static
184 add_test (NAME test-upnp-url-static
185 COMMAND test-upnp-url-static
187 +endif()