1 | cmake_minimum_required(VERSION 3.18)
|
---|
2 |
|
---|
3 | file(STRINGS "configure.ac" CONFIGURE_AC_LINES)
|
---|
4 | foreach(line ${CONFIGURE_AC_LINES})
|
---|
5 | if(line MATCHES [[^m4_define\(\[(MAJOR_VERSION|MINOR_VERSION|MICRO_VERSION)\],[ \t]*([0-9]+)\)$]])
|
---|
6 | set(LIBXML_${CMAKE_MATCH_1} ${CMAKE_MATCH_2})
|
---|
7 | elseif(line MATCHES "^(LIBXML_MAJOR_VERSION|LIBXML_MINOR_VERSION|LIBXML_MICRO_VERSION)=([0-9]+)$")
|
---|
8 | set(${CMAKE_MATCH_1} ${CMAKE_MATCH_2})
|
---|
9 | endif()
|
---|
10 | endforeach()
|
---|
11 | set(VERSION "${LIBXML_MAJOR_VERSION}.${LIBXML_MINOR_VERSION}.${LIBXML_MICRO_VERSION}")
|
---|
12 |
|
---|
13 | project(libxml2 VERSION ${VERSION} LANGUAGES C)
|
---|
14 |
|
---|
15 | include(CheckCSourceCompiles)
|
---|
16 | include(CheckFunctionExists)
|
---|
17 | include(CheckIncludeFiles)
|
---|
18 | include(CheckLibraryExists)
|
---|
19 | include(CheckLinkerFlag)
|
---|
20 | include(CheckStructHasMember)
|
---|
21 | include(CheckSymbolExists)
|
---|
22 | include(CMakePackageConfigHelpers)
|
---|
23 | include(FindPkgConfig)
|
---|
24 | include(GNUInstallDirs)
|
---|
25 |
|
---|
26 | option(BUILD_SHARED_LIBS "Build shared libraries" ON)
|
---|
27 | set(LIBXML2_WITH_AUTOMATA ON)
|
---|
28 | option(LIBXML2_WITH_C14N "Add the Canonicalization support" ON)
|
---|
29 | option(LIBXML2_WITH_CATALOG "Add the Catalog support" ON)
|
---|
30 | option(LIBXML2_WITH_DEBUG "Add the debugging module" ON)
|
---|
31 | set(LIBXML2_WITH_EXPR ON)
|
---|
32 | option(LIBXML2_WITH_FTP "Add the FTP support" OFF)
|
---|
33 | option(LIBXML2_WITH_HTML "Add the HTML support" ON)
|
---|
34 | option(LIBXML2_WITH_HTTP "Add the HTTP support" ON)
|
---|
35 | option(LIBXML2_WITH_ICONV "Add ICONV support" ON)
|
---|
36 | option(LIBXML2_WITH_ICU "Add ICU support" OFF)
|
---|
37 | option(LIBXML2_WITH_ISO8859X "Add ISO8859X support if no iconv" ON)
|
---|
38 | option(LIBXML2_WITH_LEGACY "Add deprecated APIs for compatibility" OFF)
|
---|
39 | option(LIBXML2_WITH_LZMA "Use liblzma" ON)
|
---|
40 | option(LIBXML2_WITH_MEM_DEBUG "Add the memory debugging module" OFF)
|
---|
41 | option(LIBXML2_WITH_MODULES "Add the dynamic modules support" ON)
|
---|
42 | option(LIBXML2_WITH_OUTPUT "Add the serialization support" ON)
|
---|
43 | option(LIBXML2_WITH_PATTERN "Add the xmlPattern selection interface" ON)
|
---|
44 | option(LIBXML2_WITH_PROGRAMS "Build programs" ON)
|
---|
45 | option(LIBXML2_WITH_PUSH "Add the PUSH parser interfaces" ON)
|
---|
46 | option(LIBXML2_WITH_PYTHON "Build Python bindings" ON)
|
---|
47 | option(LIBXML2_WITH_READER "Add the xmlReader parsing interface" ON)
|
---|
48 | option(LIBXML2_WITH_REGEXPS "Add Regular Expressions support" ON)
|
---|
49 | option(LIBXML2_WITH_SAX1 "Add the older SAX1 interface" ON)
|
---|
50 | option(LIBXML2_WITH_SCHEMAS "Add Relax-NG and Schemas support" ON)
|
---|
51 | option(LIBXML2_WITH_SCHEMATRON "Add Schematron support" ON)
|
---|
52 | option(LIBXML2_WITH_TESTS "Build tests" ON)
|
---|
53 | option(LIBXML2_WITH_THREADS "Add multithread support" ON)
|
---|
54 | option(LIBXML2_WITH_THREAD_ALLOC "Add per-thread memory" OFF)
|
---|
55 | option(LIBXML2_WITH_TLS "Enable thread-local storage" OFF)
|
---|
56 | option(LIBXML2_WITH_TREE "Add the DOM like tree manipulation APIs" ON)
|
---|
57 | set(LIBXML2_WITH_TRIO OFF)
|
---|
58 | set(LIBXML2_WITH_UNICODE ON)
|
---|
59 | option(LIBXML2_WITH_VALID "Add the DTD validation support" ON)
|
---|
60 | option(LIBXML2_WITH_WRITER "Add the xmlWriter saving interface" ON)
|
---|
61 | option(LIBXML2_WITH_XINCLUDE "Add the XInclude support" ON)
|
---|
62 | option(LIBXML2_WITH_XPATH "Add the XPATH support" ON)
|
---|
63 | option(LIBXML2_WITH_XPTR "Add the XPointer support" ON)
|
---|
64 | option(LIBXML2_WITH_XPTR_LOCS "Add support for XPointer locations" OFF)
|
---|
65 | option(LIBXML2_WITH_ZLIB "Use libz" ON)
|
---|
66 | set(LIBXML2_XMLCONF_WORKING_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Working directory for XML Conformance Test Suite")
|
---|
67 |
|
---|
68 | if(LIBXML2_WITH_PYTHON)
|
---|
69 | check_include_files(unistd.h HAVE_UNISTD_H)
|
---|
70 | check_symbol_exists(F_GETFL fcntl.h HAVE_F_GETFL)
|
---|
71 | find_package(Python COMPONENTS Interpreter Development REQUIRED)
|
---|
72 | #set(LIBXML2_PYTHON_INSTALL_DIR ${Python_SITEARCH} CACHE PATH "Python bindings install directory")
|
---|
73 | set(LIBXML2_PYTHON_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/python"
|
---|
74 | CACHE PATH "Python bindings install directory")
|
---|
75 | endif()
|
---|
76 |
|
---|
77 | foreach(VARIABLE IN ITEMS WITH_AUTOMATA WITH_C14N WITH_CATALOG WITH_DEBUG WITH_EXPR WITH_FTP WITH_HTML WITH_HTTP WITH_ICONV WITH_ICU WITH_ISO8859X WITH_LEGACY WITH_LZMA WITH_MEM_DEBUG WITH_MODULES WITH_OUTPUT WITH_PATTERN WITH_PUSH WITH_READER WITH_REGEXPS WITH_SAX1 WITH_SCHEMAS WITH_SCHEMATRON WITH_THREADS WITH_THREAD_ALLOC WITH_TREE WITH_TRIO WITH_UNICODE WITH_VALID WITH_WRITER WITH_XINCLUDE WITH_XPATH WITH_XPTR WITH_XPTR_LOCS WITH_ZLIB)
|
---|
78 | if(LIBXML2_${VARIABLE})
|
---|
79 | set(${VARIABLE} 1)
|
---|
80 | else()
|
---|
81 | set(${VARIABLE} 0)
|
---|
82 | endif()
|
---|
83 | endforeach()
|
---|
84 |
|
---|
85 | set(LIBXML_VERSION ${VERSION})
|
---|
86 | set(LIBXML_VERSION_EXTRA "")
|
---|
87 | math(EXPR LIBXML_VERSION_NUMBER "
|
---|
88 | ${LIBXML_MAJOR_VERSION} * 10000 +
|
---|
89 | ${LIBXML_MINOR_VERSION} * 100 +
|
---|
90 | ${LIBXML_MICRO_VERSION}
|
---|
91 | ")
|
---|
92 |
|
---|
93 | set(MODULE_EXTENSION "${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
---|
94 |
|
---|
95 | set(PACKAGE "libxml2")
|
---|
96 | set(PACKAGE_NAME "libxml2")
|
---|
97 | set(PACKAGE_STRING "libxml2 ${VERSION}")
|
---|
98 | set(PACKAGE_TARNAME "libxml2")
|
---|
99 | set(PACKAGE_URL "https://gitlab.gnome.org/GNOME/libxml2")
|
---|
100 | set(PACKAGE_VERSION ${VERSION})
|
---|
101 |
|
---|
102 | if(LIBXML2_WITH_ICONV)
|
---|
103 | find_package(Iconv REQUIRED)
|
---|
104 | endif()
|
---|
105 |
|
---|
106 | if(LIBXML2_WITH_ICU)
|
---|
107 | find_package(ICU REQUIRED COMPONENTS data i18n uc)
|
---|
108 | endif()
|
---|
109 |
|
---|
110 | if(LIBXML2_WITH_LZMA)
|
---|
111 | find_package(LibLZMA REQUIRED)
|
---|
112 | endif()
|
---|
113 |
|
---|
114 | if(LIBXML2_WITH_THREADS)
|
---|
115 | find_package(Threads REQUIRED)
|
---|
116 | set(THREAD_LIBS ${CMAKE_THREAD_LIBS_INIT})
|
---|
117 | list(APPEND CMAKE_REQUIRED_LIBRARIES Threads::Threads)
|
---|
118 | endif()
|
---|
119 |
|
---|
120 | if(LIBXML2_WITH_ZLIB)
|
---|
121 | find_package(ZLIB REQUIRED)
|
---|
122 | endif()
|
---|
123 |
|
---|
124 | if (NOT MSVC)
|
---|
125 | check_c_source_compiles("
|
---|
126 | void __attribute__((destructor))
|
---|
127 | f(void) {}
|
---|
128 | int main(void) { return 0; }
|
---|
129 | " HAVE_ATTRIBUTE_DESTRUCTOR)
|
---|
130 | if(HAVE_ATTRIBUTE_DESTRUCTOR)
|
---|
131 | set(ATTRIBUTE_DESTRUCTOR "__attribute__((destructor))")
|
---|
132 | endif()
|
---|
133 | check_include_files(arpa/inet.h HAVE_ARPA_INET_H)
|
---|
134 | check_function_exists(class HAVE_CLASS)
|
---|
135 | check_include_files(dlfcn.h HAVE_DLFCN_H)
|
---|
136 | check_library_exists(dl dlopen "" HAVE_DLOPEN)
|
---|
137 | check_include_files(dl.h HAVE_DL_H)
|
---|
138 | check_include_files(fcntl.h HAVE_FCNTL_H)
|
---|
139 | check_function_exists(fpclass HAVE_FPCLASS)
|
---|
140 | check_function_exists(ftime HAVE_FTIME)
|
---|
141 | check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
|
---|
142 | check_include_files(inttypes.h HAVE_INTTYPES_H)
|
---|
143 | check_function_exists(isascii HAVE_ISASCII)
|
---|
144 | check_library_exists(history append_history "" HAVE_LIBHISTORY)
|
---|
145 | check_library_exists(readline readline "" HAVE_LIBREADLINE)
|
---|
146 | check_function_exists(mmap HAVE_MMAP)
|
---|
147 | check_function_exists(munmap HAVE_MUNMAP)
|
---|
148 | check_include_files(netdb.h HAVE_NETDB_H)
|
---|
149 | check_include_files(netinet/in.h HAVE_NETINET_IN_H)
|
---|
150 | check_include_files(poll.h HAVE_POLL_H)
|
---|
151 | check_library_exists(dld shl_load "" HAVE_SHLLOAD)
|
---|
152 | check_function_exists(stat HAVE_STAT)
|
---|
153 | check_include_files(stdint.h HAVE_STDINT_H)
|
---|
154 | check_include_files(sys/mman.h HAVE_SYS_MMAN_H)
|
---|
155 | check_include_files(sys/select.h HAVE_SYS_SELECT_H)
|
---|
156 | check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
|
---|
157 | check_include_files(sys/stat.h HAVE_SYS_STAT_H)
|
---|
158 | check_include_files(sys/timeb.h HAVE_SYS_TIMEB_H)
|
---|
159 | check_include_files(sys/time.h HAVE_SYS_TIME_H)
|
---|
160 | check_include_files(unistd.h HAVE_UNISTD_H)
|
---|
161 | check_symbol_exists(va_copy stdarg.h HAVE_VA_COPY)
|
---|
162 | check_symbol_exists(__va_copy stdarg.h HAVE___VA_COPY)
|
---|
163 | check_c_source_compiles("
|
---|
164 | #include <stdarg.h>
|
---|
165 | void a(va_list* ap) {};
|
---|
166 | int main() { va_list ap1, ap2; a(&ap1); ap2 = (va_list) ap1; return 0; }
|
---|
167 | " VA_LIST_IS_ARRAY_TEST)
|
---|
168 | if(VA_LIST_IS_ARRAY_TEST)
|
---|
169 | set(VA_LIST_IS_ARRAY FALSE)
|
---|
170 | else()
|
---|
171 | set(VA_LIST_IS_ARRAY TRUE)
|
---|
172 | endif()
|
---|
173 | check_c_source_compiles("
|
---|
174 | #include <stddef.h>
|
---|
175 | #include <sys/socket.h>
|
---|
176 | int main() { (void) getsockopt(1, 1, 1, NULL, (socklen_t*) NULL); return 0; }
|
---|
177 | " XML_SOCKLEN_T_SOCKLEN_T)
|
---|
178 | if(XML_SOCKLEN_T_SOCKLEN_T)
|
---|
179 | set(XML_SOCKLEN_T socklen_t)
|
---|
180 | else()
|
---|
181 | check_c_source_compiles("
|
---|
182 | #include <stddef.h>
|
---|
183 | #include <sys/socket.h>
|
---|
184 | int main() { (void) getsockopt(1, 1, 1, NULL, (size_t*) NULL); return 0; }
|
---|
185 | " XML_SOCKLEN_T_SIZE_T)
|
---|
186 | if(XML_SOCKLEN_T_SIZE_T)
|
---|
187 | set(XML_SOCKLEN_T size_t)
|
---|
188 | else()
|
---|
189 | check_c_source_compiles("
|
---|
190 | #include <stddef.h>
|
---|
191 | #include <sys/socket.h>
|
---|
192 | int main() { (void) getsockopt (1, 1, 1, NULL, (int*) NULL); return 0; }
|
---|
193 | " XML_SOCKLEN_T_INT)
|
---|
194 | set(XML_SOCKLEN_T int)
|
---|
195 | endif()
|
---|
196 | endif()
|
---|
197 | endif()
|
---|
198 |
|
---|
199 | if(LIBXML2_WITH_TLS)
|
---|
200 | check_c_source_compiles(
|
---|
201 | "_Thread_local int v; int main(){return 0;}"
|
---|
202 | XML_THREAD_LOCAL_C11
|
---|
203 | )
|
---|
204 | if (XML_THREAD_LOCAL_C11)
|
---|
205 | set(XML_THREAD_LOCAL "_Thread_local")
|
---|
206 | else()
|
---|
207 | check_c_source_compiles(
|
---|
208 | "__thread int v; int main(){return 0;}"
|
---|
209 | XML_THREAD_LOCAL_THREAD
|
---|
210 | )
|
---|
211 | if (XML_THREAD_LOCAL_THREAD)
|
---|
212 | set(XML_THREAD_LOCAL "__thread")
|
---|
213 | else()
|
---|
214 | check_c_source_compiles(
|
---|
215 | "__declspec(thread) int v; int main(){return 0;}"
|
---|
216 | XML_THREAD_LOCAL_DECLSPEC
|
---|
217 | )
|
---|
218 | if (XML_THREAD_LOCAL_DECLSPEC)
|
---|
219 | set(XML_THREAD_LOCAL "__declspec(thread)")
|
---|
220 | endif()
|
---|
221 | endif()
|
---|
222 | endif()
|
---|
223 | endif()
|
---|
224 |
|
---|
225 | set(
|
---|
226 | LIBXML2_HDRS
|
---|
227 | include/libxml/c14n.h
|
---|
228 | include/libxml/catalog.h
|
---|
229 | include/libxml/chvalid.h
|
---|
230 | include/libxml/debugXML.h
|
---|
231 | include/libxml/dict.h
|
---|
232 | include/libxml/encoding.h
|
---|
233 | include/libxml/entities.h
|
---|
234 | include/libxml/globals.h
|
---|
235 | include/libxml/hash.h
|
---|
236 | include/libxml/HTMLparser.h
|
---|
237 | include/libxml/HTMLtree.h
|
---|
238 | include/libxml/list.h
|
---|
239 | include/libxml/nanoftp.h
|
---|
240 | include/libxml/nanohttp.h
|
---|
241 | include/libxml/parser.h
|
---|
242 | include/libxml/parserInternals.h
|
---|
243 | include/libxml/pattern.h
|
---|
244 | include/libxml/relaxng.h
|
---|
245 | include/libxml/SAX.h
|
---|
246 | include/libxml/SAX2.h
|
---|
247 | include/libxml/schemasInternals.h
|
---|
248 | include/libxml/schematron.h
|
---|
249 | include/libxml/threads.h
|
---|
250 | include/libxml/tree.h
|
---|
251 | include/libxml/uri.h
|
---|
252 | include/libxml/valid.h
|
---|
253 | include/libxml/xinclude.h
|
---|
254 | include/libxml/xlink.h
|
---|
255 | include/libxml/xmlIO.h
|
---|
256 | include/libxml/xmlautomata.h
|
---|
257 | include/libxml/xmlerror.h
|
---|
258 | include/libxml/xmlexports.h
|
---|
259 | include/libxml/xmlmemory.h
|
---|
260 | include/libxml/xmlmodule.h
|
---|
261 | include/libxml/xmlreader.h
|
---|
262 | include/libxml/xmlregexp.h
|
---|
263 | include/libxml/xmlsave.h
|
---|
264 | include/libxml/xmlschemas.h
|
---|
265 | include/libxml/xmlschemastypes.h
|
---|
266 | include/libxml/xmlstring.h
|
---|
267 | include/libxml/xmlunicode.h
|
---|
268 | include/libxml/xmlwriter.h
|
---|
269 | include/libxml/xpath.h
|
---|
270 | include/libxml/xpathInternals.h
|
---|
271 | include/libxml/xpointer.h
|
---|
272 | )
|
---|
273 |
|
---|
274 | set(
|
---|
275 | LIBXML2_SRCS
|
---|
276 | buf.c
|
---|
277 | c14n.c
|
---|
278 | catalog.c
|
---|
279 | chvalid.c
|
---|
280 | debugXML.c
|
---|
281 | dict.c
|
---|
282 | encoding.c
|
---|
283 | entities.c
|
---|
284 | error.c
|
---|
285 | globals.c
|
---|
286 | hash.c
|
---|
287 | HTMLparser.c
|
---|
288 | HTMLtree.c
|
---|
289 | legacy.c
|
---|
290 | list.c
|
---|
291 | nanoftp.c
|
---|
292 | nanohttp.c
|
---|
293 | parser.c
|
---|
294 | parserInternals.c
|
---|
295 | pattern.c
|
---|
296 | relaxng.c
|
---|
297 | SAX.c
|
---|
298 | SAX2.c
|
---|
299 | schematron.c
|
---|
300 | threads.c
|
---|
301 | tree.c
|
---|
302 | uri.c
|
---|
303 | valid.c
|
---|
304 | xinclude.c
|
---|
305 | xlink.c
|
---|
306 | xmlIO.c
|
---|
307 | xmlmemory.c
|
---|
308 | xmlmodule.c
|
---|
309 | xmlreader.c
|
---|
310 | xmlregexp.c
|
---|
311 | xmlsave.c
|
---|
312 | xmlschemas.c
|
---|
313 | xmlschemastypes.c
|
---|
314 | xmlstring.c
|
---|
315 | xmlunicode.c
|
---|
316 | xmlwriter.c
|
---|
317 | xpath.c
|
---|
318 | xpointer.c
|
---|
319 | xzlib.c
|
---|
320 | )
|
---|
321 |
|
---|
322 | if(WIN32)
|
---|
323 | list(APPEND LIBXML2_SRCS win32/libxml2.rc)
|
---|
324 | file(
|
---|
325 | WRITE
|
---|
326 | ${CMAKE_CURRENT_BINARY_DIR}/rcVersion.h
|
---|
327 | "#define LIBXML_MAJOR_VERSION ${LIBXML_MAJOR_VERSION}\n"
|
---|
328 | "#define LIBXML_MINOR_VERSION ${LIBXML_MINOR_VERSION}\n"
|
---|
329 | "#define LIBXML_MICRO_VERSION ${LIBXML_MICRO_VERSION}\n"
|
---|
330 | "#define LIBXML_DOTTED_VERSION \"${VERSION}\"\n"
|
---|
331 | )
|
---|
332 | endif()
|
---|
333 |
|
---|
334 | if(LIBXML2_WITH_TRIO)
|
---|
335 | list(APPEND LIBXML2_SRCS trio.c triostr.c)
|
---|
336 | endif()
|
---|
337 |
|
---|
338 | add_library(LibXml2 ${LIBXML2_HDRS} ${LIBXML2_SRCS})
|
---|
339 | add_library(LibXml2::LibXml2 ALIAS LibXml2)
|
---|
340 |
|
---|
341 | target_compile_definitions(LibXml2 PRIVATE SYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}")
|
---|
342 |
|
---|
343 | if(LIBXML2_WITH_THREADS)
|
---|
344 | target_compile_definitions(LibXml2 PRIVATE _REENTRANT)
|
---|
345 | if(NOT WIN32)
|
---|
346 | check_include_files(pthread.h HAVE_PTHREAD_H)
|
---|
347 | endif()
|
---|
348 | endif()
|
---|
349 |
|
---|
350 | target_include_directories(
|
---|
351 | LibXml2
|
---|
352 | PUBLIC
|
---|
353 | $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
---|
354 | $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
---|
355 | $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}/libxml2>
|
---|
356 | )
|
---|
357 |
|
---|
358 | if(LIBXML2_WITH_MODULES)
|
---|
359 | if(HAVE_DLOPEN)
|
---|
360 | target_link_libraries(LibXml2 PRIVATE dl)
|
---|
361 | set(MODULE_PLATFORM_LIBS "-ldl")
|
---|
362 | endif()
|
---|
363 |
|
---|
364 | if(HAVE_SHLLOAD)
|
---|
365 | target_link_libraries(LibXml2 PRIVATE dld)
|
---|
366 | set(MODULE_PLATFORM_LIBS "-ldld")
|
---|
367 | endif()
|
---|
368 | endif()
|
---|
369 |
|
---|
370 | if(UNIX)
|
---|
371 | target_link_libraries(LibXml2 PRIVATE m)
|
---|
372 | set(LIBM "-lm")
|
---|
373 | endif()
|
---|
374 |
|
---|
375 | if(WIN32)
|
---|
376 | target_link_libraries(LibXml2 PRIVATE ws2_32)
|
---|
377 | set(WINSOCK_LIBS "-lws2_32")
|
---|
378 | endif()
|
---|
379 |
|
---|
380 | if(LIBXML2_WITH_ICONV)
|
---|
381 | target_link_libraries(LibXml2 PUBLIC Iconv::Iconv)
|
---|
382 | if(NOT Iconv_IS_BUILT_IN)
|
---|
383 | set(ICONV_LIBS "-liconv")
|
---|
384 | endif()
|
---|
385 | endif()
|
---|
386 |
|
---|
387 | if(LIBXML2_WITH_ICU)
|
---|
388 | target_link_libraries(LibXml2 PRIVATE ICU::data ICU::i18n ICU::uc)
|
---|
389 | if(WIN32)
|
---|
390 | set(ICU_LDFLAGS "-licudt -licuin -licuuc")
|
---|
391 | else()
|
---|
392 | set(ICU_LDFLAGS "-licudata -licui18n -licuuc")
|
---|
393 | endif()
|
---|
394 | list(APPEND XML_PRIVATE_LIBS "${ICU_LDFLAGS}")
|
---|
395 | pkg_check_modules(ICU_PC IMPORTED_TARGET icu-i18n)
|
---|
396 | if(ICU_PC_FOUND)
|
---|
397 | list(APPEND XML_PC_REQUIRES icu-i18n)
|
---|
398 | else()
|
---|
399 | list(APPEND XML_PC_LIBS "${ICU_LDFLAGS}")
|
---|
400 | endif()
|
---|
401 | endif()
|
---|
402 |
|
---|
403 | if(LIBXML2_WITH_LZMA)
|
---|
404 | target_link_libraries(LibXml2 PRIVATE LibLZMA::LibLZMA)
|
---|
405 | set(LibLZMA_LDFLAGS "-llzma")
|
---|
406 | list(APPEND XML_PRIVATE_LIBS "${LibLZMA_LDFLAGS}")
|
---|
407 | pkg_check_modules(LibLZMA_PC IMPORTED_TARGET liblzma)
|
---|
408 | if(LibLZMA_PC_FOUND)
|
---|
409 | list(APPEND XML_PC_REQUIRES liblzma)
|
---|
410 | else()
|
---|
411 | list(APPEND XML_PC_LIBS "${LibLZMA_LDFLAGS}")
|
---|
412 | endif()
|
---|
413 | endif()
|
---|
414 |
|
---|
415 | if(LIBXML2_WITH_THREADS)
|
---|
416 | target_link_libraries(LibXml2 PRIVATE Threads::Threads)
|
---|
417 | endif()
|
---|
418 |
|
---|
419 | if(LIBXML2_WITH_ZLIB)
|
---|
420 | target_link_libraries(LibXml2 PRIVATE ZLIB::ZLIB)
|
---|
421 | set(ZLIB_LDFLAGS "-lz")
|
---|
422 | list(APPEND XML_PRIVATE_LIBS "${ZLIB_LDFLAGS}")
|
---|
423 | pkg_check_modules(ZLIB_PC IMPORTED_TARGET zlib)
|
---|
424 | if(ZLIB_PC_FOUND)
|
---|
425 | list(APPEND XML_PC_REQUIRES zlib)
|
---|
426 | else()
|
---|
427 | list(APPEND XML_PC_LIBS "${ZLIB_LDFLAGS}")
|
---|
428 | endif()
|
---|
429 | endif()
|
---|
430 |
|
---|
431 | if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
---|
432 | # These compiler flags can break the checks above so keep them here.
|
---|
433 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra -Wshadow \
|
---|
434 | -Wpointer-arith -Wcast-align -Wwrite-strings \
|
---|
435 | -Wstrict-prototypes -Wmissing-prototypes \
|
---|
436 | -Wno-long-long -Wno-format-extra-args")
|
---|
437 |
|
---|
438 | if(BUILD_SHARED_LIBS AND UNIX AND NOT APPLE)
|
---|
439 | check_linker_flag(C "LINKER:--undefined-version" FLAG_UNDEFINED_VERSION)
|
---|
440 | if (FLAG_UNDEFINED_VERSION)
|
---|
441 | target_link_options(LibXml2 PRIVATE "LINKER:--undefined-version")
|
---|
442 | endif()
|
---|
443 | target_link_options(LibXml2 PRIVATE "LINKER:--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libxml2.syms")
|
---|
444 | endif()
|
---|
445 | endif()
|
---|
446 |
|
---|
447 | set_target_properties(
|
---|
448 | LibXml2
|
---|
449 | PROPERTIES
|
---|
450 | IMPORT_PREFIX lib
|
---|
451 | OUTPUT_NAME xml2
|
---|
452 | POSITION_INDEPENDENT_CODE ON
|
---|
453 | PREFIX lib
|
---|
454 | VERSION ${PROJECT_VERSION}
|
---|
455 | SOVERSION ${LIBXML_MAJOR_VERSION}
|
---|
456 | )
|
---|
457 |
|
---|
458 | if(MSVC)
|
---|
459 | if(BUILD_SHARED_LIBS)
|
---|
460 | set_target_properties(
|
---|
461 | LibXml2
|
---|
462 | PROPERTIES
|
---|
463 | DEBUG_POSTFIX d
|
---|
464 | )
|
---|
465 | else()
|
---|
466 | set_target_properties(
|
---|
467 | LibXml2
|
---|
468 | PROPERTIES
|
---|
469 | DEBUG_POSTFIX sd
|
---|
470 | MINSIZEREL_POSTFIX s
|
---|
471 | RELEASE_POSTFIX s
|
---|
472 | RELWITHDEBINFO_POSTFIX s
|
---|
473 | )
|
---|
474 | endif()
|
---|
475 | endif()
|
---|
476 |
|
---|
477 | install(FILES ${LIBXML2_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development)
|
---|
478 |
|
---|
479 | install(
|
---|
480 | TARGETS LibXml2
|
---|
481 | EXPORT LibXml2
|
---|
482 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development
|
---|
483 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_COMPONENT development
|
---|
484 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime
|
---|
485 | )
|
---|
486 |
|
---|
487 | if(MSVC AND BUILD_SHARED_LIBS)
|
---|
488 | install(FILES $<TARGET_PDB_FILE:LibXml2> DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug)
|
---|
489 | endif()
|
---|
490 |
|
---|
491 | if(LIBXML2_WITH_PROGRAMS)
|
---|
492 | set(
|
---|
493 | PROGRAMS
|
---|
494 | xmlcatalog
|
---|
495 | xmllint
|
---|
496 | )
|
---|
497 | foreach(PROGRAM ${PROGRAMS})
|
---|
498 | add_executable(${PROGRAM} ${PROGRAM}.c)
|
---|
499 | add_executable(LibXml2::${PROGRAM} ALIAS ${PROGRAM})
|
---|
500 | target_compile_definitions(${PROGRAM} PRIVATE SYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}")
|
---|
501 | target_link_libraries(${PROGRAM} LibXml2)
|
---|
502 | if(HAVE_LIBHISTORY)
|
---|
503 | target_link_libraries(${PROGRAM} history)
|
---|
504 | endif()
|
---|
505 | if(HAVE_LIBREADLINE)
|
---|
506 | target_link_libraries(${PROGRAM} readline)
|
---|
507 | endif()
|
---|
508 | install(TARGETS ${PROGRAM} EXPORT LibXml2 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT programs)
|
---|
509 | endforeach()
|
---|
510 | endif()
|
---|
511 |
|
---|
512 | if(LIBXML2_WITH_TESTS)
|
---|
513 | enable_testing()
|
---|
514 | set(
|
---|
515 | TESTS
|
---|
516 | runtest
|
---|
517 | runxmlconf
|
---|
518 | runsuite
|
---|
519 | testapi
|
---|
520 | testchar
|
---|
521 | testdict
|
---|
522 | testModule
|
---|
523 | testlimits
|
---|
524 | testparser
|
---|
525 | testrecurse
|
---|
526 | testThreads
|
---|
527 | )
|
---|
528 | foreach(TEST ${TESTS})
|
---|
529 | add_executable(${TEST} ${TEST}.c)
|
---|
530 | target_compile_definitions(${TEST} PRIVATE SYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}")
|
---|
531 | target_link_libraries(${TEST} LibXml2)
|
---|
532 | endforeach()
|
---|
533 | if(Threads_FOUND)
|
---|
534 | foreach(TEST runtest testThreads)
|
---|
535 | target_link_libraries(${TEST} Threads::Threads)
|
---|
536 | endforeach()
|
---|
537 | endif()
|
---|
538 | add_test(NAME runtest COMMAND runtest --out ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
---|
539 | add_test(NAME runsuite COMMAND runsuite WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
---|
540 | if(EXISTS ${LIBXML2_XMLCONF_WORKING_DIR}/xmlconf/xmlconf.xml)
|
---|
541 | add_test(NAME runxmlconf COMMAND runxmlconf WORKING_DIRECTORY ${LIBXML2_XMLCONF_WORKING_DIR})
|
---|
542 | endif()
|
---|
543 | if(NOT WIN32)
|
---|
544 | add_test(NAME testapi COMMAND testapi)
|
---|
545 | endif()
|
---|
546 | add_test(NAME testchar COMMAND testchar)
|
---|
547 | add_test(NAME testdict COMMAND testdict)
|
---|
548 | add_test(NAME testparser COMMAND testparser)
|
---|
549 | add_test(NAME testrecurse COMMAND testrecurse WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
---|
550 | add_test(NAME testThreads COMMAND testThreads WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
---|
551 | endif()
|
---|
552 |
|
---|
553 | if(LIBXML2_WITH_PYTHON)
|
---|
554 | execute_process(
|
---|
555 | COMMAND
|
---|
556 | ${Python_EXECUTABLE}
|
---|
557 | ${CMAKE_CURRENT_SOURCE_DIR}/python/generator.py
|
---|
558 | ${CMAKE_CURRENT_SOURCE_DIR}/doc/libxml2-api.xml
|
---|
559 | ${CMAKE_CURRENT_SOURCE_DIR}/python/libxml2-python-api.xml
|
---|
560 | WORKING_DIRECTORY
|
---|
561 | ${CMAKE_CURRENT_BINARY_DIR}
|
---|
562 | )
|
---|
563 | file(READ python/libxml.py LIBXML_PY)
|
---|
564 | file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/libxml2.py.in "${LIBXML_PY}")
|
---|
565 | file(READ ${CMAKE_CURRENT_BINARY_DIR}/libxml2class.py LIBXML2CLASS_PY)
|
---|
566 | file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libxml2.py.in "${LIBXML2CLASS_PY}")
|
---|
567 | configure_file(${CMAKE_CURRENT_BINARY_DIR}/libxml2.py.in libxml2.py COPYONLY)
|
---|
568 | add_library(
|
---|
569 | LibXml2Mod
|
---|
570 | libxml2-py.c
|
---|
571 | libxml2-py.h
|
---|
572 | python/libxml.c
|
---|
573 | python/libxml_wrap.h
|
---|
574 | python/types.c
|
---|
575 | )
|
---|
576 | target_include_directories(
|
---|
577 | LibXml2Mod
|
---|
578 | PUBLIC
|
---|
579 | $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/python>
|
---|
580 | )
|
---|
581 | target_link_libraries(LibXml2Mod LibXml2 Python::Python)
|
---|
582 | set_target_properties(
|
---|
583 | LibXml2Mod
|
---|
584 | PROPERTIES
|
---|
585 | IMPORT_PREFIX lib
|
---|
586 | OUTPUT_NAME xml2mod
|
---|
587 | PREFIX lib
|
---|
588 | VERSION ${PROJECT_VERSION}
|
---|
589 | )
|
---|
590 | if (WIN32)
|
---|
591 | set_target_properties(LibXml2Mod PROPERTIES SUFFIX ".pyd")
|
---|
592 | endif()
|
---|
593 | install(
|
---|
594 | TARGETS LibXml2Mod
|
---|
595 | ARCHIVE DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT development
|
---|
596 | LIBRARY DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime NAMELINK_COMPONENT development
|
---|
597 | RUNTIME DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime
|
---|
598 | )
|
---|
599 | if(MSVC AND BUILD_SHARED_LIBS)
|
---|
600 | install(FILES $<TARGET_PDB_FILE:LibXml2Mod> DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug)
|
---|
601 | endif()
|
---|
602 | install(FILES python/drv_libxml2.py DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime)
|
---|
603 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml2.py DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime)
|
---|
604 | endif()
|
---|
605 |
|
---|
606 | install(FILES doc/xml2-config.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
|
---|
607 | install(FILES doc/xmlcatalog.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
|
---|
608 | install(FILES doc/xmllint.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
|
---|
609 | install(DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT documentation
|
---|
610 | PATTERN "Makefile.*" EXCLUDE
|
---|
611 | PATTERN "*.1" EXCLUDE
|
---|
612 | PATTERN "*.py" EXCLUDE
|
---|
613 | PATTERN "*.res" EXCLUDE
|
---|
614 | PATTERN "*.xml" EXCLUDE
|
---|
615 | PATTERN "*.xsl" EXCLUDE)
|
---|
616 |
|
---|
617 | configure_package_config_file(
|
---|
618 | libxml2-config.cmake.cmake.in libxml2-config.cmake
|
---|
619 | INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
|
---|
620 | )
|
---|
621 |
|
---|
622 | install(
|
---|
623 | FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml2-config.cmake
|
---|
624 | DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
|
---|
625 | COMPONENT development
|
---|
626 | )
|
---|
627 |
|
---|
628 | write_basic_package_version_file(
|
---|
629 | ${CMAKE_CURRENT_BINARY_DIR}/libxml2-config-version.cmake
|
---|
630 | VERSION ${PROJECT_VERSION}
|
---|
631 | COMPATIBILITY ExactVersion
|
---|
632 | )
|
---|
633 |
|
---|
634 | install(
|
---|
635 | FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml2-config-version.cmake
|
---|
636 | DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
|
---|
637 | COMPONENT development
|
---|
638 | )
|
---|
639 |
|
---|
640 | install(
|
---|
641 | EXPORT LibXml2
|
---|
642 | DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
|
---|
643 | NAMESPACE LibXml2::
|
---|
644 | FILE libxml2-export.cmake
|
---|
645 | COMPONENT development
|
---|
646 | )
|
---|
647 |
|
---|
648 | if(MSVC)
|
---|
649 | configure_file(include/win32config.h config.h COPYONLY)
|
---|
650 | else()
|
---|
651 | configure_file(config.h.cmake.in config.h)
|
---|
652 | endif()
|
---|
653 | configure_file(include/libxml/xmlversion.h.in libxml/xmlversion.h)
|
---|
654 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml/xmlversion.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development)
|
---|
655 |
|
---|
656 | if(LIBXML2_WITH_PYTHON)
|
---|
657 | set(prefix "${CMAKE_INSTALL_PREFIX}")
|
---|
658 | configure_file(python/setup.py.in setup.py @ONLY)
|
---|
659 | endif()
|
---|
660 |
|
---|
661 | set(NON_PC_LIBS "${THREAD_LIBS} ${ICONV_LIBS} ${LIBM} ${WINSOCK_LIBS}")
|
---|
662 | list(APPEND XML_PC_LIBS "${NON_PC_LIBS}")
|
---|
663 | list(APPEND XML_PRIVATE_LIBS "${NON_PC_LIBS}")
|
---|
664 | list(REMOVE_DUPLICATES XML_PC_LIBS)
|
---|
665 | list(REMOVE_DUPLICATES XML_PRIVATE_LIBS)
|
---|
666 |
|
---|
667 | list(JOIN XML_PC_REQUIRES " " XML_PC_REQUIRES)
|
---|
668 | list(JOIN XML_PC_LIBS " " XML_PC_LIBS)
|
---|
669 | list(JOIN XML_PRIVATE_LIBS " " XML_PRIVATE_LIBS)
|
---|
670 |
|
---|
671 | set(XML_INCLUDEDIR "-I\${includedir}/libxml2")
|
---|
672 | set(XML_LIBDIR "-L\${libdir}")
|
---|
673 | set(XML_LIBS "-lxml2")
|
---|
674 |
|
---|
675 | if(BUILD_SHARED_LIBS)
|
---|
676 | set(XML_PC_PRIVATE ".private")
|
---|
677 | set(XML_PC_LIBS_PRIVATE "
|
---|
678 | Libs.private:")
|
---|
679 | else()
|
---|
680 | target_compile_definitions(LibXml2 PUBLIC LIBXML_STATIC)
|
---|
681 | set(XML_CFLAGS "-DLIBXML_STATIC")
|
---|
682 | set(XML_PRIVATE_LIBS_NO_SHARED "${XML_PRIVATE_LIBS}")
|
---|
683 | endif()
|
---|
684 |
|
---|
685 | file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_PREFIX}")
|
---|
686 | string(REGEX REPLACE "/$" "" PACKAGE_RELATIVE_PATH "${PACKAGE_RELATIVE_PATH}")
|
---|
687 |
|
---|
688 | if(WIN32)
|
---|
689 | set(prefix "\${pcfiledir}/${PACKAGE_RELATIVE_PATH}")
|
---|
690 | else()
|
---|
691 | set(prefix "${CMAKE_INSTALL_PREFIX}")
|
---|
692 | endif()
|
---|
693 | set(exec_prefix "\${prefix}")
|
---|
694 | set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
|
---|
695 | set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
|
---|
696 | configure_file(libxml-2.0.pc.in libxml-2.0.pc @ONLY)
|
---|
697 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml-2.0.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT development)
|
---|
698 |
|
---|
699 | if(WIN32)
|
---|
700 | set(prefix "\$(cd \"\$(dirname \"\$0\")\"; pwd -P)/..")
|
---|
701 | endif()
|
---|
702 | configure_file(xml2-config.in xml2-config @ONLY)
|
---|
703 | install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/xml2-config DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT development)
|
---|
704 |
|
---|
705 | if(UNIX)
|
---|
706 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libxml.m4 DESTINATION ${CMAKE_INSTALL_DATADIR}/aclocal)
|
---|
707 | endif()
|
---|
708 |
|
---|
709 | set(XML_INCLUDEDIR "-I${CMAKE_INSTALL_FULL_INCLUDEDIR}/libxml2")
|
---|
710 | set(XML_LIBDIR "-L${CMAKE_INSTALL_FULL_LIBDIR}")
|
---|
711 |
|
---|
712 | set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime)
|
---|
713 | set(CPACK_COMPONENT_PROGRAMS_DEPENDS runtime)
|
---|
714 | set(CPACK_DEB_COMPONENT_INSTALL ON)
|
---|
715 | set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "${PACKAGE_TARNAME}")
|
---|
716 | set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "${PACKAGE_TARNAME}-dev")
|
---|
717 | set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_SECTION "libdevel")
|
---|
718 | set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${PACKAGE_URL})
|
---|
719 | set(CPACK_DEBIAN_PACKAGE_NAME ${PACKAGE_TARNAME})
|
---|
720 | set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
|
---|
721 | set(CPACK_DEBIAN_PROGRAMS_PACKAGE_DEPENDS "${PACKAGE_TARNAME}")
|
---|
722 | set(CPACK_DEBIAN_PROGRAMS_PACKAGE_NAME "${PACKAGE_TARNAME}-utils")
|
---|
723 | set(CPACK_DEBIAN_PROGRAMS_PACKAGE_SECTION "utils")
|
---|
724 | set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME ${PACKAGE_TARNAME})
|
---|
725 | set(CPACK_DEBIAN_RUNTIME_PACKAGE_RECOMMENDS "${PACKAGE_TARNAME}-utils")
|
---|
726 | set(CPACK_DEBIAN_RUNTIME_PACKAGE_SECTION "libs")
|
---|
727 | set(CPACK_NSIS_PACKAGE_NAME ${PACKAGE_STRING})
|
---|
728 | set(CPACK_NSIS_URL_INFO_ABOUT ${PACKAGE_URL})
|
---|
729 | set(CPACK_PACKAGE_DISPLAY_NAME ${PACKAGE_STRING})
|
---|
730 | set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PACKAGE_TARNAME}-${PACKAGE_VERSION}")
|
---|
731 | set(CPACK_PACKAGE_NAME ${PACKAGE_TARNAME})
|
---|
732 | set(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION})
|
---|
733 | set(CPACK_PACKAGE_VERSION_MAJOR ${LIBXML_MAJOR_VERSION})
|
---|
734 | set(CPACK_PACKAGE_VERSION_MINOR ${LIBXML_MINOR_VERSION})
|
---|
735 | set(CPACK_PACKAGE_VERSION_PATCH ${LIBXML_MICRO_VERSION})
|
---|
736 | set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/Copyright)
|
---|
737 | set(CPACK_RPM_COMPONENT_INSTALL ON)
|
---|
738 | set(CPACK_RPM_development_PACKAGE_NAME "${PACKAGE_NAME}-devel")
|
---|
739 | set(CPACK_RPM_development_PACKAGE_REQUIRES "${PACKAGE_NAME}")
|
---|
740 | set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
|
---|
741 | set(CPACK_RPM_PACKAGE_NAME ${PACKAGE_TARNAME})
|
---|
742 | set(CPACK_RPM_PACKAGE_URL ${PACKAGE_URL})
|
---|
743 | set(CPACK_RPM_programs_PACKAGE_NAME "${PACKAGE_NAME}-utils")
|
---|
744 | set(CPACK_RPM_programs_PACKAGE_REQUIRES "${PACKAGE_NAME}")
|
---|
745 | set(CPACK_RPM_runtime_PACKAGE_NAME "${PACKAGE_NAME}")
|
---|
746 | set(CPACK_RPM_runtime_PACKAGE_SUGGESTS "${PACKAGE_NAME}-utils")
|
---|
747 |
|
---|
748 | include(CPack)
|
---|