-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
583 lines (516 loc) · 18.5 KB
/
CMakeLists.txt
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
cmake_minimum_required(VERSION 3.18)
file(STRINGS "configure.ac" CONFIGURE_AC_LINES)
foreach(line ${CONFIGURE_AC_LINES})
if(line MATCHES [[^m4_define\(\[(MAJOR|MINOR|MICRO)_VERSION\],[ \t]*\[([0-9]+)\]\)$]])
set(LIBXSLT_${CMAKE_MATCH_1}_VERSION ${CMAKE_MATCH_2})
elseif(line MATCHES "^LIBEXSLT_(MAJOR|MINOR|MICRO)_VERSION=([0-9]+)$")
set(LIBEXSLT_${CMAKE_MATCH_1}_VERSION ${CMAKE_MATCH_2})
endif()
endforeach()
set(LIBXSLT_DOTTED_VERSION "${LIBXSLT_MAJOR_VERSION}.${LIBXSLT_MINOR_VERSION}.${LIBXSLT_MICRO_VERSION}")
math(EXPR LIBXSLT_VERSION_NUMBER "${LIBXSLT_MAJOR_VERSION} * 10000 + ${LIBXSLT_MINOR_VERSION} * 100 + ${LIBXSLT_MICRO_VERSION}")
set(LIBXSLT_VERSION_EXTRA "")
set(LIBEXSLT_DOTTED_VERSION ${LIBEXSLT_MAJOR_VERSION}.${LIBEXSLT_MINOR_VERSION}.${LIBEXSLT_MICRO_VERSION})
math(EXPR LIBEXSLT_VERSION_NUMBER "${LIBEXSLT_MAJOR_VERSION} * 10000 + ${LIBEXSLT_MINOR_VERSION} * 100 + ${LIBEXSLT_MICRO_VERSION}")
set(LIBEXSLT_VERSION_EXTRA "")
set(VERSION ${LIBXSLT_DOTTED_VERSION})
set(LIBEXSLT_VERSION ${LIBEXSLT_DOTTED_VERSION})
project(libxslt1 VERSION ${VERSION} LANGUAGES C)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
include(CheckCSourceCompiles)
include(CheckFunctionExists)
include(CheckIncludeFiles)
include(CheckLibraryExists)
include(CheckLinkerFlag)
include(CheckSymbolExists)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
if(NOT TARGET LibXml2)
find_package(LibXml2 CONFIG REQUIRED)
endif()
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(LIBXSLT_WITH_DEBUGGER "Add the debugging support" ON)
option(LIBXSLT_WITH_CRYPTO "Add crypto support to exslt" OFF)
option(LIBXSLT_WITH_MEM_DEBUG "Add the memory debugging module" OFF)
option(LIBXSLT_WITH_MODULES "Add the module support" ON)
option(LIBXSLT_WITH_PROFILER "Add the profiling support" ON)
option(LIBXSLT_WITH_PYTHON "Build Python bindings" ON)
option(LIBXSLT_WITH_TESTS "Build tests" ON)
option(LIBXSLT_WITH_THREADS "Add multithread support" ON)
set(LIBXSLT_WITH_TRIO OFF)
option(LIBXSLT_WITH_XSLT_DEBUG "Add the debugging code" ON)
if(NOT BUILD_SHARED_LIBS)
set(LIBXSLT_WITH_MODULES OFF)
endif()
if(LIBXSLT_WITH_CRYPTO AND NOT WIN32)
find_package(Gcrypt REQUIRED)
endif()
if(LIBXSLT_WITH_PYTHON)
check_include_files(unistd.h HAVE_UNISTD_H)
check_symbol_exists(F_GETFL fcntl.h HAVE_F_GETFL)
if(WIN32 OR (HAVE_UNISTD_H AND HAVE_F_GETFL))
find_package(Python COMPONENTS Interpreter Development REQUIRED)
else()
find_package(Python2 COMPONENTS Interpreter Development REQUIRED)
add_library(Python::Python ALIAS Python2::Python)
set(Python_EXECUTABLE ${Python2_EXECUTABLE})
set(Python_SITEARCH ${Python2_SITEARCH})
endif()
#set(LIBXSLT_PYTHON_INSTALL_DIR ${Python_SITEARCH} CACHE PATH "Python bindings install directory")
set(LIBXSLT_PYTHON_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/python" CACHE PATH "Python bindings install directory")
endif()
if(LIBXSLT_WITH_THREADS)
find_package(Threads REQUIRED)
endif()
foreach(VARIABLE IN ITEMS WITH_CRYPTO WITH_DEBUGGER WITH_MEM_DEBUG WITH_MODULES WITH_PROFILER WITH_PYTHON WITH_TRIO WITH_XSLT_DEBUG)
if(LIBXSLT_${VARIABLE})
set(${VARIABLE} 1)
else()
set(${VARIABLE} 0)
endif()
endforeach()
set(MODULE_EXTENSION "${CMAKE_SHARED_LIBRARY_SUFFIX}")
if(LIBXSLT_WITH_CRYPTO AND NOT WIN32)
list(APPEND CMAKE_REQUIRED_LIBRARIES Gcrypt::Gcrypt)
endif()
if(LIBXSLT_WITH_THREADS)
list(APPEND CMAKE_REQUIRED_LIBRARIES Threads::Threads)
endif()
if(MSVC)
configure_file(libxslt/win32config.h config.h COPYONLY)
configure_file(libxslt/win32config.h win32config.h COPYONLY)
else()
if(UNIX)
set(CMAKE_REQUIRED_LIBRARIES m)
endif()
check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
check_function_exists(ftime HAVE_FTIME)
check_library_exists(gcrypt gcry_control "gcrypt.h" HAVE_GCRYPT)
check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
check_function_exists(gmtime_r HAVE_GMTIME_R)
check_include_files(inttypes.h HAVE_INTTYPES_H)
check_library_exists(pthread pthread_join "" HAVE_LIBPTHREAD)
check_include_files(locale.h HAVE_LOCALE_H)
check_function_exists(localtime_r HAVE_LOCALTIME_R)
check_include_files(pthread.h HAVE_PTHREAD_H)
check_function_exists(snprintf HAVE_SNPRINTF)
check_function_exists(stat HAVE_STAT)
check_function_exists(strxfrm_l HAVE_STRXFRM_L)
check_include_files(sys/select.h HAVE_SYS_SELECT_H)
check_include_files(sys/stat.h HAVE_SYS_STAT_H)
check_include_files(sys/timeb.h HAVE_SYS_TIMEB_H)
check_include_files(sys/time.h HAVE_SYS_TIME_H)
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
check_include_files(unistd.h HAVE_UNISTD_H)
check_function_exists(vsnprintf HAVE_VSNPRINTF)
check_include_files(xlocale.h HAVE_XLOCALE_H)
check_function_exists(_stat HAVE__STAT)
set(LT_OBJDIR ".libs/")
set(PACKAGE "libxslt")
set(PACKAGE_BUGREPORT "[email protected]")
set(PACKAGE_NAME "libxslt")
set(PACKAGE_STRING "libxslt ${LIBXSLT_DOTTED_VERSION}")
set(PACKAGE_TARNAME "libxslt")
set(PACKAGE_URL "https://gitlab.gnome.org/GNOME/libxslt")
set(PACKAGE_VERSION ${LIBXSLT_DOTTED_VERSION})
set(_ALL_SOURCE ON)
set(_GNU_SOURCE ON)
set(_POSIX_PTHREAD_SEMANTICS ON)
set(_TANDEM_SOURCE ON)
check_c_source_compiles("
#define __EXTENSIONS__ 1
int main() { return 0; }
" __EXTENSIONS__)
check_include_files(minix/config.h HAVE_MINIX_CONFIG_H)
if(HAVE_MINIX_CONFIG_H)
set(_MINIX ON)
set(_POSIX_1_SOURCE ON)
set(_POSIX_SOURCE ON)
endif()
configure_file(config.h.cmake.in config.h)
endif()
configure_file(libexslt/exsltconfig.h.in libexslt/exsltconfig.h)
configure_file(libxslt/xsltconfig.h.in libxslt/xsltconfig.h)
set(
LIBXSLT_HDRS
libxslt/attributes.h
libxslt/documents.h
libxslt/extensions.h
libxslt/extra.h
libxslt/functions.h
libxslt/imports.h
libxslt/keys.h
libxslt/namespaces.h
libxslt/numbersInternals.h
libxslt/pattern.h
libxslt/preproc.h
libxslt/security.h
libxslt/templates.h
libxslt/transform.h
libxslt/variables.h
libxslt/xslt.h
${CMAKE_CURRENT_BINARY_DIR}/libxslt/xsltconfig.h
libxslt/xsltexports.h
libxslt/xsltInternals.h
libxslt/xsltlocale.h
libxslt/xsltutils.h
)
set(
LIBXSLT_SRCS
libxslt/attributes.c
libxslt/attrvt.c
libxslt/documents.c
libxslt/extensions.c
libxslt/extra.c
libxslt/functions.c
libxslt/imports.c
libxslt/keys.c
libxslt/namespaces.c
libxslt/numbers.c
libxslt/pattern.c
libxslt/preproc.c
libxslt/security.c
libxslt/templates.c
libxslt/transform.c
libxslt/variables.c
libxslt/xslt.c
libxslt/xsltlocale.c
libxslt/xsltutils.c
)
add_library(LibXslt ${LIBXSLT_HDRS} ${LIBXSLT_SRCS})
add_library(LibXslt::LibXslt ALIAS LibXslt)
if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(LibXslt INTERFACE LIBXSLT_STATIC)
endif()
if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wshadow \
-Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return \
-Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline \
-Wredundant-decls -Wno-long-long -Wno-format-extra-args")
if(BUILD_SHARED_LIBS AND UNIX AND NOT APPLE)
check_linker_flag(C "LINKER:--undefined-version" FLAG_UNDEFINED_VERSION)
if (FLAG_UNDEFINED_VERSION)
target_link_options(LibXslt PRIVATE "LINKER:--undefined-version")
endif()
target_link_options(LibXslt PRIVATE "LINKER:--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libxslt/libxslt.syms")
endif()
endif()
target_include_directories(
LibXslt
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries(LibXslt PUBLIC LibXml2::LibXml2)
if(UNIX)
target_link_libraries(LibXslt PRIVATE m)
set(LIBM "-lm")
endif()
set_target_properties(
LibXslt
PROPERTIES
IMPORT_PREFIX lib
OUTPUT_NAME xslt
POSITION_INDEPENDENT_CODE ON
PREFIX lib
VERSION ${PROJECT_VERSION}
SOVERSION ${LIBXSLT_MAJOR_VERSION}
)
if(MSVC)
if(BUILD_SHARED_LIBS)
set_target_properties(
LibXslt
PROPERTIES
DEBUG_POSTFIX d
)
else()
set_target_properties(
LibXslt
PROPERTIES
DEBUG_POSTFIX sd
MINSIZEREL_POSTFIX s
RELEASE_POSTFIX s
RELWITHDEBINFO_POSTFIX s
)
endif()
endif()
install(FILES ${LIBXSLT_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxslt COMPONENT development)
install(
TARGETS LibXslt
EXPORT LibXslt
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_COMPONENT development
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime
)
if(MSVC AND BUILD_SHARED_LIBS)
install(FILES $<TARGET_PDB_FILE:LibXslt> DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug)
endif()
set(
LIBEXSLT_HDRS
libexslt/exslt.h
${CMAKE_CURRENT_BINARY_DIR}/libexslt/exsltconfig.h
libexslt/exsltexports.h
)
set(
LIBEXSLT_SRCS
libexslt/common.c
libexslt/crypto.c
libexslt/date.c
libexslt/dynamic.c
libexslt/exslt.c
libexslt/functions.c
libexslt/libexslt.h
libexslt/math.c
libexslt/saxon.c
libexslt/sets.c
libexslt/strings.c
)
add_library(LibExslt ${LIBEXSLT_HDRS} ${LIBEXSLT_SRCS})
add_library(LibXslt::LibExslt ALIAS LibExslt)
if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(LibExslt INTERFACE LIBEXSLT_STATIC)
endif()
target_include_directories(
LibExslt
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>
)
if(LIBXSLT_WITH_CRYPTO AND NOT WIN32)
target_link_libraries(LibExslt PRIVATE Gcrypt::Gcrypt)
set(LIBGCRYPT_LIBS "-lgcrypt")
endif()
if(UNIX)
target_link_libraries(LibExslt PRIVATE m)
set(LIBM "-lm")
endif()
target_link_libraries(LibExslt PUBLIC LibXslt LibXml2::LibXml2)
set_target_properties(
LibExslt
PROPERTIES
IMPORT_PREFIX lib
OUTPUT_NAME exslt
POSITION_INDEPENDENT_CODE ON
PREFIX lib
VERSION ${LIBEXSLT_VERSION}
SOVERSION ${LIBEXSLT_MAJOR_VERSION}
)
if(MSVC)
if(BUILD_SHARED_LIBS)
set_target_properties(
LibExslt
PROPERTIES
DEBUG_POSTFIX d
)
else()
set_target_properties(
LibExslt
PROPERTIES
DEBUG_POSTFIX sd
MINSIZEREL_POSTFIX s
RELEASE_POSTFIX s
RELWITHDEBINFO_POSTFIX s
)
endif()
endif()
install(FILES ${LIBEXSLT_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libexslt COMPONENT development)
install(
TARGETS LibExslt
EXPORT LibXslt
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_COMPONENT development
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime
)
if(MSVC AND BUILD_SHARED_LIBS)
install(FILES $<TARGET_PDB_FILE:LibExslt> DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug)
endif()
add_executable(xsltproc xsltproc/xsltproc.c)
add_executable(LibXslt::xsltproc ALIAS xsltproc)
target_include_directories(xsltproc PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(xsltproc LibExslt LibXslt)
install(TARGETS xsltproc EXPORT LibXslt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT programs)
if(LIBXSLT_WITH_TESTS)
enable_testing()
add_executable(runtest tests/runtest.c)
target_link_libraries(runtest LibXslt LibExslt)
add_test(
NAME runtest COMMAND runtest
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/tests"
)
if (LIBXSLT_WITH_MODULES)
add_library(testplugin SHARED tests/testplugin.c)
target_link_libraries(testplugin LibExslt LibXslt)
set_target_properties(
testplugin PROPERTIES
PREFIX ""
OUTPUT_NAME xmlsoft_org_xslt_testplugin
)
# There must be an easier way...
get_cmake_property(MULTI_CONFIG GENERATOR_IS_MULTI_CONFIG)
if (MULTI_CONFIG)
set(PLUGINS_PATH ${PROJECT_BINARY_DIR}/$<CONFIG>)
else()
set(PLUGINS_PATH ${PROJECT_BINARY_DIR})
endif()
set_tests_properties(
runtest PROPERTIES
ENVIRONMENT LIBXSLT_PLUGINS_PATH=${PLUGINS_PATH}
)
endif()
if(Threads_FOUND)
add_executable(testThreads xsltproc/testThreads.c)
target_link_libraries(testThreads LibXslt LibExslt Threads::Threads)
add_test(NAME testThreads COMMAND testThreads)
endif()
endif()
if(LIBXSLT_WITH_PYTHON)
set(ENV{SRCDIR} ${CMAKE_CURRENT_SOURCE_DIR}/python)
execute_process(
COMMAND
${Python_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/python/generator.py
${CMAKE_CURRENT_SOURCE_DIR}/doc/libxslt-api.xml
${CMAKE_CURRENT_SOURCE_DIR}/python/libxslt-python-api.xml
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}
)
unset(ENV{SRCDIR})
file(READ python/libxsl.py LIBXSL_PY)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/libxslt.py.in "${LIBXSL_PY}")
file(READ ${CMAKE_CURRENT_BINARY_DIR}/libxsltclass.py LIBXSLTCLASS_PY)
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libxslt.py.in "${LIBXSLTCLASS_PY}")
configure_file(${CMAKE_CURRENT_BINARY_DIR}/libxslt.py.in libxslt.py COPYONLY)
add_library(
LibXsltMod
libxslt-py.c
libxslt-py.h
python/libxml_wrap.h
python/libxslt.c
python/libxslt_wrap.h
python/types.c
)
target_include_directories(
LibXsltMod
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/python>
)
target_link_libraries(LibXsltMod LibXslt LibExslt Python::Python)
set_target_properties(
LibXsltMod
PROPERTIES
IMPORT_PREFIX lib
OUTPUT_NAME xsltmod
PREFIX lib
VERSION ${PROJECT_VERSION}
)
if (WIN32)
set_target_properties(LibXsltMod PROPERTIES SUFFIX ".pyd")
endif()
install(
TARGETS LibXsltMod
ARCHIVE DESTINATION ${LIBXSLT_PYTHON_INSTALL_DIR} COMPONENT development
LIBRARY DESTINATION ${LIBXSLT_PYTHON_INSTALL_DIR} COMPONENT runtime NAMELINK_COMPONENT development
RUNTIME DESTINATION ${LIBXSLT_PYTHON_INSTALL_DIR} COMPONENT runtime
)
if(MSVC AND BUILD_SHARED_LIBS)
install(FILES $<TARGET_PDB_FILE:LibXsltMod> DESTINATION ${LIBXSLT_PYTHON_INSTALL_DIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug)
endif()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxslt.py DESTINATION ${LIBXSLT_PYTHON_INSTALL_DIR} COMPONENT runtime)
endif()
install(FILES libexslt/libexslt.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 COMPONENT documentation)
install(FILES libxslt/libxslt.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 COMPONENT documentation)
install(FILES doc/xsltproc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
install(DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libxslt COMPONENT documentation PATTERN Makefile.* EXCLUDE)
if(LIBXSLT_WITH_CRYPTO AND NOT WIN32)
install(FILES FindGcrypt.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION} COMPONENT development)
endif()
configure_package_config_file(
libxslt-config.cmake.cmake.in libxslt-config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION}
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/libxslt-config.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION}
COMPONENT development
)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/libxslt-config-version.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY ExactVersion
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/libxslt-config-version.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION}
COMPONENT development
)
install(
EXPORT LibXslt
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION}
NAMESPACE LibXslt::
FILE libxslt-export.cmake
COMPONENT development
)
set(LIBXSLT_DEFAULT_PLUGINS_PATH "\${libdir}/libxslt-plugins")
set(XSLT_INCLUDEDIR "-I\${includedir}")
set(XSLT_LIBDIR "-L\${libdir}")
set(XSLT_LIBS "-lxslt -lxml2")
set(XSLT_PRIVATE_LIBS "${LIBM}")
set(EXSLT_INCLUDEDIR "-I\${includedir}")
set(EXSLT_LIBDIR "-L\${libdir}")
set(EXSLT_PRIVATE_LIBS "${XSLT_PRIVATE_LIBS} ${LIBGCRYPT_LIBS} ${LIBM}")
file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_PREFIX}")
string(REGEX REPLACE "/$" "" PACKAGE_RELATIVE_PATH "${PACKAGE_RELATIVE_PATH}")
set(prefix "\${pcfiledir}/${PACKAGE_RELATIVE_PATH}")
set(exec_prefix "\${prefix}")
set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
configure_file(libxslt.pc.in libxslt.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxslt.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT development)
configure_file(libexslt.pc.in libexslt.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libexslt.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT development)
set(prefix "\$(cd \"\$(dirname \"\$0\")\"; pwd -P)/..")
configure_file(xslt-config.in xslt-config @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/xslt-config DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT development)
set(XSLT_INCLUDEDIR "-I${CMAKE_INSTALL_FULL_INCLUDEDIR}")
set(XSLT_LIBDIR "-L${CMAKE_INSTALL_FULL_LIBDIR}")
configure_file(xsltConf.sh.in xsltConf.sh @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/xsltConf.sh DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development)
set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime)
set(CPACK_COMPONENT_PROGRAMS_DEPENDS runtime)
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "${PACKAGE_TARNAME}")
set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "${PACKAGE_TARNAME}${LIBXSLT_MAJOR_VERSION}-dev")
set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_SECTION "libdevel")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${PACKAGE_URL})
set(CPACK_DEBIAN_PACKAGE_NAME ${PACKAGE_TARNAME})
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
set(CPACK_DEBIAN_PROGRAMS_PACKAGE_DEPENDS "${PACKAGE_TARNAME}")
set(CPACK_DEBIAN_PROGRAMS_PACKAGE_NAME "${PACKAGE_TARNAME}-utils")
set(CPACK_DEBIAN_PROGRAMS_PACKAGE_SECTION "utils")
set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME ${PACKAGE_TARNAME})
set(CPACK_DEBIAN_RUNTIME_PACKAGE_RECOMMENDS "${PACKAGE_TARNAME}-utils")
set(CPACK_DEBIAN_RUNTIME_PACKAGE_SECTION "libs")
set(CPACK_NSIS_PACKAGE_NAME ${PACKAGE_STRING})
set(CPACK_NSIS_URL_INFO_ABOUT ${PACKAGE_URL})
set(CPACK_PACKAGE_CONTACT ${PACKAGE_BUGREPORT})
set(CPACK_PACKAGE_DISPLAY_NAME ${PACKAGE_STRING})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PACKAGE_TARNAME}-${PACKAGE_VERSION}")
set(CPACK_PACKAGE_NAME ${PACKAGE_TARNAME})
set(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION})
set(CPACK_PACKAGE_VERSION_MAJOR ${LIBXSLT_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${LIBXSLT_MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${LIBXSLT_MICRO_VERSION})
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/Copyright)
set(CPACK_RPM_COMPONENT_INSTALL ON)
set(CPACK_RPM_development_PACKAGE_NAME "${PACKAGE_NAME}-devel")
set(CPACK_RPM_development_PACKAGE_REQUIRES "${PACKAGE_NAME}")
set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
set(CPACK_RPM_PACKAGE_NAME ${PACKAGE_TARNAME})
set(CPACK_RPM_PACKAGE_URL ${PACKAGE_URL})
set(CPACK_RPM_programs_PACKAGE_NAME "${PACKAGE_NAME}-utils")
set(CPACK_RPM_programs_PACKAGE_REQUIRES "${PACKAGE_NAME}")
set(CPACK_RPM_runtime_PACKAGE_NAME "${PACKAGE_NAME}")
set(CPACK_RPM_runtime_PACKAGE_SUGGESTS "${PACKAGE_NAME}-utils")
include(CPack)