Use -Wshadow in cmake builds
[metze/wireshark/wip.git] / CMakeLists.txt
1 # CMakeLists.txt
2 #
3 # $Id$
4 #
5 # Wireshark - Network traffic analyzer
6 # By Gerald Combs <gerald@wireshark.org>
7 # Copyright 1998 Gerald Combs
8 #
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License
11 # as published by the Free Software Foundation; either version 2
12 # of the License, or (at your option) any later version.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #
23
24 project(Wireshark C CXX)
25
26 cmake_minimum_required(VERSION 2.6)
27 set(CMAKE_BACKWARDS_COMPATIBILITY 2.6)
28
29 # Needs to be set after cmake_minimum_required or cmake_policy(VERSION)
30 if(COMMAND cmake_policy)
31         # Backward compatibility for versions < 2.6.3
32         cmake_policy(SET CMP0011 OLD)
33 #       cmake_policy(SET CMP0015 NEW)
34 endif(COMMAND cmake_policy)
35
36 # set(PROJECT_MAJOR_VERSION 1)
37 # set(PROJECT_MINOR_VERSION 9)
38 # set(PROJECT_PATCH_VERSION 0)
39 # set(PROJECT_VERSION_EXTENSION "-rc5")
40 # If not set, copy over Wireshark version from configure.ac
41 if(NOT PROJECT_MAJOR_VERSION)
42         file(STRINGS
43                 ${CMAKE_SOURCE_DIR}/configure.ac
44                 PROJECT_MAJOR_VERSION_TMP
45                 REGEX "^m4_define\\(\\[?version_major\\]?, *\\[?[0-9]+\\]?\\)"
46         )
47         file(STRINGS
48                 ${CMAKE_SOURCE_DIR}/configure.ac
49                 PROJECT_MINOR_VERSION_TMP
50                 REGEX "^m4_define\\(\\[?version_minor\\]?, *\\[?[0-9]+\\]?\\)"
51         )
52         file(STRINGS
53                 ${CMAKE_SOURCE_DIR}/configure.ac
54                 PROJECT_PATCH_VERSION_TMP
55                 REGEX "^m4_define\\(\\[?version_micro\\]?, *\\[?[0-9]+\\]?\\)"
56         )
57         # XXX pull VERSION_EXTENSION out of configure.ac ?
58
59         string(REGEX REPLACE "m4_define\\(\\[?version_major\\]?, *\\[?([0-9]+)\\]?\\)"
60                 "\\1"
61                 PROJECT_MAJOR_VERSION
62                 ${PROJECT_MAJOR_VERSION_TMP}
63         )
64         string(REGEX REPLACE "m4_define\\(\\[?version_minor\\]?, *\\[?([0-9]+)\\]?\\)"
65                 "\\1"
66                 PROJECT_MINOR_VERSION
67                 ${PROJECT_MINOR_VERSION_TMP}
68         )
69         string(REGEX REPLACE "m4_define\\(\\[?version_micro\\]?, *\\[?([0-9]+)\\]?\\)"
70                 "\\1"
71                 PROJECT_PATCH_VERSION
72                 ${PROJECT_PATCH_VERSION_TMP}
73         )
74 endif()
75
76
77 if(PROJECT_VERSION_EXTENSION)
78         set(PROJECT_VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION}${PROJECT_VERSION_EXTENSION})
79 else()
80         set(PROJECT_VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION})
81 endif()
82
83 message(STATUS "V: ${PROJECT_VERSION}, MaV: ${PROJECT_MAJOR_VERSION}, MiV: ${PROJECT_MINOR_VERSION}, PL: ${PROJECT_PATCH_VERSION}, EV: ${PROJECT_VERSION_EXTENSION}.")
84
85 #Where to find local cmake scripts
86 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
87 INCLUDE(UseLemon)
88 INCLUDE(UseMakeDissectorReg)
89 INCLUDE(UseMakeTapReg)
90
91 # Under linux the release mode (CMAKE_BUILD_TYPE=release) defines NDEBUG
92
93 # Enable with: "make VERBOSE=1"
94 set(CMAKE_VERBOSE_MAKEFILE OFF)
95
96 #Defines CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_DATADIR, etc ...
97 include(CMakeInstallDirs)
98
99 include_directories(
100         ${CMAKE_BINARY_DIR}
101         ${CMAKE_SOURCE_DIR}
102         ${CMAKE_SOURCE_DIR}/epan
103         ${CMAKE_SOURCE_DIR}/tools/lemon
104         ${CMAKE_SOURCE_DIR}/wiretap
105 )
106
107 #Where to put libraries
108 if(NOT LIBRARY_OUTPUT_PATH)
109         set(LIBRARY_OUTPUT_PATH ${Wireshark_BINARY_DIR}/lib CACHE INTERNAL
110                    "Single output directory for building all libraries.")
111 endif()
112
113
114 include(CMakeOptions.txt)
115
116
117 set(WIRESHARK_C_FLAGS
118         -O2
119         -g
120         -Wall
121         -W
122         -Wextra
123         -Wendif-labels
124         -Wpointer-arith
125         -Warray-bounds
126         -Wcast-align
127         -Wformat-security
128         -fexcess-precision=fast
129 )
130
131 set(WIRESHARK_C_ONLY_FLAGS
132         # The following are C only, not C++
133         -Wdeclaration-after-statement
134         -Wno-pointer-sign
135         -Wold-style-definition
136         -Wshadow
137 )
138
139 set(WIRESHARK_EXTRA_C_FLAGS
140         -pedantic
141         -Woverflow
142         -Wlogical-op
143         -Wno-overlength-strings
144         -fstrict-overflow -Wstrict-overflow=4
145         -Wunreachable-code
146         -Wunsafe-loop-optimizations
147         -Wno-long-long
148         -Wcast-qual
149         -Waddress
150         -Warray-bounds
151         -Wattributes
152         -Wdiv-by-zero
153         -Wformat-security
154         -Wignored-qualifiers
155         -Wpragmas
156         -Wredundant-decls
157         -Wvla
158         # packet-ncp2222.inc prevents this from going into all warnings
159         -Wwrite-strings
160         # All the registration functions block these for now.
161         -Wmissing-declarations
162         # Problem with packet-afs.c
163         -Wshadow
164         # More cleanup needed for this on LP64
165         -Wshorten-64-to-32
166
167 )
168
169 set(WIRESHARK_EXTRA_C_ONLY_FLAGS
170         # The following are C only, not C++
171         -Wbad-function-cast
172         -Wc++-compat
173         -Wjump-misses-init
174         # GLib blocks this for now.
175         -Wstrict-prototypes
176         # All the registration functions block these for now.
177         -Wmissing-prototypes
178 )
179
180 if(ENABLE_EXTRA_GCC_CHECKS)   # This overrides -Werror
181         set(WIRESHARK_C_FLAGS ${WIRESHARK_C_FLAGS} ${WIRESHARK_EXTRA_C_FLAGS})
182         set(WIRESHARK_C_ONLY_FLAGS ${WIRESHARK_C_ONLY_FLAGS} ${WIRESHARK_EXTRA_C_ONLY_FLAGS})
183 endif()
184
185 add_definitions(
186         -DG_DISABLE_DEPRECATED
187         -DG_DISABLE_SINGLE_INCLUDES
188 )
189
190 # Counterhack to work around some cache magic in CHECK_C_SOURCE_COMPILES
191 include(CheckCCompilerFlag)
192 set(C 0)
193 # Sigh: Have to use THIS_FLAG instead of ${F} for some reason
194 foreach(THIS_FLAG ${WIRESHARK_C_FLAGS})
195         set(F WS_C_FLAG_${C})
196         set(${F} ${THIS_FLAG})
197         set(V WS_C_FLAG_VALID${C})
198         check_c_compiler_flag(${${F}} ${V})
199         if (${${V}})
200                 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${F}}")
201                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${F}}")
202         endif()
203         math(EXPR C "${C} + 1")
204 endforeach()
205 # Continue increasing C from previous loop
206 foreach(THIS_FLAG ${WIRESHARK_C_ONLY_FLAGS})
207         set(F WS_C_FLAG_${C})
208         set(${F} ${THIS_FLAG})
209         set(V WS_C_FLAG_VALID${C})
210         check_c_compiler_flag(${${F}} ${V})
211         if (${${V}})
212                 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${F}}")
213         endif()
214         math(EXPR C "${C} + 1")
215 endforeach()
216 message(STATUS "C-Flags: ${CMAKE_C_FLAGS}\nCXX-Flags: ${CMAKE_CXX_FLAGS}")
217
218 check_c_compiler_flag(-fvisibility=hidden FVHIDDEN)
219 if((FVHIDDEN))
220         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
221 else() # TODO add alternate compiler flags for hiding symbols
222         message(WARNING "Hiding shared library symbols is not supported by the compiler."
223                 " All shared library symbols will be exported.")
224 endif()
225
226 if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_GCC_CHECKS)
227         check_c_compiler_flag(-Werror WERROR)
228 else()
229         unset(WERROR)
230 endif()
231
232 if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_CXX_COMPILER MATCHES ".*clang")
233         set (C_UNUSED "__attribute__((unused))" )
234 else()
235         set (C_UNUSED "" )
236 endif()
237
238 set(WIRESHARK_LD_FLAGS
239         -Wl,--as-needed
240         # -flto
241         # -fwhopr
242         # -fwhole-program
243 )
244
245 include(CheckCLinkerFlag)
246 set(C 0)
247 # Sigh: Have to use THIS_FLAG instead of ${F} for some reason
248 foreach(THIS_FLAG ${WIRESHARK_LD_FLAGS})
249         set(F WS_LD_FLAG_${C})
250         set(${F} ${THIS_FLAG})
251         set(V WS_LD_FLAG_VALID${C})
252         check_c_linker_flag(${${F}} ${V})
253         if (${${V}})
254                 set(WS_LINK_FLAGS ${WS_LINK_FLAGS} ${${F}})
255         endif()
256         math(EXPR C "${C} + 1")
257 endforeach()
258
259 if(ENABLE_STATIC)
260   set(LINK_MODE_LIB STATIC)
261   set(LINK_MODE_MODULE STATIC)
262 else()
263   set(LINK_MODE_LIB SHARED)
264   set(LINK_MODE_MODULE MODULE)
265 endif()
266
267 # The packagelist is doing some magic:  If we add XXX to the packagelist, we
268 # - may optionally set XXX_OPTIONS to pass to the find_package command
269 # - will call FindXXX.cmake
270 # - return found libraries in XXX_LIBRARIES
271 # - return found include in XXX_INCLUDE_DIRS
272 # - set HAVE_XXX
273
274 #The minimum package list
275 set(PACKAGELIST GLIB2 GMODULE2 GTHREAD2 M LEX YACC Perl SH PythonInterp)
276 set(GLIB2_FIND_REQUIRED)
277 set(GLIB2_MIN_VERSION 2.14.0)
278 set(GTHREAD2_REQUIRED)
279 set(PCAP_REQUIRED)
280 set(M_REQUIRED)
281
282 set(PACKAGELIST ${PACKAGELIST} HtmlViewer)
283
284 if(ENABLE_PCAP)
285         set(PACKAGELIST ${PACKAGELIST} PCAP)
286 endif()
287
288 # Build the GTK-GUI?
289 if(BUILD_wireshark)
290         if(ENABLE_GTK3)
291                 set(PACKAGELIST ${PACKAGELIST} GTK3)
292         else()
293                 set(PACKAGELIST ${PACKAGELIST} GTK2)
294                 set(GTK2_OPTIONS COMPONENTS gtk)
295                 set(GTK2_FIND_VERSION 2.12)
296                 set(GTK2_DEBUG false)
297         endif()
298 endif()
299
300 # Build the Qt GUI?
301 if(BUILD_qtshark)
302         set(PACKAGELIST ${PACKAGELIST} QT)
303         # set(QT_OPTIONS 4.7.1 REQUIRED QtCore QtGui)
304 endif()
305
306 # SMI SNMP
307 if(ENABLE_SMI)
308         set(PACKAGELIST ${PACKAGELIST} SMI)
309 endif()
310
311 # GNU crypto
312 if(ENABLE_GCRYPT)
313         set(PACKAGELIST ${PACKAGELIST} GCRYPT)
314 endif()
315
316 # GNU SSL/TLS support
317 if(ENABLE_GNUTLS)
318         set(PACKAGELIST ${PACKAGELIST} GNUTLS)
319 endif()
320
321 # Kerberos
322 if(ENABLE_KERBEROS)
323         set(PACKAGELIST ${PACKAGELIST} KERBEROS)
324 endif()
325
326 # Portable audio
327 if(ENABLE_PORTAUDIO)
328         set(PACKAGELIST ${PACKAGELIST} PORTAUDIO)
329 endif()
330
331
332 # Prefer c-ares over adns
333 if(ENABLE_CARES)        # C Asynchronouse resolver
334         set(PACKAGELIST ${PACKAGELIST} CARES)
335 elseif(ENABLE_ADNS)     # Gnu asynchronous DNS
336         set(PACKAGELIST ${PACKAGELIST} ADNS)
337 endif()
338
339 # Zlib compression
340 if(ENABLE_ZLIB)
341         set(PACKAGELIST ${PACKAGELIST} ZLIB)
342 endif()
343
344 # Lua 5.1 dissectors
345 if(ENABLE_LUA)
346         set(PACKAGELIST ${PACKAGELIST} LUA)
347 endif()
348
349 # GeoIP address resolving
350 if(ENABLE_GEOIP)
351         set(PACKAGELIST ${PACKAGELIST} GEOIP)
352 endif()
353
354 if(ENABLE_NETLINK)
355         set(PACKAGELIST ${PACKAGELIST} NL)
356 endif()
357
358 # Capabilities
359 if(ENABLE_CAP)
360         set(PACKAGELIST ${PACKAGELIST} CAP)
361 endif()
362
363 if(ENABLE_PYTHON)
364         set(PACKAGELIST ${PACKAGELIST} PYTHON)
365 endif()
366
367 set(PACKAGELIST ${PACKAGELIST} YAPP)
368
369 set(PACKAGELIST ${PACKAGELIST} POD)
370
371
372 set(PROGLIST text2pcap mergecap capinfos editcap reordercap dumpcap)
373
374 #Let's loop the package list
375 foreach(PACKAGE ${PACKAGELIST})
376         if(${PACKAGE} STREQUAL "QT")
377                 set(PACKAGE_NAME "Qt4")
378         else()
379                 set(PACKAGE_NAME ${PACKAGE})
380         endif()
381         if(${PACKAGE}_OPTIONS)
382                 find_package(${PACKAGE_NAME} ${${PACKAGE}_OPTIONS})
383         elseif(${PACKAGE}_REQUIRED)
384                 find_package(${PACKAGE_NAME} REQUIRED)
385         else()
386                 find_package(${PACKAGE_NAME})
387         endif()
388         message(${PACKAGE}_FOUND)
389         if (${PACKAGE}_FOUND)
390                 set(HAVE_LIB${PACKAGE} 1)
391                 include_directories(${${PACKAGE}_INCLUDE_DIRS})
392                 message(STATUS "${PACKAGE} includes: ${${PACKAGE}_INCLUDE_DIRS}")
393                 message(STATUS "${PACKAGE} libs: ${${PACKAGE}_LIBRARIES}")
394         endif()
395 endforeach()
396
397 #packaging
398 include(CPackConfig.txt)
399
400 if(HAVE_LIBPYTHON)
401         set(HAVE_PYTHON 1)
402         set(PYTHON_DIR "${CMAKE_INSTALL_PREFIX}/lib/wireshark/python/${CPACK_PACKAGE_VERSION}")
403 endif()
404 if(HAVE_LIBLUA)
405         set(HAVE_LUA_H 1)
406         set(HAVE_LUA 1)
407 endif()
408 if(HAVE_LIBKERBEROS)
409         set(HAVE_KERBEROS 1)
410         # HAVE_HEIMDAL_KERBEROS
411         set(HAVE_MIT_KERBEROS 1)
412         set(HAVE_KEYTYPE_ARCFOUR_56 1)
413 endif()
414 if(HAVE_LIBGEOIP)
415         set(HAVE_GEOIP 1)
416 endif()
417 if(HAVE_LIBCARES)
418         set(HAVE_C_ARES 1)
419 endif()
420 if(HAVE_LIBADNS)
421         set(HAVE_GNU_ADNS 1)
422 endif()
423 if(ENABLE_AIRPCAP)
424         set(HAVE_AIRPCAP 1)
425 endif()
426 if(HAVE_LIBNL AND ENABLE_AIRPCAP)
427         message(ERROR "Airpcap and Libnl support are mutually exclusive")
428 endif()
429 # No matter which version of GTK is present
430 if(GTK2_FOUND OR GTK3_FOUND)
431         set(GTK_FOUND ON)
432 endif()
433 # That's the name autofoo uses
434 if(HAVE_LIBZLIB)
435         set(HAVE_LIBZ 1)
436 endif()
437 # QT_LIBRARIES and QT_INCLUDES are not set above. They require extra magic:
438 if(QT_FOUND)
439         include(${QT_USE_FILE})
440         include_directories(${QT_INCLUDE_DIR})
441         message(STATUS "QT includes: ${QT_INCLUDE_DIR}")
442         message(STATUS "QT libs: ${QT_LIBRARIES}")
443 endif()
444
445 include(ConfigureChecks.cmake)
446
447 #Big or little endian ?
448 include(TestBigEndian)
449 test_big_endian(WORDS_BIGENDIAN)
450
451 set(DATAFILE_DIR "${CMAKE_INSTALL_PREFIX}/share/${CPACK_PACKAGE_NAME}")
452
453 if(ENABLE_PLUGINS)
454         set(HAVE_PLUGINS 1)
455         set(PLUGIN_DIR="${DATAFILE_DIR}/plugins/${CPACK_PACKAGE_VERSION}")
456         set(PLUGIN_SRC_DIRS
457                 plugins/asn1
458                 plugins/docsis
459                 plugins/ethercat
460                 plugins/gryphon
461                 plugins/irda
462                 plugins/m2m
463                 plugins/mate
464                 plugins/opcua
465                 plugins/profinet
466                 plugins/stats_tree
467                 plugins/unistim
468                 plugins/wimax
469                 plugins/wimaxasncp
470                 plugins/wimaxmacphy
471         )
472 # It seems this stuff doesn't build with autofoo either...
473 #       if(YAPP_FOUND)
474 #               set(PLUGIN_SRC_DIRS
475 #                       ${PLUGIN_SRC_DIRS}
476 #                       plugins/tpg
477 #               )
478 #       endif()
479 else()
480         set(PLUGIN_SRC_DIRS )
481 endif()
482
483 foreach(PLUGIN_DIR ${PLUGIN_SRC_DIRS})
484         add_subdirectory( ${PLUGIN_DIR} )
485 endforeach()
486
487 add_subdirectory( codecs )
488 add_subdirectory( epan )
489 add_subdirectory( tools/lemon )
490 add_subdirectory( wiretap )
491 add_subdirectory( wsutil )
492
493 add_custom_target(dumpabi DEPENDS dumpabi-libwireshark dumpabi-libwiretap dumpabi-libwsutil color.h)
494
495 if((BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND))
496         add_subdirectory( ui )
497 endif()
498
499 if(BUILD_wireshark AND GTK_FOUND)
500         add_subdirectory( ui/gtk )
501 endif()
502
503 if(BUILD_qtshark AND QT_FOUND)
504         add_subdirectory( ui/qt )
505 endif()
506
507
508 # Basedir where to install guides
509 set(DOC_DIR "$ENV{docdir}" CACHE FILEPATH "Installation directory for ug and dg pdfs.")
510 message(STATUS "docdir: ${DOC_DIR}")
511
512 if(ENABLE_GUIDES)
513         add_subdirectory( docbook )
514 endif()
515
516 if(ENABLE_PCAP_NG_DEFAULT)
517         set(PCAP_NG_DEFAULT 1)
518 endif()
519
520 #Platform specific
521 #if(UNIX)
522 #endif()
523
524 if(APPLE)
525         #
526         # We assume that APPLE means OS X so that we have the OS X
527         # frameworks.
528         #
529         set(HAVE_OS_X_FRAMEWORKS 1)
530         FIND_LIBRARY (APPLE_APPLICATION_SERVICES_LIBRARY ApplicationServices)
531         FIND_LIBRARY (APPLE_CORE_FOUNDATION_LIBRARY CoreFoundation)
532         FIND_LIBRARY (APPLE_SYSTEM_CONFIGURATION_LIBRARY SystemConfiguration)
533 endif()
534
535 if(WIN32)
536         set(WS_MSVC_NORETURN "__declspec(noreturn)")
537
538         # Disable deprecation
539         if(MSVC80 OR MSVC90)
540                 add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
541         endif()
542 else()
543         set(WS_MSVC_NORETURN " ")
544 endif()
545
546 configure_file(${CMAKE_SOURCE_DIR}/cmakeconfig.h.in ${CMAKE_BINARY_DIR}/config.h)
547
548 set( configure_input "Built with CMake ${CMAKE_VERSION}" )
549 set( VERSION ${PROJECT_VERSION} )
550
551 configure_file(
552         ${CMAKE_SOURCE_DIR}/packaging/macosx/Info.plist.in
553         ${CMAKE_SOURCE_DIR}/packaging/macosx/Info.plist
554         @ONLY)
555
556 include(FeatureSummary)
557 #SET_FEATURE_INFO(NAME DESCRIPTION [URL [COMMENT] ]
558 #FEATURE_SUMMARY(WHAT ALL) Requires removal of our local copy of FeatureSummary
559 PRINT_ENABLED_FEATURES()
560 PRINT_DISABLED_FEATURES()
561
562 link_directories(
563         ${CMAKE_BINARY_DIR}/ui
564         ${CMAKE_BINARY_DIR}/ui/gtk
565         ${CMAKE_BINARY_DIR}/ui/qt
566         ${CMAKE_BINARY_DIR}/codecs
567         ${CMAKE_BINARY_DIR}/epan
568         ${CMAKE_BINARY_DIR}/wiretap
569         ${CMAKE_BINARY_DIR}/wsutil
570 )
571
572 ADD_CUSTOM_TARGET(
573         svnversion ALL
574         COMMAND ${PERL}
575                 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
576                 ${CMAKE_CURRENT_SOURCE_DIR}
577         DEPENDS
578                 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
579 )
580
581 ADD_CUSTOM_COMMAND(
582         OUTPUT  svnversion.h
583         COMMAND ${PERL}
584                 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
585                 ${CMAKE_CURRENT_SOURCE_DIR}
586         DEPENDS
587                 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
588 )
589
590 ADD_CUSTOM_COMMAND(
591         OUTPUT  ps.c
592         COMMAND ${PYTHON_EXECUTABLE}
593                 ${CMAKE_CURRENT_SOURCE_DIR}/tools/rdps.py
594                 ${CMAKE_CURRENT_SOURCE_DIR}/print.ps
595                 ps.c
596         DEPENDS
597                 ${CMAKE_CURRENT_SOURCE_DIR}/tools/rdps.py
598                 ${CMAKE_CURRENT_SOURCE_DIR}/print.ps
599 )
600
601 if(UNIX)
602         set(PLATFORM_SRC
603                 capture-pcap-util-unix.c capture_unix_ifnames.c
604         )
605 endif()
606
607 if(WIN32)
608         set(PLATFORM_SRC
609                 capture-wpcap.c capture_wpcap_packet.c capture_win_ifnames.c
610         )
611 endif()
612
613 set(WTAP_PLUGIN_SOURCES
614         epan/plugins.c
615         epan/report_err.c
616         epan/filesystem.c
617 )
618
619 set(SHARK_COMMON_CAPTURE_SRC
620         capture_ifinfo.c
621         capture_ui_utils.c
622 )
623
624 set(WIRESHARK_COMMON_SRC
625         ${PLATFORM_SRC}
626         capture-pcap-util.c
627         cfile.c
628         cfutils.c
629         clopts_common.c
630         disabled_protos.c
631         frame_data_sequence.c
632         packet-range.c
633         print.c
634         ps.c
635         svnversion.h
636         sync_pipe_write.c
637         timestats.c
638         tap-megaco-common.c
639         tap-rtp-common.c
640         version_info.c
641 )
642
643 set(TSHARK_TAP_SRC
644         ui/cli/tap-afpstat.c
645         ui/cli/tap-ansi_astat.c
646         ui/cli/tap-bootpstat.c
647         ui/cli/tap-camelcounter.c
648         ui/cli/tap-camelsrt.c
649         ui/cli/tap-comparestat.c
650         ui/cli/tap-dcerpcstat.c
651         ui/cli/tap-diameter-avp.c
652         ui/cli/tap-expert.c
653         ui/cli/tap-follow.c
654         ui/cli/tap-funnel.c
655         ui/cli/tap-gsm_astat.c
656         ui/cli/tap-h225counter.c
657         ui/cli/tap-h225rassrt.c
658         ui/cli/tap-hosts.c
659         ui/cli/tap-httpstat.c
660         ui/cli/tap-icmpstat.c
661         ui/cli/tap-icmpv6stat.c
662         ui/cli/tap-iostat.c
663         ui/cli/tap-iousers.c
664         ui/cli/tap-macltestat.c
665         ui/cli/tap-mgcpstat.c
666         ui/cli/tap-megacostat.c
667         ui/cli/tap-protocolinfo.c
668         ui/cli/tap-protohierstat.c
669         ui/cli/tap-radiusstat.c
670         ui/cli/tap-rlcltestat.c
671         ui/cli/tap-rpcstat.c
672         ui/cli/tap-rpcprogs.c
673         ui/cli/tap-rtp.c
674         ui/cli/tap-rtspstat.c
675         ui/cli/tap-scsistat.c
676         ui/cli/tap-sctpchunkstat.c
677         ui/cli/tap-sipstat.c
678         ui/cli/tap-smbsids.c
679         ui/cli/tap-smbstat.c
680         ui/cli/tap-stats_tree.c
681         ui/cli/tap-sv.c
682         ui/cli/tap-wspstat.c
683 )
684
685 set(INSTALL_DIRS
686         diameter
687         dtds
688         help
689         radius
690         tpncp
691         wimaxasncp
692 )
693
694 set(INSTALL_FILES
695         ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
696         COPYING
697         ${CMAKE_BINARY_DIR}/capinfos.html
698         cfilters
699         colorfilters
700         dfilters
701         ${CMAKE_BINARY_DIR}/dftest.html
702         ${CMAKE_BINARY_DIR}/dumpcap.html
703         ${CMAKE_BINARY_DIR}/editcap.html
704         ${CMAKE_BINARY_DIR}/asn2deb.html
705         ${CMAKE_BINARY_DIR}/idl2deb.html
706         ${CMAKE_BINARY_DIR}/idl2wrs.html
707         ipmap.html
708         manuf
709         ${CMAKE_BINARY_DIR}/mergecap.html
710         pdml2html.xsl
711         ${CMAKE_BINARY_DIR}/randpkt.html
712         ${CMAKE_BINARY_DIR}/rawshark.html
713         ${CMAKE_BINARY_DIR}/reordercap.html
714         services
715         smi_modules
716         ${CMAKE_BINARY_DIR}/text2pcap.html
717         ${CMAKE_BINARY_DIR}/tshark.html
718         ${CMAKE_BINARY_DIR}/wireshark-filter.html
719         ${CMAKE_BINARY_DIR}/wireshark.html
720         docbook/ws.css
721 )
722
723 set(LIBEPAN_LIBS
724 #               @NSL_LIBS@      # -lnsl
725 #               @SOCKET_LIBS@   # -lsocket
726 #               @SSL_LIBS@      # -lcrypto
727                 epan
728 #               $(plugin_ldadd) # in case of static
729                 ${PCAP_LIBRARIES}
730                 ${CARES_LIBRARIES}
731                 ${ADNS_LIBRARIES}
732                 ${KERBEROS_LIBRARIES}
733                 ${LUA_LIBRARIES}
734                 ${PYTHON_LIBRARIES}
735                 ${GEOIP_LIBRARIES}
736                 ${GCRYPT_LIBRARIES}
737                 ${GNUTLS_LIBRARIES}
738                 ${SMI_LIBRARIES}
739                 ${ZLIB_LIBRARIES}
740                 ${M_LIBRARIES}
741 )
742
743 if( (BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND) )
744         set(wireshark_FILES
745                 airpcap_loader.c
746                 capture.c
747                 capture_info.c
748                 capture_opts.c
749                 capture_sync.c
750                 color_filters.c
751                 file.c
752                 fileset.c
753                 filters.c
754                 g711.c
755                 iface_monitor.c
756                 merge.c
757                 proto_hier_stats.c
758                 summary.c
759                 tempfile.c
760                 u3.c
761                 ws80211_utils.c
762                 ${SHARK_COMMON_CAPTURE_SRC}
763                 ${WIRESHARK_COMMON_SRC}
764         )
765 endif()
766
767 if(BUILD_wireshark AND GTK_FOUND)
768         set(wireshark_LIBS
769                 gtkui
770                 ui
771                 ui_dirty
772                 ${GTK2_LIBRARIES}
773                 ${GTK3_LIBRARIES}
774                 ${GTHREAD2_LIBRARIES}
775                 codecs
776                 ${PORTAUDIO_LIBRARIES}
777                 ${LIBEPAN_LIBS}
778                 ${APPLE_APPLICATION_SERVICES_LIBRARY}
779                 ${APPLE_CORE_SERVICES_LIBRARY}
780                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
781                 ${NL_LIBRARIES}
782         )
783         # qtshark and wireshark share wireshark_FILES
784
785         add_executable(wireshark ${wireshark_FILES})
786         add_dependencies(wireshark svnversion)
787         set_target_properties(wireshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
788         target_link_libraries(wireshark ${wireshark_LIBS})
789         install(TARGETS wireshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
790 endif()
791
792 if(BUILD_qtshark AND QT_FOUND)
793         set(qtshark_LIBS
794                 qtui
795                 ui
796                 ui_dirty
797                 ${QT_LIBRARIES}
798                 ${GTHREAD2_LIBRARIES}
799                 codecs
800                 ${PORTAUDIO_LIBRARIES}
801                 ${LIBEPAN_LIBS}
802                 ${APPLE_APPLICATION_SERVICES_LIBRARY}
803                 ${APPLE_CORE_FOUNDATION_LIBRARY}
804                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
805                 ${NL_LIBRARIES}
806         )
807         # qtshark and wireshark share wireshark_FILES
808
809         add_executable(qtshark ${wireshark_FILES})
810         add_dependencies(qtshark svnversion)
811         set_target_properties(qtshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
812         target_link_libraries(qtshark ${qtshark_LIBS})
813         install(TARGETS qtshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
814 endif()
815
816 register_tap_files(tshark-tap-register.c
817         ${TSHARK_TAP_SRC}
818 )
819
820 if(BUILD_tshark)
821         set(tshark_LIBS
822                 ${LIBEPAN_LIBS}
823                 ${APPLE_CORE_FOUNDATION_LIBRARY}
824                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
825         )
826         set(tshark_FILES
827                 capture_opts.c
828                 capture_sync.c
829                 tempfile.c
830                 tshark-tap-register.c
831                 tshark.c
832                 ui/util.c
833                 ${TSHARK_TAP_SRC}
834                 ${SHARK_COMMON_CAPTURE_SRC}
835                 ${WIRESHARK_COMMON_SRC}
836         )
837         add_executable(tshark ${tshark_FILES})
838         add_dependencies(tshark svnversion)
839         set_target_properties(tshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
840         target_link_libraries(tshark ${tshark_LIBS})
841         install(TARGETS tshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
842 endif()
843
844 if(BUILD_rawshark AND PCAP_FOUND)
845         set(rawshark_LIBS
846                 ${LIBEPAN_LIBS}
847                 ${APPLE_CORE_FOUNDATION_LIBRARY}
848                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
849         )
850         set(rawshark_FILES
851                 ${WIRESHARK_COMMON_SRC}
852                 rawshark.c
853                 ui/util.c
854         )
855         add_executable(rawshark ${rawshark_FILES})
856         add_dependencies(rawshark svnversion)
857         set_target_properties(rawshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
858         target_link_libraries(rawshark ${rawshark_LIBS})
859         install(TARGETS rawshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
860 endif()
861
862 if(BUILD_dftest)
863         set(dftest_LIBS
864                 ${LIBEPAN_LIBS}
865         )
866         set(dftest_FILES
867                 dftest.c
868                 ui/util.c
869         )
870         add_executable(dftest ${dftest_FILES})
871         set_target_properties(dftest PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
872         target_link_libraries(dftest ${dftest_LIBS})
873         install(TARGETS dftest RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
874 endif()
875
876 if(BUILD_randpkt)
877         set(randpkt_LIBS
878                 wiretap
879                 ${M_LIBRARIES}
880                 ${PCAP_LIBRARIES}
881 #               @SOCKET_LIBS@
882 #               @NSL_LIBS@
883                 ${CARES_LIBRARIES}
884                 ${ADNS_LIBRARIES}
885                 ${ZLIB_LIBRARIES}
886         )
887         set(randpkt_FILES
888                 randpkt.c
889         )
890         add_executable(randpkt ${randpkt_FILES})
891         set_target_properties(randpkt PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
892         target_link_libraries(randpkt ${randpkt_LIBS})
893         install(TARGETS randpkt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
894 endif()
895
896 if(BUILD_text2pcap)
897         set(text2pcap_LIBS
898                 wsutil
899                 ${M_LIBRARIES}
900                 ${ZLIB_LIBRARIES}
901         )
902         set(text2pcap_CLEAN_FILES
903                 text2pcap.c
904                 pcapio.c
905         )
906         set(text2pcap_FILES
907                 ${text2pcap_CLEAN_FILES}
908         )
909         add_lex_files(text2pcap_FILES
910                 text2pcap-scanner.l
911         )
912         add_executable(text2pcap ${text2pcap_FILES})
913         add_dependencies(text2pcap svnversion)
914         set_target_properties(text2pcap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
915         target_link_libraries(text2pcap ${text2pcap_LIBS})
916         install(TARGETS text2pcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
917 endif()
918
919 if(BUILD_mergecap)
920         set(mergecap_LIBS
921                 wiretap
922                 ${ZLIB_LIBRARIES}
923         )
924         set(mergecap_FILES
925                 mergecap.c
926                 merge.c
927                 svnversion.h
928                 ${WTAP_PLUGIN_SOURCES}
929         )
930         add_executable(mergecap ${mergecap_FILES})
931         add_dependencies(mergecap svnversion)
932         set_target_properties(mergecap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
933         target_link_libraries(mergecap ${mergecap_LIBS})
934         install(TARGETS mergecap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
935 endif()
936
937 if(BUILD_reordercap)
938         set(reordercap_LIBS
939                 wiretap
940                 ${ZLIB_LIBRARIES}
941         )
942         set(reordercap_FILES
943                 reordercap.c
944                 svnversion.h
945                 ${WTAP_PLUGIN_SOURCES}
946         )
947         add_executable(reordercap ${reordercap_FILES})
948         add_dependencies(reordercap svnversion)
949         set_target_properties(reordercap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
950         target_link_libraries(reordercap ${reordercap_LIBS})
951         install(TARGETS reordercap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
952 endif()
953
954 if(BUILD_capinfos)
955         set(capinfos_LIBS
956                 wiretap
957                 wsutil
958                 ${ZLIB_LIBRARIES}
959                 ${GCRYPT_LIBRARIES}
960         )
961         set(capinfos_FILES
962                 capinfos.c
963                 ${WTAP_PLUGIN_SOURCES}
964         )
965         add_executable(capinfos ${capinfos_FILES})
966         add_dependencies(capinfos svnversion)
967         set_target_properties(capinfos PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
968         target_link_libraries(capinfos ${capinfos_LIBS})
969         install(TARGETS capinfos RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
970 endif()
971
972 if(BUILD_editcap)
973         set(editcap_LIBS
974                 wiretap
975                 ${ZLIB_LIBRARIES}
976         )
977         set(editcap_FILES
978                 editcap.c
979                 epan/crypt/md5.c
980                 epan/nstime.c
981                 ${WTAP_PLUGIN_SOURCES}
982         )
983         add_executable(editcap ${editcap_FILES})
984         add_dependencies(editcap svnversion)
985         set_target_properties(editcap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
986         target_link_libraries(editcap ${editcap_LIBS})
987         install(TARGETS editcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
988 endif()
989
990 if(BUILD_dumpcap AND PCAP_FOUND)
991         set(dumpcap_LIBS
992 #               @INET_NTOP_LO@
993                 wsutil
994                 ${PCAP_LIBRARIES}
995                 ${CAP_LIBRARIES}
996 #               @SOCKET_LIBS@
997 #               @NSL_LIBS@
998                 ${GLIB2_LIBRARIES}
999                 ${GTHREAD2_LIBRARIES}
1000                 ${ZLIB_LIBRARIES}
1001                 ${APPLE_CORE_FOUNDATION_LIBRARY}
1002                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
1003                 ${NL_LIBRARIES}
1004         )
1005         set(dumpcap_FILES
1006                 svnversion.h
1007                 capture_opts.c
1008                 capture-pcap-util.c
1009                 capture_stop_conditions.c
1010                 cfutils.c
1011                 clopts_common.c
1012                 conditions.c
1013                 dumpcap.c
1014                 pcapio.c
1015                 ringbuffer.c
1016                 sync_pipe_write.c
1017                 tempfile.c
1018                 version_info.c
1019                 ws80211_utils.c
1020                 ${PLATFORM_SRC}
1021         )
1022         add_executable(dumpcap ${dumpcap_FILES})
1023         add_dependencies(dumpcap svnversion)
1024         set_target_properties(dumpcap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
1025         target_link_libraries(dumpcap ${dumpcap_LIBS})
1026         install(TARGETS dumpcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1027 endif()
1028
1029 ADD_CUSTOM_COMMAND(
1030         OUTPUT  ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1031         COMMAND ${PERL}
1032                 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1033                 ${CMAKE_SOURCE_DIR}/doc/make-authors-short.pl
1034                 < ${CMAKE_SOURCE_DIR}/AUTHORS
1035                 > ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1036         DEPENDS
1037                 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1038                 ${CMAKE_SOURCE_DIR}/doc/make-authors-short.pl
1039                 ${CMAKE_SOURCE_DIR}/AUTHORS
1040 )
1041
1042 ADD_CUSTOM_COMMAND(
1043         OUTPUT  ${CMAKE_BINARY_DIR}/AUTHORS-SHORT-FORMAT
1044                 ${CMAKE_BINARY_DIR}/wireshark.pod
1045         COMMAND ${PERL}
1046                 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1047                 ${CMAKE_SOURCE_DIR}/doc/make-authors-format.pl
1048                 < ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1049                 > ${CMAKE_BINARY_DIR}/AUTHORS-SHORT-FORMAT
1050         COMMAND cat
1051                 ${CMAKE_SOURCE_DIR}/doc/wireshark.pod.template
1052                 ${CMAKE_BINARY_DIR}/AUTHORS-SHORT-FORMAT
1053                 > ${CMAKE_BINARY_DIR}/wireshark.pod
1054         DEPENDS
1055                 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1056                 ${CMAKE_SOURCE_DIR}/doc/make-authors-format.pl
1057                 ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1058                 ${CMAKE_SOURCE_DIR}/doc/wireshark.pod.template
1059 )
1060
1061 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/capinfos 1 )
1062 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/dftest 1 )
1063 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/dumpcap 1 )
1064 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/editcap 1 )
1065 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/asn2deb 1 )
1066 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/idl2deb 1 )
1067 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/idl2wrs 1 )
1068 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/mergecap 1 )
1069 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/randpkt 1 )
1070 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/rawshark 1 )
1071 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/reordercap 1 )
1072 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/text2pcap 1 )
1073 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/tshark 1 )
1074 pod2manhtml( wireshark 1 )
1075 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/wireshark-filter 4 )
1076
1077 add_custom_target(
1078         auxiliary ALL
1079         DEPENDS
1080                 AUTHORS-SHORT
1081                 capinfos.html
1082                 dftest.html
1083                 dumpcap.html
1084                 editcap.html
1085                 asn2deb.html
1086                 idl2deb.html
1087                 idl2wrs.html
1088                 mergecap.html
1089                 randpkt.html
1090                 rawshark.html
1091                 reordercap.html
1092                 text2pcap.html
1093                 tshark.html
1094                 wireshark.html
1095                 wireshark-filter.html
1096 )
1097
1098 set(MAN1_FILES
1099         ${CMAKE_BINARY_DIR}/capinfos.1
1100         ${CMAKE_BINARY_DIR}/dftest.1
1101         ${CMAKE_BINARY_DIR}/dumpcap.1
1102         ${CMAKE_BINARY_DIR}/editcap.1
1103         ${CMAKE_BINARY_DIR}/idl2wrs.1
1104         ${CMAKE_BINARY_DIR}/mergecap.1
1105         ${CMAKE_BINARY_DIR}/randpkt.1
1106         ${CMAKE_BINARY_DIR}/rawshark.1
1107         ${CMAKE_BINARY_DIR}/reordercap.1
1108         ${CMAKE_BINARY_DIR}/text2pcap.1
1109         ${CMAKE_BINARY_DIR}/tshark.1
1110         ${CMAKE_BINARY_DIR}/wireshark.1
1111 )
1112
1113 set(MAN4_FILES
1114         ${CMAKE_BINARY_DIR}/wireshark-filter.4
1115 )
1116
1117 set(CLEAN_FILES
1118         ${wireshark_FILES}
1119         ${tshark_FILES}
1120         ${rawshark_FILES}
1121         ${dftest_FILES}
1122         ${randpkt_FILES}
1123         ${text2pcap_CLEAN_FILES}
1124         ${mergecap_FILES}
1125         ${capinfos_FILES}
1126         ${editcap_FILES}
1127         ${dumpcap_FILES}
1128 )
1129
1130 if (WERROR)
1131         set_source_files_properties(
1132                 ${CLEAN_FILES}
1133                 PROPERTIES
1134                 COMPILE_FLAGS -Werror
1135         )
1136 endif()
1137
1138 install(
1139         FILES
1140                 ${INSTALL_FILES}
1141         DESTINATION
1142                 ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}
1143 )
1144
1145 install(
1146         FILES
1147                 ${MAN1_FILES}
1148         DESTINATION
1149                 ${CMAKE_INSTALL_MANDIR}/man1
1150 )
1151
1152 install(
1153         FILES
1154                 ${MAN4_FILES}
1155         DESTINATION
1156                 ${CMAKE_INSTALL_MANDIR}/man4
1157 )
1158
1159 install(
1160         DIRECTORY
1161                 ${INSTALL_DIRS}
1162         DIRECTORY_PERMISSIONS
1163                 OWNER_EXECUTE OWNER_WRITE OWNER_READ
1164                 GROUP_EXECUTE GROUP_READ
1165                 WORLD_EXECUTE WORLD_READ
1166         DESTINATION
1167                 ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}
1168         PATTERN ".svn" EXCLUDE
1169         PATTERN "Makefile.*" EXCLUDE
1170         PATTERN "faq.py" EXCLUDE
1171 )
1172
1173
1174 if(DOC_DIR)
1175         message(STATUS "Docdir install: ${DOC_DIR}")
1176         INSTALL(
1177                 DIRECTORY
1178                         ${CMAKE_BINARY_DIR}/docbook/
1179                 DIRECTORY_PERMISSIONS
1180                         OWNER_EXECUTE OWNER_WRITE OWNER_READ
1181                         GROUP_EXECUTE GROUP_READ
1182                         WORLD_EXECUTE WORLD_READ
1183                 DESTINATION
1184                         ${DOC_DIR}/guides
1185                 FILES_MATCHING
1186                 PATTERN "*.pdf"
1187         )
1188 endif()