Add Qt5 build support with cmake. Just do cmake ... -DENABLE_QT5=ON ...
[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         -Wc++-compat
134         -Wdeclaration-after-statement
135         -Wno-pointer-sign
136         -Wold-style-definition
137         -Wshadow
138 )
139
140 set(WIRESHARK_EXTRA_C_FLAGS
141         -pedantic
142         -Woverflow
143         -Wlogical-op
144         -Wno-overlength-strings
145         -fstrict-overflow -Wstrict-overflow=4
146         -Wunreachable-code
147         -Wunsafe-loop-optimizations
148         -Wno-long-long
149         -Wcast-qual
150         -Waddress
151         -Warray-bounds
152         -Wattributes
153         -Wdiv-by-zero
154         -Wformat-security
155         -Wignored-qualifiers
156         -Wpragmas
157         -Wredundant-decls
158         -Wvla
159         # packet-ncp2222.inc prevents this from going into all warnings
160         -Wwrite-strings
161         # All the registration functions block these for now.
162         -Wmissing-declarations
163         # Problem with packet-afs.c
164         -Wshadow
165         # More cleanup needed for this on LP64
166         -Wshorten-64-to-32
167
168 )
169
170 set(WIRESHARK_EXTRA_C_ONLY_FLAGS
171         # The following are C only, not C++
172         -Wbad-function-cast
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         if(ENABLE_QT5)
303                 set(PACKAGELIST ${PACKAGELIST} Qt5Widgets Qt5PrintSupport Qt5LinguistTools)
304                 set(QT_VERSION 5)
305         else()
306                 set(PACKAGELIST ${PACKAGELIST} QT)
307                 # set(QT_OPTIONS 4.7.1 REQUIRED QtCore QtGui)
308                 set(QT_VERSION 5)
309         endif()
310 endif()
311
312 # SMI SNMP
313 if(ENABLE_SMI)
314         set(PACKAGELIST ${PACKAGELIST} SMI)
315 endif()
316
317 # GNU crypto
318 if(ENABLE_GCRYPT)
319         set(PACKAGELIST ${PACKAGELIST} GCRYPT)
320 endif()
321
322 # GNU SSL/TLS support
323 if(ENABLE_GNUTLS)
324         set(PACKAGELIST ${PACKAGELIST} GNUTLS)
325 endif()
326
327 # Kerberos
328 if(ENABLE_KERBEROS)
329         set(PACKAGELIST ${PACKAGELIST} KERBEROS)
330 endif()
331
332 # Portable audio
333 if(ENABLE_PORTAUDIO)
334         set(PACKAGELIST ${PACKAGELIST} PORTAUDIO)
335 endif()
336
337
338 # Prefer c-ares over adns
339 if(ENABLE_CARES)        # C Asynchronouse resolver
340         set(PACKAGELIST ${PACKAGELIST} CARES)
341 elseif(ENABLE_ADNS)     # Gnu asynchronous DNS
342         set(PACKAGELIST ${PACKAGELIST} ADNS)
343 endif()
344
345 # Zlib compression
346 if(ENABLE_ZLIB)
347         set(PACKAGELIST ${PACKAGELIST} ZLIB)
348 endif()
349
350 # Lua 5.1 dissectors
351 if(ENABLE_LUA)
352         set(PACKAGELIST ${PACKAGELIST} LUA)
353 endif()
354
355 # GeoIP address resolving
356 if(ENABLE_GEOIP)
357         set(PACKAGELIST ${PACKAGELIST} GEOIP)
358 endif()
359
360 if(ENABLE_NETLINK)
361         set(PACKAGELIST ${PACKAGELIST} NL)
362 endif()
363
364 # Capabilities
365 if(ENABLE_CAP)
366         set(PACKAGELIST ${PACKAGELIST} CAP)
367 endif()
368
369 if(ENABLE_PYTHON)
370         set(PACKAGELIST ${PACKAGELIST} PYTHON)
371 endif()
372
373 set(PACKAGELIST ${PACKAGELIST} YAPP)
374
375 set(PACKAGELIST ${PACKAGELIST} POD)
376
377
378 set(PROGLIST text2pcap mergecap capinfos editcap reordercap dumpcap)
379
380 #Let's loop the package list
381 foreach(PACKAGE ${PACKAGELIST})
382         if(${PACKAGE} STREQUAL "QT")
383                 set(PACKAGE_NAME "Qt4")
384         else()
385                 set(PACKAGE_NAME ${PACKAGE})
386         endif()
387         if(${PACKAGE}_OPTIONS)
388                 find_package(${PACKAGE_NAME} ${${PACKAGE}_OPTIONS})
389         elseif(${PACKAGE}_REQUIRED)
390                 find_package(${PACKAGE_NAME} REQUIRED)
391         else()
392                 find_package(${PACKAGE_NAME})
393         endif()
394         message(${PACKAGE}_FOUND)
395         if (${PACKAGE}_FOUND)
396                 set(HAVE_LIB${PACKAGE} 1)
397                 include_directories(${${PACKAGE}_INCLUDE_DIRS})
398                 message(STATUS "${PACKAGE} includes: ${${PACKAGE}_INCLUDE_DIRS}")
399                 message(STATUS "${PACKAGE} libs: ${${PACKAGE}_LIBRARIES}")
400                 if (${PACKAGE}_DEFINITIONS)
401                         message(STATUS "${PACKAGE} definitions: ${${PACKAGE}_DEFINITIONS}")
402                 endif()
403         endif()
404 endforeach()
405
406 #packaging
407 include(CPackConfig.txt)
408
409 if(HAVE_LIBPYTHON)
410         set(HAVE_PYTHON 1)
411         set(PYTHON_DIR "${CMAKE_INSTALL_PREFIX}/lib/wireshark/python/${CPACK_PACKAGE_VERSION}")
412 endif()
413 if(HAVE_LIBLUA)
414         set(HAVE_LUA_H 1)
415         set(HAVE_LUA 1)
416 endif()
417 if(HAVE_LIBKERBEROS)
418         set(HAVE_KERBEROS 1)
419         # HAVE_HEIMDAL_KERBEROS
420         set(HAVE_MIT_KERBEROS 1)
421         set(HAVE_KEYTYPE_ARCFOUR_56 1)
422 endif()
423 if(HAVE_LIBGEOIP)
424         set(HAVE_GEOIP 1)
425 endif()
426 if(HAVE_LIBCARES)
427         set(HAVE_C_ARES 1)
428 endif()
429 if(HAVE_LIBADNS)
430         set(HAVE_GNU_ADNS 1)
431 endif()
432 if(ENABLE_AIRPCAP)
433         set(HAVE_AIRPCAP 1)
434 endif()
435 if(HAVE_LIBNL AND ENABLE_AIRPCAP)
436         message(ERROR "Airpcap and Libnl support are mutually exclusive")
437 endif()
438 # No matter which version of GTK is present
439 if(GTK2_FOUND OR GTK3_FOUND)
440         set(GTK_FOUND ON)
441 endif()
442 # That's the name autofoo uses
443 if(HAVE_LIBZLIB)
444         set(HAVE_LIBZ 1)
445 endif()
446 if (Qt5Widgets_FOUND)
447         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
448         if (Qt5_POSITION_INDEPENDENT_CODE)
449                 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
450         endif()
451         set (QT_FOUND ON)
452         set (QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5PrintSupport_LIBRARIES})
453 # If Qt4: QT_LIBRARIES and QT_INCLUDES are not set above. They require extra magic
454 elseif(QT_FOUND)
455         include(${QT_USE_FILE})
456         include_directories(${QT_INCLUDE_DIR})
457         message(STATUS "QT includes: ${QT_INCLUDE_DIR}")
458         message(STATUS "QT libs: ${QT_LIBRARIES}")
459 endif()
460
461 include(ConfigureChecks.cmake)
462
463 #Big or little endian ?
464 include(TestBigEndian)
465 test_big_endian(WORDS_BIGENDIAN)
466
467 set(DATAFILE_DIR "${CMAKE_INSTALL_PREFIX}/share/${CPACK_PACKAGE_NAME}")
468
469 if(ENABLE_PLUGINS)
470         set(HAVE_PLUGINS 1)
471         set(PLUGIN_DIR="${DATAFILE_DIR}/plugins/${CPACK_PACKAGE_VERSION}")
472         set(PLUGIN_SRC_DIRS
473                 plugins/asn1
474                 plugins/docsis
475                 plugins/ethercat
476                 plugins/gryphon
477                 plugins/irda
478                 plugins/m2m
479                 plugins/mate
480                 plugins/opcua
481                 plugins/profinet
482                 plugins/stats_tree
483                 plugins/unistim
484                 plugins/wimax
485                 plugins/wimaxasncp
486                 plugins/wimaxmacphy
487         )
488 # It seems this stuff doesn't build with autofoo either...
489 #       if(YAPP_FOUND)
490 #               set(PLUGIN_SRC_DIRS
491 #                       ${PLUGIN_SRC_DIRS}
492 #                       plugins/tpg
493 #               )
494 #       endif()
495 else()
496         set(PLUGIN_SRC_DIRS )
497 endif()
498
499 foreach(PLUGIN_DIR ${PLUGIN_SRC_DIRS})
500         add_subdirectory( ${PLUGIN_DIR} )
501 endforeach()
502
503 add_subdirectory( asn1 EXCLUDE_FROM_ALL )
504 add_subdirectory( codecs )
505 add_subdirectory( epan )
506 add_subdirectory( tools/lemon )
507 add_subdirectory( wiretap )
508 add_subdirectory( wsutil )
509
510 add_custom_target(dumpabi DEPENDS dumpabi-libwireshark dumpabi-libwiretap dumpabi-libwsutil color.h)
511
512 if((BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND))
513         add_subdirectory( ui )
514 endif()
515
516 if(BUILD_wireshark AND GTK_FOUND)
517         add_subdirectory( ui/gtk )
518 endif()
519
520 if(BUILD_qtshark AND QT_FOUND)
521         add_subdirectory( ui/qt )
522 endif()
523
524
525 # Basedir where to install guides
526 set(DOC_DIR "$ENV{docdir}" CACHE FILEPATH "Installation directory for ug and dg pdfs.")
527 message(STATUS "docdir: ${DOC_DIR}")
528
529 if(ENABLE_GUIDES)
530         add_subdirectory( docbook )
531 endif()
532
533 if(ENABLE_PCAP_NG_DEFAULT)
534         set(PCAP_NG_DEFAULT 1)
535 endif()
536
537 #Platform specific
538 #if(UNIX)
539 #endif()
540
541 if(APPLE)
542         #
543         # We assume that APPLE means OS X so that we have the OS X
544         # frameworks.
545         #
546         set(HAVE_OS_X_FRAMEWORKS 1)
547         FIND_LIBRARY (APPLE_APPLICATION_SERVICES_LIBRARY ApplicationServices)
548         FIND_LIBRARY (APPLE_CORE_FOUNDATION_LIBRARY CoreFoundation)
549         FIND_LIBRARY (APPLE_SYSTEM_CONFIGURATION_LIBRARY SystemConfiguration)
550 endif()
551
552 if(WIN32)
553         set(WS_MSVC_NORETURN "__declspec(noreturn)")
554
555         # Disable deprecation
556         if(MSVC80 OR MSVC90)
557                 add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
558         endif()
559 else()
560         set(WS_MSVC_NORETURN " ")
561 endif()
562
563 configure_file(${CMAKE_SOURCE_DIR}/cmakeconfig.h.in ${CMAKE_BINARY_DIR}/config.h)
564
565 set( configure_input "Built with CMake ${CMAKE_VERSION}" )
566 set( VERSION ${PROJECT_VERSION} )
567
568 configure_file(
569         ${CMAKE_SOURCE_DIR}/packaging/macosx/Info.plist.in
570         ${CMAKE_SOURCE_DIR}/packaging/macosx/Info.plist
571         @ONLY)
572
573 include(FeatureSummary)
574 #SET_FEATURE_INFO(NAME DESCRIPTION [URL [COMMENT] ]
575 #FEATURE_SUMMARY(WHAT ALL) Requires removal of our local copy of FeatureSummary
576 PRINT_ENABLED_FEATURES()
577 PRINT_DISABLED_FEATURES()
578
579 link_directories(
580         ${CMAKE_BINARY_DIR}/ui
581         ${CMAKE_BINARY_DIR}/ui/gtk
582         ${CMAKE_BINARY_DIR}/ui/qt
583         ${CMAKE_BINARY_DIR}/codecs
584         ${CMAKE_BINARY_DIR}/epan
585         ${CMAKE_BINARY_DIR}/wiretap
586         ${CMAKE_BINARY_DIR}/wsutil
587 )
588
589 ADD_CUSTOM_TARGET(
590         svnversion ALL
591         COMMAND ${PERL}
592                 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
593                 ${CMAKE_CURRENT_SOURCE_DIR}
594         DEPENDS
595                 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
596 )
597
598 ADD_CUSTOM_COMMAND(
599         OUTPUT  svnversion.h
600         COMMAND ${PERL}
601                 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
602                 ${CMAKE_CURRENT_SOURCE_DIR}
603         DEPENDS
604                 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
605 )
606
607 ADD_CUSTOM_COMMAND(
608         OUTPUT  ps.c
609         COMMAND ${PYTHON_EXECUTABLE}
610                 ${CMAKE_CURRENT_SOURCE_DIR}/tools/rdps.py
611                 ${CMAKE_CURRENT_SOURCE_DIR}/print.ps
612                 ps.c
613         DEPENDS
614                 ${CMAKE_CURRENT_SOURCE_DIR}/tools/rdps.py
615                 ${CMAKE_CURRENT_SOURCE_DIR}/print.ps
616 )
617
618 if(UNIX)
619         set(PLATFORM_SRC
620                 capture-pcap-util-unix.c capture_unix_ifnames.c
621         )
622 endif()
623
624 if(WIN32)
625         set(PLATFORM_SRC
626                 capture-wpcap.c capture_wpcap_packet.c capture_win_ifnames.c
627         )
628 endif()
629
630 set(WTAP_PLUGIN_SOURCES
631         epan/plugins.c
632         epan/report_err.c
633         epan/filesystem.c
634 )
635
636 set(SHARK_COMMON_CAPTURE_SRC
637         capture_ifinfo.c
638         capture_ui_utils.c
639 )
640
641 set(WIRESHARK_COMMON_SRC
642         ${PLATFORM_SRC}
643         capture-pcap-util.c
644         cfile.c
645         cfutils.c
646         clopts_common.c
647         disabled_protos.c
648         frame_data_sequence.c
649         packet-range.c
650         print.c
651         ps.c
652         svnversion.h
653         sync_pipe_write.c
654         timestats.c
655         tap-megaco-common.c
656         tap-rtp-common.c
657         version_info.c
658 )
659
660 set(TSHARK_TAP_SRC
661         ui/cli/tap-afpstat.c
662         ui/cli/tap-ansi_astat.c
663         ui/cli/tap-bootpstat.c
664         ui/cli/tap-camelcounter.c
665         ui/cli/tap-camelsrt.c
666         ui/cli/tap-comparestat.c
667         ui/cli/tap-dcerpcstat.c
668         ui/cli/tap-diameter-avp.c
669         ui/cli/tap-expert.c
670         ui/cli/tap-follow.c
671         ui/cli/tap-funnel.c
672         ui/cli/tap-gsm_astat.c
673         ui/cli/tap-h225counter.c
674         ui/cli/tap-h225rassrt.c
675         ui/cli/tap-hosts.c
676         ui/cli/tap-httpstat.c
677         ui/cli/tap-icmpstat.c
678         ui/cli/tap-icmpv6stat.c
679         ui/cli/tap-iostat.c
680         ui/cli/tap-iousers.c
681         ui/cli/tap-macltestat.c
682         ui/cli/tap-mgcpstat.c
683         ui/cli/tap-megacostat.c
684         ui/cli/tap-protocolinfo.c
685         ui/cli/tap-protohierstat.c
686         ui/cli/tap-radiusstat.c
687         ui/cli/tap-rlcltestat.c
688         ui/cli/tap-rpcstat.c
689         ui/cli/tap-rpcprogs.c
690         ui/cli/tap-rtp.c
691         ui/cli/tap-rtspstat.c
692         ui/cli/tap-scsistat.c
693         ui/cli/tap-sctpchunkstat.c
694         ui/cli/tap-sipstat.c
695         ui/cli/tap-smbsids.c
696         ui/cli/tap-smbstat.c
697         ui/cli/tap-stats_tree.c
698         ui/cli/tap-sv.c
699         ui/cli/tap-wspstat.c
700 )
701
702 set(INSTALL_DIRS
703         diameter
704         dtds
705         help
706         radius
707         tpncp
708         wimaxasncp
709 )
710
711 set(INSTALL_FILES
712         ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
713         COPYING
714         ${CMAKE_BINARY_DIR}/capinfos.html
715         cfilters
716         colorfilters
717         dfilters
718         ${CMAKE_BINARY_DIR}/dftest.html
719         ${CMAKE_BINARY_DIR}/dumpcap.html
720         ${CMAKE_BINARY_DIR}/editcap.html
721         ${CMAKE_BINARY_DIR}/asn2deb.html
722         ${CMAKE_BINARY_DIR}/idl2deb.html
723         ${CMAKE_BINARY_DIR}/idl2wrs.html
724         ipmap.html
725         manuf
726         ${CMAKE_BINARY_DIR}/mergecap.html
727         pdml2html.xsl
728         ${CMAKE_BINARY_DIR}/randpkt.html
729         ${CMAKE_BINARY_DIR}/rawshark.html
730         ${CMAKE_BINARY_DIR}/reordercap.html
731         services
732         smi_modules
733         ${CMAKE_BINARY_DIR}/text2pcap.html
734         ${CMAKE_BINARY_DIR}/tshark.html
735         ${CMAKE_BINARY_DIR}/wireshark-filter.html
736         ${CMAKE_BINARY_DIR}/wireshark.html
737         docbook/ws.css
738 )
739
740 set(LIBEPAN_LIBS
741 #               @NSL_LIBS@      # -lnsl
742 #               @SOCKET_LIBS@   # -lsocket
743 #               @SSL_LIBS@      # -lcrypto
744                 epan
745 #               $(plugin_ldadd) # in case of static
746                 ${PCAP_LIBRARIES}
747                 ${CARES_LIBRARIES}
748                 ${ADNS_LIBRARIES}
749                 ${KERBEROS_LIBRARIES}
750                 ${LUA_LIBRARIES}
751                 ${PYTHON_LIBRARIES}
752                 ${GEOIP_LIBRARIES}
753                 ${GCRYPT_LIBRARIES}
754                 ${GNUTLS_LIBRARIES}
755                 ${SMI_LIBRARIES}
756                 ${ZLIB_LIBRARIES}
757                 ${M_LIBRARIES}
758 )
759
760 if( (BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND) )
761         set(wireshark_FILES
762                 airpcap_loader.c
763                 capture.c
764                 capture_info.c
765                 capture_opts.c
766                 capture_sync.c
767                 color_filters.c
768                 file.c
769                 fileset.c
770                 filters.c
771                 g711.c
772                 iface_monitor.c
773                 merge.c
774                 proto_hier_stats.c
775                 summary.c
776                 tempfile.c
777                 u3.c
778                 ws80211_utils.c
779                 ${SHARK_COMMON_CAPTURE_SRC}
780                 ${WIRESHARK_COMMON_SRC}
781         )
782 endif()
783
784 if(BUILD_wireshark AND GTK_FOUND)
785         set(wireshark_LIBS
786                 gtkui
787                 ui
788                 ${GTK2_LIBRARIES}
789                 ${GTK3_LIBRARIES}
790                 ${GTHREAD2_LIBRARIES}
791                 codecs
792                 ${PORTAUDIO_LIBRARIES}
793                 ${LIBEPAN_LIBS}
794                 ${APPLE_APPLICATION_SERVICES_LIBRARY}
795                 ${APPLE_CORE_SERVICES_LIBRARY}
796                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
797                 ${NL_LIBRARIES}
798         )
799         # qtshark and wireshark share wireshark_FILES
800
801         add_executable(wireshark ${wireshark_FILES})
802         add_dependencies(wireshark svnversion)
803         set_target_properties(wireshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
804         target_link_libraries(wireshark ${wireshark_LIBS})
805         install(TARGETS wireshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
806 endif()
807
808 if(BUILD_qtshark AND QT_FOUND)
809         set(qtshark_LIBS
810                 qtui
811                 ui
812                 ${QT_LIBRARIES}
813                 ${GTHREAD2_LIBRARIES}
814                 codecs
815                 ${PORTAUDIO_LIBRARIES}
816                 ${LIBEPAN_LIBS}
817                 ${APPLE_APPLICATION_SERVICES_LIBRARY}
818                 ${APPLE_CORE_FOUNDATION_LIBRARY}
819                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
820                 ${NL_LIBRARIES}
821         )
822         # qtshark and wireshark share wireshark_FILES
823
824         add_executable(qtshark ${wireshark_FILES})
825         add_dependencies(qtshark svnversion)
826         set_target_properties(qtshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
827         target_link_libraries(qtshark ${qtshark_LIBS})
828         install(TARGETS qtshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
829 endif()
830
831 register_tap_files(tshark-tap-register.c
832         ${TSHARK_TAP_SRC}
833 )
834
835 if(BUILD_tshark)
836         set(tshark_LIBS
837                 ${LIBEPAN_LIBS}
838                 ${APPLE_CORE_FOUNDATION_LIBRARY}
839                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
840         )
841         set(tshark_FILES
842                 capture_opts.c
843                 capture_sync.c
844                 tempfile.c
845                 tshark-tap-register.c
846                 tshark.c
847                 ui/util.c
848                 ${TSHARK_TAP_SRC}
849                 ${SHARK_COMMON_CAPTURE_SRC}
850                 ${WIRESHARK_COMMON_SRC}
851         )
852         add_executable(tshark ${tshark_FILES})
853         add_dependencies(tshark svnversion)
854         set_target_properties(tshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
855         target_link_libraries(tshark ${tshark_LIBS})
856         install(TARGETS tshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
857 endif()
858
859 if(BUILD_rawshark AND PCAP_FOUND)
860         set(rawshark_LIBS
861                 ${LIBEPAN_LIBS}
862                 ${APPLE_CORE_FOUNDATION_LIBRARY}
863                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
864         )
865         set(rawshark_FILES
866                 ${WIRESHARK_COMMON_SRC}
867                 rawshark.c
868                 ui/util.c
869         )
870         add_executable(rawshark ${rawshark_FILES})
871         add_dependencies(rawshark svnversion)
872         set_target_properties(rawshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
873         target_link_libraries(rawshark ${rawshark_LIBS})
874         install(TARGETS rawshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
875 endif()
876
877 if(BUILD_dftest)
878         set(dftest_LIBS
879                 ${LIBEPAN_LIBS}
880         )
881         set(dftest_FILES
882                 dftest.c
883                 ui/util.c
884         )
885         add_executable(dftest ${dftest_FILES})
886         set_target_properties(dftest PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
887         target_link_libraries(dftest ${dftest_LIBS})
888         install(TARGETS dftest RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
889 endif()
890
891 if(BUILD_randpkt)
892         set(randpkt_LIBS
893                 wiretap
894                 ${M_LIBRARIES}
895                 ${PCAP_LIBRARIES}
896 #               @SOCKET_LIBS@
897 #               @NSL_LIBS@
898                 ${CARES_LIBRARIES}
899                 ${ADNS_LIBRARIES}
900                 ${ZLIB_LIBRARIES}
901         )
902         set(randpkt_FILES
903                 randpkt.c
904         )
905         add_executable(randpkt ${randpkt_FILES})
906         set_target_properties(randpkt PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
907         target_link_libraries(randpkt ${randpkt_LIBS})
908         install(TARGETS randpkt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
909 endif()
910
911 if(BUILD_text2pcap)
912         set(text2pcap_LIBS
913                 wsutil
914                 ${M_LIBRARIES}
915                 ${ZLIB_LIBRARIES}
916         )
917         set(text2pcap_CLEAN_FILES
918                 text2pcap.c
919                 pcapio.c
920         )
921         set(text2pcap_FILES
922                 ${text2pcap_CLEAN_FILES}
923         )
924         add_lex_files(text2pcap_FILES
925                 text2pcap-scanner.l
926         )
927         add_executable(text2pcap ${text2pcap_FILES})
928         add_dependencies(text2pcap svnversion)
929         set_target_properties(text2pcap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
930         target_link_libraries(text2pcap ${text2pcap_LIBS})
931         install(TARGETS text2pcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
932 endif()
933
934 if(BUILD_mergecap)
935         set(mergecap_LIBS
936                 wiretap
937                 ${ZLIB_LIBRARIES}
938         )
939         set(mergecap_FILES
940                 mergecap.c
941                 merge.c
942                 svnversion.h
943                 ${WTAP_PLUGIN_SOURCES}
944         )
945         add_executable(mergecap ${mergecap_FILES})
946         add_dependencies(mergecap svnversion)
947         set_target_properties(mergecap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
948         target_link_libraries(mergecap ${mergecap_LIBS})
949         install(TARGETS mergecap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
950 endif()
951
952 if(BUILD_reordercap)
953         set(reordercap_LIBS
954                 wiretap
955                 ${ZLIB_LIBRARIES}
956         )
957         set(reordercap_FILES
958                 reordercap.c
959                 svnversion.h
960                 ${WTAP_PLUGIN_SOURCES}
961         )
962         add_executable(reordercap ${reordercap_FILES})
963         add_dependencies(reordercap svnversion)
964         set_target_properties(reordercap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
965         target_link_libraries(reordercap ${reordercap_LIBS})
966         install(TARGETS reordercap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
967 endif()
968
969 if(BUILD_capinfos)
970         set(capinfos_LIBS
971                 wiretap
972                 wsutil
973                 ${ZLIB_LIBRARIES}
974                 ${GCRYPT_LIBRARIES}
975         )
976         set(capinfos_FILES
977                 capinfos.c
978                 ${WTAP_PLUGIN_SOURCES}
979         )
980         add_executable(capinfos ${capinfos_FILES})
981         add_dependencies(capinfos svnversion)
982         set_target_properties(capinfos PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
983         target_link_libraries(capinfos ${capinfos_LIBS})
984         install(TARGETS capinfos RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
985 endif()
986
987 if(BUILD_editcap)
988         set(editcap_LIBS
989                 wiretap
990                 ${ZLIB_LIBRARIES}
991         )
992         set(editcap_FILES
993                 editcap.c
994                 epan/crypt/md5.c
995                 epan/nstime.c
996                 ${WTAP_PLUGIN_SOURCES}
997         )
998         add_executable(editcap ${editcap_FILES})
999         add_dependencies(editcap svnversion)
1000         set_target_properties(editcap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
1001         target_link_libraries(editcap ${editcap_LIBS})
1002         install(TARGETS editcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1003 endif()
1004
1005 if(BUILD_dumpcap AND PCAP_FOUND)
1006         set(dumpcap_LIBS
1007 #               @INET_NTOP_LO@
1008                 wsutil
1009                 ${PCAP_LIBRARIES}
1010                 ${CAP_LIBRARIES}
1011 #               @SOCKET_LIBS@
1012 #               @NSL_LIBS@
1013                 ${GLIB2_LIBRARIES}
1014                 ${GTHREAD2_LIBRARIES}
1015                 ${ZLIB_LIBRARIES}
1016                 ${APPLE_CORE_FOUNDATION_LIBRARY}
1017                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
1018                 ${NL_LIBRARIES}
1019         )
1020         set(dumpcap_FILES
1021                 svnversion.h
1022                 capture_opts.c
1023                 capture-pcap-util.c
1024                 capture_stop_conditions.c
1025                 cfutils.c
1026                 clopts_common.c
1027                 conditions.c
1028                 dumpcap.c
1029                 pcapio.c
1030                 ringbuffer.c
1031                 sync_pipe_write.c
1032                 tempfile.c
1033                 version_info.c
1034                 ws80211_utils.c
1035                 ${PLATFORM_SRC}
1036         )
1037         add_executable(dumpcap ${dumpcap_FILES})
1038         add_dependencies(dumpcap svnversion)
1039         set_target_properties(dumpcap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
1040         target_link_libraries(dumpcap ${dumpcap_LIBS})
1041         install(TARGETS dumpcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1042 endif()
1043
1044 ADD_CUSTOM_COMMAND(
1045         OUTPUT  ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1046         COMMAND ${PERL}
1047                 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1048                 ${CMAKE_SOURCE_DIR}/doc/make-authors-short.pl
1049                 < ${CMAKE_SOURCE_DIR}/AUTHORS
1050                 > ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1051         DEPENDS
1052                 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1053                 ${CMAKE_SOURCE_DIR}/doc/make-authors-short.pl
1054                 ${CMAKE_SOURCE_DIR}/AUTHORS
1055 )
1056
1057 ADD_CUSTOM_COMMAND(
1058         OUTPUT  ${CMAKE_BINARY_DIR}/AUTHORS-SHORT-FORMAT
1059                 ${CMAKE_BINARY_DIR}/wireshark.pod
1060         COMMAND ${PERL}
1061                 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1062                 ${CMAKE_SOURCE_DIR}/doc/make-authors-format.pl
1063                 < ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1064                 > ${CMAKE_BINARY_DIR}/AUTHORS-SHORT-FORMAT
1065         COMMAND cat
1066                 ${CMAKE_SOURCE_DIR}/doc/wireshark.pod.template
1067                 ${CMAKE_BINARY_DIR}/AUTHORS-SHORT-FORMAT
1068                 > ${CMAKE_BINARY_DIR}/wireshark.pod
1069         DEPENDS
1070                 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1071                 ${CMAKE_SOURCE_DIR}/doc/make-authors-format.pl
1072                 ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1073                 ${CMAKE_SOURCE_DIR}/doc/wireshark.pod.template
1074 )
1075
1076 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/capinfos 1 )
1077 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/dftest 1 )
1078 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/dumpcap 1 )
1079 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/editcap 1 )
1080 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/asn2deb 1 )
1081 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/idl2deb 1 )
1082 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/idl2wrs 1 )
1083 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/mergecap 1 )
1084 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/randpkt 1 )
1085 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/rawshark 1 )
1086 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/reordercap 1 )
1087 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/text2pcap 1 )
1088 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/tshark 1 )
1089 pod2manhtml( wireshark 1 )
1090 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/wireshark-filter 4 )
1091
1092 add_custom_target(
1093         auxiliary ALL
1094         DEPENDS
1095                 AUTHORS-SHORT
1096                 capinfos.html
1097                 dftest.html
1098                 dumpcap.html
1099                 editcap.html
1100                 asn2deb.html
1101                 idl2deb.html
1102                 idl2wrs.html
1103                 mergecap.html
1104                 randpkt.html
1105                 rawshark.html
1106                 reordercap.html
1107                 text2pcap.html
1108                 tshark.html
1109                 wireshark.html
1110                 wireshark-filter.html
1111 )
1112
1113 set(MAN1_FILES
1114         ${CMAKE_BINARY_DIR}/capinfos.1
1115         ${CMAKE_BINARY_DIR}/dftest.1
1116         ${CMAKE_BINARY_DIR}/dumpcap.1
1117         ${CMAKE_BINARY_DIR}/editcap.1
1118         ${CMAKE_BINARY_DIR}/idl2wrs.1
1119         ${CMAKE_BINARY_DIR}/mergecap.1
1120         ${CMAKE_BINARY_DIR}/randpkt.1
1121         ${CMAKE_BINARY_DIR}/rawshark.1
1122         ${CMAKE_BINARY_DIR}/reordercap.1
1123         ${CMAKE_BINARY_DIR}/text2pcap.1
1124         ${CMAKE_BINARY_DIR}/tshark.1
1125         ${CMAKE_BINARY_DIR}/wireshark.1
1126 )
1127
1128 set(MAN4_FILES
1129         ${CMAKE_BINARY_DIR}/wireshark-filter.4
1130 )
1131
1132 set(CLEAN_FILES
1133         ${wireshark_FILES}
1134         ${tshark_FILES}
1135         ${rawshark_FILES}
1136         ${dftest_FILES}
1137         ${randpkt_FILES}
1138         ${text2pcap_CLEAN_FILES}
1139         ${mergecap_FILES}
1140         ${capinfos_FILES}
1141         ${editcap_FILES}
1142         ${dumpcap_FILES}
1143 )
1144
1145 if (WERROR)
1146         set_source_files_properties(
1147                 ${CLEAN_FILES}
1148                 PROPERTIES
1149                 COMPILE_FLAGS -Werror
1150         )
1151 endif()
1152
1153 install(
1154         FILES
1155                 ${INSTALL_FILES}
1156         DESTINATION
1157                 ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}
1158 )
1159
1160 install(
1161         FILES
1162                 ${MAN1_FILES}
1163         DESTINATION
1164                 ${CMAKE_INSTALL_MANDIR}/man1
1165 )
1166
1167 install(
1168         FILES
1169                 ${MAN4_FILES}
1170         DESTINATION
1171                 ${CMAKE_INSTALL_MANDIR}/man4
1172 )
1173
1174 install(
1175         DIRECTORY
1176                 ${INSTALL_DIRS}
1177         DIRECTORY_PERMISSIONS
1178                 OWNER_EXECUTE OWNER_WRITE OWNER_READ
1179                 GROUP_EXECUTE GROUP_READ
1180                 WORLD_EXECUTE WORLD_READ
1181         DESTINATION
1182                 ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}
1183         PATTERN ".svn" EXCLUDE
1184         PATTERN "Makefile.*" EXCLUDE
1185         PATTERN "faq.py" EXCLUDE
1186 )
1187
1188
1189 if(DOC_DIR)
1190         message(STATUS "Docdir install: ${DOC_DIR}")
1191         INSTALL(
1192                 DIRECTORY
1193                         ${CMAKE_BINARY_DIR}/docbook/
1194                 DIRECTORY_PERMISSIONS
1195                         OWNER_EXECUTE OWNER_WRITE OWNER_READ
1196                         GROUP_EXECUTE GROUP_READ
1197                         WORLD_EXECUTE WORLD_READ
1198                 DESTINATION
1199                         ${DOC_DIR}/guides
1200                 FILES_MATCHING
1201                 PATTERN "*.pdf"
1202         )
1203 endif()