29f65b6e2b076f43bfb840c0d57c383e37d578b9
[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 INCLUDE(UseAsn2Wrs)
91
92 # Under linux the release mode (CMAKE_BUILD_TYPE=release) defines NDEBUG
93
94 # Enable with: "make VERBOSE=1"
95 set(CMAKE_VERBOSE_MAKEFILE OFF)
96
97 #Defines CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_DATADIR, etc ...
98 include(CMakeInstallDirs)
99
100 include_directories(
101         ${CMAKE_BINARY_DIR}
102         ${CMAKE_SOURCE_DIR}
103         ${CMAKE_SOURCE_DIR}/epan
104         ${CMAKE_SOURCE_DIR}/tools/lemon
105         ${CMAKE_SOURCE_DIR}/wiretap
106 )
107
108 #Where to put libraries
109 if(NOT LIBRARY_OUTPUT_PATH)
110         set(LIBRARY_OUTPUT_PATH ${Wireshark_BINARY_DIR}/lib CACHE INTERNAL
111                    "Single output directory for building all libraries.")
112 endif()
113
114
115 include(CMakeOptions.txt)
116
117
118 set(WIRESHARK_C_FLAGS
119         -O2
120         -g
121         -Wall
122         -W
123         -Wextra
124         -Wendif-labels
125         -Wpointer-arith
126         -Warray-bounds
127         -Wformat-security
128         -Wshorten-64-to-32
129         -Wvla
130         -Waddress
131         -Warray-bounds
132         -Wattributes
133         -Wdiv-by-zero
134         -Wignored-qualifiers
135         -Wno-overlength-strings
136         -Wwrite-strings
137         -Wno-long-long
138 )
139 if (NOT APPLE)
140         set(WIRESHARK_C_FLAGS ${WIRESHARK_C_FLAGS}
141             -fexcess-precision=fast
142             -Wpragmas)
143 endif()
144
145 set(WIRESHARK_C_ONLY_FLAGS
146         # The following are C only, not C++
147         -Wc++-compat
148         -Wdeclaration-after-statement
149         -Wshadow
150         -Wno-pointer-sign
151         -Wold-style-definition
152         -Wshadow
153         -Wstrict-prototypes
154 )
155 if (NOT APPLE)
156         set(WIRESHARK_C_ONLY_FLAGS ${WIRESHARK_C_ONLY_FLAGS}
157             -Wlogical-op
158             -Wjump-misses-init)
159 endif()
160
161 set(WIRESHARK_EXTRA_C_FLAGS
162         -pedantic
163         -Woverflow
164         -fstrict-overflow -Wstrict-overflow=4
165         -Wunreachable-code
166         -Wunsafe-loop-optimizations
167         -Wcast-align
168         -Wcast-qual
169         -Wformat-security
170         -Wredundant-decls
171         # All the registration functions block these for now.
172         -Wmissing-declarations
173 )
174
175 set(WIRESHARK_EXTRA_C_ONLY_FLAGS
176         # The following are C only, not C++
177         -Wbad-function-cast
178         # All the registration functions block these for now.
179         -Wmissing-prototypes
180 )
181
182 if(ENABLE_EXTRA_GCC_CHECKS)   # This overrides -Werror
183         set(WIRESHARK_C_FLAGS ${WIRESHARK_C_FLAGS} ${WIRESHARK_EXTRA_C_FLAGS})
184         set(WIRESHARK_C_ONLY_FLAGS ${WIRESHARK_C_ONLY_FLAGS} ${WIRESHARK_EXTRA_C_ONLY_FLAGS})
185 endif()
186
187 add_definitions(
188         -DG_DISABLE_DEPRECATED
189         -DG_DISABLE_SINGLE_INCLUDES
190 )
191
192 # Counterhack to work around some cache magic in CHECK_C_SOURCE_COMPILES
193 include(CheckCCompilerFlag)
194 set(C 0)
195 # Sigh: Have to use THIS_FLAG instead of ${F} for some reason
196 foreach(THIS_FLAG ${WIRESHARK_C_FLAGS})
197         set(F WS_C_FLAG_${C})
198         set(${F} ${THIS_FLAG})
199         set(V WS_C_FLAG_VALID${C})
200         check_c_compiler_flag(${${F}} ${V})
201         if (${${V}})
202                 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${F}}")
203                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${F}}")
204         endif()
205         math(EXPR C "${C} + 1")
206 endforeach()
207 # Continue increasing C from previous loop
208 foreach(THIS_FLAG ${WIRESHARK_C_ONLY_FLAGS})
209         set(F WS_C_FLAG_${C})
210         set(${F} ${THIS_FLAG})
211         set(V WS_C_FLAG_VALID${C})
212         check_c_compiler_flag(${${F}} ${V})
213         if (${${V}})
214                 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${F}}")
215         endif()
216         math(EXPR C "${C} + 1")
217 endforeach()
218 message(STATUS "C-Flags: ${CMAKE_C_FLAGS}\nCXX-Flags: ${CMAKE_CXX_FLAGS}")
219
220 check_c_compiler_flag(-fvisibility=hidden FVHIDDEN)
221 if((FVHIDDEN))
222         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
223 else() # TODO add alternate compiler flags for hiding symbols
224         message(WARNING "Hiding shared library symbols is not supported by the compiler."
225                 " All shared library symbols will be exported.")
226 endif()
227
228 if(NOT DISABLE_WERROR AND NOT ENABLE_EXTRA_GCC_CHECKS)
229         check_c_compiler_flag(-Werror WERROR)
230 else()
231         unset(WERROR)
232 endif()
233
234 if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_CXX_COMPILER MATCHES ".*clang" OR APPLE)
235         set (C_UNUSED "__attribute__((unused))" )
236 else()
237         set (C_UNUSED "" )
238 endif()
239
240 set(WIRESHARK_LD_FLAGS
241         -Wl,--as-needed
242         # -flto
243         # -fwhopr
244         # -fwhole-program
245 )
246
247 include(CheckCLinkerFlag)
248 set(C 0)
249 # Sigh: Have to use THIS_FLAG instead of ${F} for some reason
250 foreach(THIS_FLAG ${WIRESHARK_LD_FLAGS})
251         set(F WS_LD_FLAG_${C})
252         set(${F} ${THIS_FLAG})
253         set(V WS_LD_FLAG_VALID${C})
254         check_c_linker_flag(${${F}} ${V})
255         if (${${V}})
256                 set(WS_LINK_FLAGS ${WS_LINK_FLAGS} ${${F}})
257         endif()
258         math(EXPR C "${C} + 1")
259 endforeach()
260
261 if(ENABLE_STATIC)
262   set(LINK_MODE_LIB STATIC)
263   set(LINK_MODE_MODULE STATIC)
264 else()
265   set(LINK_MODE_LIB SHARED)
266   set(LINK_MODE_MODULE MODULE)
267 endif()
268
269 # The packagelist is doing some magic:  If we add XXX to the packagelist, we
270 # - may optionally set XXX_OPTIONS to pass to the find_package command
271 # - will call FindXXX.cmake
272 # - return found libraries in XXX_LIBRARIES
273 # - return found include in XXX_INCLUDE_DIRS
274 # - set HAVE_XXX
275
276 #The minimum package list
277 set(PACKAGELIST GLIB2 GMODULE2 GTHREAD2 M LEX YACC Perl SH PythonInterp)
278 set(GLIB2_FIND_REQUIRED)
279 set(GLIB2_MIN_VERSION 2.14.0)
280 set(GTHREAD2_REQUIRED)
281 set(PCAP_REQUIRED)
282 set(M_REQUIRED)
283 set(PythonInterp_FIND_VERSION 2)
284
285 set(PACKAGELIST ${PACKAGELIST} HtmlViewer)
286
287 if(ENABLE_PCAP)
288         set(PACKAGELIST ${PACKAGELIST} PCAP)
289 endif()
290
291 # Build the GTK-GUI?
292 if(BUILD_wireshark)
293         if(ENABLE_GTK3)
294                 set(PACKAGELIST ${PACKAGELIST} GTK3)
295         else()
296                 set(PACKAGELIST ${PACKAGELIST} GTK2)
297                 set(GTK2_OPTIONS COMPONENTS gtk)
298                 set(GTK2_FIND_VERSION 2.12)
299                 set(GTK2_DEBUG false)
300         endif()
301 endif()
302
303 # Build the Qt GUI?
304 if(BUILD_qtshark)
305         if(ENABLE_QT5)
306                 set(PACKAGELIST ${PACKAGELIST} Qt5Widgets Qt5PrintSupport Qt5LinguistTools)
307                 set(QT_VERSION 5)
308         else()
309                 set(PACKAGELIST ${PACKAGELIST} Qt4)
310                 # set(Qt4_OPTIONS 4.7.1 REQUIRED QtCore QtGui)
311                 set(QT_VERSION 4)
312         endif()
313 endif()
314
315 # SMI SNMP
316 if(ENABLE_SMI)
317         set(PACKAGELIST ${PACKAGELIST} SMI)
318 endif()
319
320 # GNU crypto
321 if(ENABLE_GCRYPT)
322         set(PACKAGELIST ${PACKAGELIST} GCRYPT)
323 endif()
324
325 # GNU SSL/TLS support
326 if(ENABLE_GNUTLS)
327         set(PACKAGELIST ${PACKAGELIST} GNUTLS)
328 endif()
329
330 # Kerberos
331 if(ENABLE_KERBEROS)
332         set(PACKAGELIST ${PACKAGELIST} KERBEROS)
333 endif()
334
335 # Portable audio
336 if(ENABLE_PORTAUDIO)
337         set(PACKAGELIST ${PACKAGELIST} PORTAUDIO)
338 endif()
339
340
341 # Prefer c-ares over adns
342 if(ENABLE_CARES)        # C Asynchronouse resolver
343         set(PACKAGELIST ${PACKAGELIST} CARES)
344 elseif(ENABLE_ADNS)     # Gnu asynchronous DNS
345         set(PACKAGELIST ${PACKAGELIST} ADNS)
346 endif()
347
348 # Zlib compression
349 if(ENABLE_ZLIB)
350         set(PACKAGELIST ${PACKAGELIST} ZLIB)
351 endif()
352
353 # Lua 5.1 dissectors
354 if(ENABLE_LUA)
355         set(PACKAGELIST ${PACKAGELIST} LUA)
356 endif()
357
358 # GeoIP address resolving
359 if(ENABLE_GEOIP)
360         set(PACKAGELIST ${PACKAGELIST} GEOIP)
361 endif()
362
363 if(ENABLE_NETLINK)
364         set(PACKAGELIST ${PACKAGELIST} NL)
365 endif()
366
367 # Capabilities
368 if(ENABLE_CAP)
369         set(PACKAGELIST ${PACKAGELIST} CAP)
370 endif()
371
372 if(ENABLE_PYTHON)
373         set(PACKAGELIST ${PACKAGELIST} PythonLibs)
374 endif()
375
376 set(PACKAGELIST ${PACKAGELIST} YAPP)
377
378 set(PACKAGELIST ${PACKAGELIST} POD)
379
380
381 set(PROGLIST text2pcap mergecap capinfos editcap reordercap dumpcap)
382
383 #Sort the package list
384 list(SORT PACKAGELIST)
385 message(STATUS "Packagelist: ${PACKAGELIST}")
386 #Let's loop the package list
387 foreach(PACKAGE ${PACKAGELIST})
388         if(${PACKAGE} STREQUAL "Qt4")
389                 set(PACKAGE_VAR "QT")
390         elseif(${PACKAGE} STREQUAL "PythonInterp")
391                 set(PACKAGE_VAR "PYTHON")
392         elseif(${PACKAGE} STREQUAL "PythonLibs")
393                 set(PACKAGE_VAR "PYTHON")
394         else()
395                 set(PACKAGE_VAR ${PACKAGE})
396         endif()
397         if(${PACKAGE}_OPTIONS)
398                 find_package(${PACKAGE} ${${PACKAGE}_OPTIONS})
399         elseif(${PACKAGE}_REQUIRED)
400                 find_package(${PACKAGE} REQUIRED)
401         else()
402                 find_package(${PACKAGE})
403         endif()
404         message(${PACKAGE_VAR}_FOUND)
405         if (${PACKAGE_VAR}_FOUND)
406                 set(HAVE_LIB${PACKAGE_VAR} 1)
407                 include_directories(${${PACKAGE_VAR}_INCLUDE_DIRS})
408                 message(STATUS "${PACKAGE} includes: ${${PACKAGE_VAR}_INCLUDE_DIRS}")
409                 message(STATUS "${PACKAGE} libs: ${${PACKAGE_VAR}_LIBRARIES}")
410                 if (${PACKAGE}_DEFINITIONS)
411                         message(STATUS "${PACKAGE} definitions: ${${PACKAGE_VAR}_DEFINITIONS}")
412                 endif()
413                 if (${PACKAGE_VAR}_EXECUTABLE)
414                         message(STATUS "${PACKAGE} executable: ${${PACKAGE_VAR}_EXECUTABLE}")
415                 endif()
416         endif()
417 endforeach()
418
419 #packaging
420 include(CPackConfig.txt)
421
422 if(HAVE_LIBPYTHON)
423         set(HAVE_PYTHON 1)
424         set(PYTHON_DIR "${CMAKE_INSTALL_PREFIX}/lib/wireshark/python/${CPACK_PACKAGE_VERSION}")
425 endif()
426 if(HAVE_LIBLUA)
427         set(HAVE_LUA_H 1)
428         set(HAVE_LUA 1)
429 endif()
430 if(HAVE_LIBKERBEROS)
431         set(HAVE_KERBEROS 1)
432         # HAVE_HEIMDAL_KERBEROS
433         set(HAVE_MIT_KERBEROS 1)
434         set(HAVE_KEYTYPE_ARCFOUR_56 1)
435 endif()
436 if(HAVE_LIBGEOIP)
437         set(HAVE_GEOIP 1)
438 endif()
439 if(HAVE_LIBCARES)
440         set(HAVE_C_ARES 1)
441 endif()
442 if(HAVE_LIBADNS)
443         set(HAVE_GNU_ADNS 1)
444 endif()
445 if(ENABLE_AIRPCAP)
446         set(HAVE_AIRPCAP 1)
447 endif()
448 if(HAVE_LIBNL AND ENABLE_AIRPCAP)
449         message(ERROR "Airpcap and Libnl support are mutually exclusive")
450 endif()
451 # No matter which version of GTK is present
452 if(GTK2_FOUND OR GTK3_FOUND)
453         set(GTK_FOUND ON)
454 endif()
455 # That's the name autofoo uses
456 if(HAVE_LIBZLIB)
457         set(HAVE_LIBZ 1)
458 endif()
459 if (Qt5Widgets_FOUND)
460         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
461         if (Qt5_POSITION_INDEPENDENT_CODE)
462                 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
463         endif()
464         set (QT_FOUND ON)
465         set (QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5PrintSupport_LIBRARIES})
466 # If Qt4: QT_LIBRARIES and QT_INCLUDES are not set above. They require extra magic
467 elseif(QT_FOUND)
468         include(${QT_USE_FILE})
469         include_directories(${QT_INCLUDE_DIR})
470         message(STATUS "QT includes: ${QT_INCLUDE_DIR}")
471         message(STATUS "QT libs: ${QT_LIBRARIES}")
472 endif()
473 include(ConfigureChecks.cmake)
474
475 #Big or little endian ?
476 include(TestBigEndian)
477 test_big_endian(WORDS_BIGENDIAN)
478
479 set(DATAFILE_DIR "${CMAKE_INSTALL_PREFIX}/share/${CPACK_PACKAGE_NAME}")
480
481 if(ENABLE_PLUGINS)
482         set(HAVE_PLUGINS 1)
483         set(PLUGIN_DIR="${DATAFILE_DIR}/plugins/${CPACK_PACKAGE_VERSION}")
484         set(PLUGIN_SRC_DIRS
485                 plugins/asn1
486                 plugins/docsis
487                 plugins/ethercat
488                 plugins/gryphon
489                 plugins/irda
490                 plugins/m2m
491                 plugins/mate
492                 plugins/opcua
493                 plugins/profinet
494                 plugins/stats_tree
495                 plugins/unistim
496                 plugins/wimax
497                 plugins/wimaxasncp
498                 plugins/wimaxmacphy
499         )
500 # It seems this stuff doesn't build with autofoo either...
501 #       if(YAPP_FOUND)
502 #               set(PLUGIN_SRC_DIRS
503 #                       ${PLUGIN_SRC_DIRS}
504 #                       plugins/tpg
505 #               )
506 #       endif()
507 else()
508         set(PLUGIN_SRC_DIRS )
509 endif()
510
511 foreach(PLUGIN_DIR ${PLUGIN_SRC_DIRS})
512         add_subdirectory( ${PLUGIN_DIR} )
513 endforeach()
514
515 add_subdirectory( asn1 EXCLUDE_FROM_ALL )
516 add_subdirectory( codecs )
517 add_subdirectory( epan )
518 add_subdirectory( tools/lemon )
519 add_subdirectory( wiretap )
520 add_subdirectory( wsutil )
521
522 add_custom_target(dumpabi DEPENDS dumpabi-libwireshark dumpabi-libwiretap dumpabi-libwsutil color.h)
523
524 if((BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND))
525         add_subdirectory( ui )
526 endif()
527
528 if(BUILD_wireshark AND GTK_FOUND)
529         add_subdirectory( ui/gtk )
530 endif()
531
532 if(BUILD_qtshark AND QT_FOUND)
533         add_subdirectory( ui/qt )
534 endif()
535
536
537 # Basedir where to install guides
538 set(DOC_DIR "$ENV{docdir}" CACHE FILEPATH "Installation directory for ug and dg pdfs.")
539 message(STATUS "docdir: ${DOC_DIR}")
540
541 if(ENABLE_GUIDES)
542         add_subdirectory( docbook )
543 endif()
544
545 if(ENABLE_PCAP_NG_DEFAULT)
546         set(PCAP_NG_DEFAULT 1)
547 endif()
548
549 #Platform specific
550 #if(UNIX)
551 #endif()
552
553 if(APPLE)
554         #
555         # We assume that APPLE means OS X so that we have the OS X
556         # frameworks.
557         #
558         set(HAVE_OS_X_FRAMEWORKS 1)
559         FIND_LIBRARY (APPLE_APPLICATION_SERVICES_LIBRARY ApplicationServices)
560         FIND_LIBRARY (APPLE_CORE_FOUNDATION_LIBRARY CoreFoundation)
561         FIND_LIBRARY (APPLE_SYSTEM_CONFIGURATION_LIBRARY SystemConfiguration)
562 endif()
563
564 if(WIN32)
565         set(WS_MSVC_NORETURN "__declspec(noreturn)")
566
567         # Disable deprecation
568         if(MSVC80 OR MSVC90)
569                 add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
570         endif()
571 else()
572         set(WS_MSVC_NORETURN " ")
573 endif()
574
575 configure_file(${CMAKE_SOURCE_DIR}/cmakeconfig.h.in ${CMAKE_BINARY_DIR}/config.h)
576
577 set( configure_input "Built with CMake ${CMAKE_VERSION}" )
578 set( VERSION ${PROJECT_VERSION} )
579
580 configure_file(
581         ${CMAKE_SOURCE_DIR}/packaging/macosx/Info.plist.in
582         ${CMAKE_SOURCE_DIR}/packaging/macosx/Info.plist
583         @ONLY)
584
585 include(FeatureSummary)
586 #SET_FEATURE_INFO(NAME DESCRIPTION [URL [COMMENT] ]
587 #FEATURE_SUMMARY(WHAT ALL) Requires removal of our local copy of FeatureSummary
588 PRINT_ENABLED_FEATURES()
589 PRINT_DISABLED_FEATURES()
590
591 link_directories(
592         ${CMAKE_BINARY_DIR}/ui
593         ${CMAKE_BINARY_DIR}/ui/gtk
594         ${CMAKE_BINARY_DIR}/ui/qt
595         ${CMAKE_BINARY_DIR}/codecs
596         ${CMAKE_BINARY_DIR}/epan
597         ${CMAKE_BINARY_DIR}/wiretap
598         ${CMAKE_BINARY_DIR}/wsutil
599 )
600
601 ADD_CUSTOM_TARGET(
602         svnversion ALL
603         COMMAND ${PERL}
604                 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
605                 ${CMAKE_CURRENT_SOURCE_DIR}
606         DEPENDS
607                 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
608 )
609
610 ADD_CUSTOM_COMMAND(
611         OUTPUT  svnversion.h
612         COMMAND ${PERL}
613                 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
614                 ${CMAKE_CURRENT_SOURCE_DIR}
615         DEPENDS
616                 ${CMAKE_CURRENT_SOURCE_DIR}/make-version.pl
617 )
618
619 if(UNIX)
620         set(PLATFORM_SRC
621                 capture-pcap-util-unix.c
622         )
623 endif()
624
625 if(WIN32)
626         set(PLATFORM_SRC
627                 capture-wpcap.c capture_wpcap_packet.c capture_win_ifnames.c
628         )
629 endif()
630
631 set(WTAP_PLUGIN_SOURCES
632         epan/plugins.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         frame_tvbuff.c
648         svnversion.h
649         sync_pipe_write.c
650         version_info.c
651 )
652
653 set(TSHARK_TAP_SRC
654         ui/cli/tap-afpstat.c
655         ui/cli/tap-ansi_astat.c
656         ui/cli/tap-bootpstat.c
657         ui/cli/tap-camelcounter.c
658         ui/cli/tap-camelsrt.c
659         ui/cli/tap-comparestat.c
660         ui/cli/tap-dcerpcstat.c
661         ui/cli/tap-diameter-avp.c
662         ui/cli/tap-expert.c
663         ui/cli/tap-follow.c
664         ui/cli/tap-funnel.c
665         ui/cli/tap-gsm_astat.c
666         ui/cli/tap-h225counter.c
667         ui/cli/tap-h225rassrt.c
668         ui/cli/tap-hosts.c
669         ui/cli/tap-httpstat.c
670         ui/cli/tap-icmpstat.c
671         ui/cli/tap-icmpv6stat.c
672         ui/cli/tap-iostat.c
673         ui/cli/tap-iousers.c
674         ui/cli/tap-macltestat.c
675         ui/cli/tap-mgcpstat.c
676         ui/cli/tap-megacostat.c
677         ui/cli/tap-protocolinfo.c
678         ui/cli/tap-protohierstat.c
679         ui/cli/tap-radiusstat.c
680         ui/cli/tap-rlcltestat.c
681         ui/cli/tap-rpcstat.c
682         ui/cli/tap-rpcprogs.c
683         ui/cli/tap-rtp.c
684         ui/cli/tap-rtspstat.c
685         ui/cli/tap-scsistat.c
686         ui/cli/tap-sctpchunkstat.c
687         ui/cli/tap-sipstat.c
688         ui/cli/tap-smbsids.c
689         ui/cli/tap-smbstat.c
690         ui/cli/tap-stats_tree.c
691         ui/cli/tap-sv.c
692         ui/cli/tap-wspstat.c
693 )
694
695 set(INSTALL_DIRS
696         diameter
697         dtds
698         help
699         radius
700         tpncp
701         wimaxasncp
702 )
703
704 set(INSTALL_FILES
705         ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
706         COPYING
707         ${CMAKE_BINARY_DIR}/capinfos.html
708         cfilters
709         colorfilters
710         dfilters
711         ${CMAKE_BINARY_DIR}/dftest.html
712         ${CMAKE_BINARY_DIR}/dumpcap.html
713         ${CMAKE_BINARY_DIR}/editcap.html
714         ${CMAKE_BINARY_DIR}/asn2deb.html
715         ${CMAKE_BINARY_DIR}/idl2deb.html
716         ${CMAKE_BINARY_DIR}/idl2wrs.html
717         ipmap.html
718         manuf
719         ${CMAKE_BINARY_DIR}/mergecap.html
720         pdml2html.xsl
721         ${CMAKE_BINARY_DIR}/randpkt.html
722         ${CMAKE_BINARY_DIR}/rawshark.html
723         ${CMAKE_BINARY_DIR}/reordercap.html
724         services
725         smi_modules
726         ${CMAKE_BINARY_DIR}/text2pcap.html
727         ${CMAKE_BINARY_DIR}/tshark.html
728         ${CMAKE_BINARY_DIR}/wireshark-filter.html
729         ${CMAKE_BINARY_DIR}/wireshark.html
730         docbook/ws.css
731 )
732
733 set(LIBEPAN_LIBS
734 #               @NSL_LIBS@      # -lnsl
735 #               @SOCKET_LIBS@   # -lsocket
736 #               @SSL_LIBS@      # -lcrypto
737                 epan
738 #               $(plugin_ldadd) # in case of static
739                 ${PCAP_LIBRARIES}
740                 ${CARES_LIBRARIES}
741                 ${ADNS_LIBRARIES}
742                 ${KERBEROS_LIBRARIES}
743                 ${LUA_LIBRARIES}
744                 ${PYTHON_LIBRARIES}
745                 ${GEOIP_LIBRARIES}
746                 ${GCRYPT_LIBRARIES}
747                 ${GNUTLS_LIBRARIES}
748                 ${SMI_LIBRARIES}
749                 ${ZLIB_LIBRARIES}
750                 ${M_LIBRARIES}
751 )
752
753 if( (BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND) )
754         set(wireshark_FILES
755                 airpcap_loader.c
756                 capture.c
757                 capture_info.c
758                 capture_opts.c
759                 capture_sync.c
760                 color_filters.c
761                 file.c
762                 fileset.c
763                 filters.c
764                 iface_monitor.c
765                 proto_hier_stats.c
766                 summary.c
767                 ws80211_utils.c
768                 ${SHARK_COMMON_CAPTURE_SRC}
769                 ${WIRESHARK_COMMON_SRC}
770         )
771 endif()
772
773 if(BUILD_wireshark AND GTK_FOUND)
774         set(wireshark_LIBS
775                 gtkui
776                 ui
777                 ${GTK2_LIBRARIES}
778                 ${GTK3_LIBRARIES}
779                 ${GTHREAD2_LIBRARIES}
780                 codecs
781                 ${PORTAUDIO_LIBRARIES}
782                 ${LIBEPAN_LIBS}
783                 ${APPLE_APPLICATION_SERVICES_LIBRARY}
784                 ${APPLE_CORE_SERVICES_LIBRARY}
785                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
786                 ${NL_LIBRARIES}
787         )
788         # qtshark and wireshark share wireshark_FILES
789
790         add_executable(wireshark ${wireshark_FILES})
791         add_dependencies(wireshark svnversion)
792         set_target_properties(wireshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
793         target_link_libraries(wireshark ${wireshark_LIBS})
794         install(TARGETS wireshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
795 endif()
796
797 if(BUILD_qtshark AND QT_FOUND)
798         set(qtshark_LIBS
799                 qtui
800                 ui
801                 ${QT_LIBRARIES}
802                 ${GTHREAD2_LIBRARIES}
803                 codecs
804                 ${PORTAUDIO_LIBRARIES}
805                 ${LIBEPAN_LIBS}
806                 ${APPLE_APPLICATION_SERVICES_LIBRARY}
807                 ${APPLE_CORE_FOUNDATION_LIBRARY}
808                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
809                 ${NL_LIBRARIES}
810         )
811         # qtshark and wireshark share wireshark_FILES
812
813         add_executable(qtshark ${wireshark_FILES})
814         add_dependencies(qtshark svnversion)
815         set_target_properties(qtshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
816         target_link_libraries(qtshark ${qtshark_LIBS})
817         install(TARGETS qtshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
818 endif()
819
820 register_tap_files(tshark-tap-register.c
821         ${TSHARK_TAP_SRC}
822 )
823
824 if(BUILD_tshark)
825         set(tshark_LIBS
826                 ui
827                 ${LIBEPAN_LIBS}
828                 ${APPLE_CORE_FOUNDATION_LIBRARY}
829                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
830         )
831         set(tshark_FILES
832                 capture_opts.c
833                 capture_sync.c
834                 tshark-tap-register.c
835                 tshark.c
836                 ${TSHARK_TAP_SRC}
837                 ${SHARK_COMMON_CAPTURE_SRC}
838                 ${WIRESHARK_COMMON_SRC}
839         )
840         add_executable(tshark ${tshark_FILES})
841         add_dependencies(tshark svnversion)
842         set_target_properties(tshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
843         target_link_libraries(tshark ${tshark_LIBS})
844         install(TARGETS tshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
845 endif()
846
847 if(BUILD_rawshark AND PCAP_FOUND)
848         set(rawshark_LIBS
849                 ${LIBEPAN_LIBS}
850                 ${APPLE_CORE_FOUNDATION_LIBRARY}
851                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
852         )
853         set(rawshark_FILES
854                 ${WIRESHARK_COMMON_SRC}
855                 rawshark.c
856                 ui/util.c
857         )
858         add_executable(rawshark ${rawshark_FILES})
859         add_dependencies(rawshark svnversion)
860         set_target_properties(rawshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
861         target_link_libraries(rawshark ${rawshark_LIBS})
862         install(TARGETS rawshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
863 endif()
864
865 if(BUILD_dftest)
866         set(dftest_LIBS
867                 ${LIBEPAN_LIBS}
868         )
869         set(dftest_FILES
870                 dftest.c
871                 ui/util.c
872         )
873         add_executable(dftest ${dftest_FILES})
874         set_target_properties(dftest PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
875         target_link_libraries(dftest ${dftest_LIBS})
876         install(TARGETS dftest RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
877 endif()
878
879 if(BUILD_randpkt)
880         set(randpkt_LIBS
881                 wiretap
882                 ${M_LIBRARIES}
883                 ${PCAP_LIBRARIES}
884 #               @SOCKET_LIBS@
885 #               @NSL_LIBS@
886                 ${CARES_LIBRARIES}
887                 ${ADNS_LIBRARIES}
888                 ${ZLIB_LIBRARIES}
889         )
890         set(randpkt_FILES
891                 randpkt.c
892         )
893         add_executable(randpkt ${randpkt_FILES})
894         set_target_properties(randpkt PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
895         target_link_libraries(randpkt ${randpkt_LIBS})
896         install(TARGETS randpkt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
897 endif()
898
899 if(BUILD_text2pcap)
900         set(text2pcap_LIBS
901                 wsutil
902                 ${M_LIBRARIES}
903                 ${ZLIB_LIBRARIES}
904         )
905         set(text2pcap_CLEAN_FILES
906                 text2pcap.c
907                 pcapio.c
908         )
909         set(text2pcap_FILES
910                 ${text2pcap_CLEAN_FILES}
911         )
912         add_lex_files(text2pcap_FILES
913                 text2pcap-scanner.l
914         )
915         add_executable(text2pcap ${text2pcap_FILES})
916         add_dependencies(text2pcap svnversion)
917         set_target_properties(text2pcap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
918         target_link_libraries(text2pcap ${text2pcap_LIBS})
919         install(TARGETS text2pcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
920 endif()
921
922 if(BUILD_mergecap)
923         set(mergecap_LIBS
924                 wiretap
925                 ${ZLIB_LIBRARIES}
926         )
927         set(mergecap_FILES
928                 mergecap.c
929                 svnversion.h
930                 ${WTAP_PLUGIN_SOURCES}
931         )
932         add_executable(mergecap ${mergecap_FILES})
933         add_dependencies(mergecap svnversion)
934         set_target_properties(mergecap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
935         target_link_libraries(mergecap ${mergecap_LIBS})
936         install(TARGETS mergecap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
937 endif()
938
939 if(BUILD_reordercap)
940         set(reordercap_LIBS
941                 wiretap
942                 ${ZLIB_LIBRARIES}
943         )
944         set(reordercap_FILES
945                 reordercap.c
946                 svnversion.h
947                 ${WTAP_PLUGIN_SOURCES}
948         )
949         add_executable(reordercap ${reordercap_FILES})
950         add_dependencies(reordercap svnversion)
951         set_target_properties(reordercap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
952         target_link_libraries(reordercap ${reordercap_LIBS})
953         install(TARGETS reordercap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
954 endif()
955
956 if(BUILD_capinfos)
957         set(capinfos_LIBS
958                 wiretap
959                 wsutil
960                 ${ZLIB_LIBRARIES}
961                 ${GCRYPT_LIBRARIES}
962         )
963         set(capinfos_FILES
964                 capinfos.c
965                 ${WTAP_PLUGIN_SOURCES}
966         )
967         add_executable(capinfos ${capinfos_FILES})
968         add_dependencies(capinfos svnversion)
969         set_target_properties(capinfos PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
970         target_link_libraries(capinfos ${capinfos_LIBS})
971         install(TARGETS capinfos RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
972 endif()
973
974 if(BUILD_editcap)
975         set(editcap_LIBS
976                 wiretap
977                 ${ZLIB_LIBRARIES}
978         )
979         set(editcap_FILES
980                 editcap.c
981                 epan/crypt/md5.c
982                 ${WTAP_PLUGIN_SOURCES}
983         )
984         add_executable(editcap ${editcap_FILES})
985         add_dependencies(editcap svnversion)
986         set_target_properties(editcap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
987         target_link_libraries(editcap ${editcap_LIBS})
988         install(TARGETS editcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
989 endif()
990
991 if(BUILD_dumpcap AND PCAP_FOUND)
992         set(dumpcap_LIBS
993 #               @INET_NTOP_LO@
994                 wsutil
995                 ${PCAP_LIBRARIES}
996                 ${CAP_LIBRARIES}
997 #               @SOCKET_LIBS@
998 #               @NSL_LIBS@
999                 ${GLIB2_LIBRARIES}
1000                 ${GTHREAD2_LIBRARIES}
1001                 ${ZLIB_LIBRARIES}
1002                 ${APPLE_CORE_FOUNDATION_LIBRARY}
1003                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
1004                 ${NL_LIBRARIES}
1005         )
1006         set(dumpcap_FILES
1007                 svnversion.h
1008                 capture_opts.c
1009                 capture-pcap-util.c
1010                 capture_stop_conditions.c
1011                 cfutils.c
1012                 clopts_common.c
1013                 conditions.c
1014                 dumpcap.c
1015                 pcapio.c
1016                 ringbuffer.c
1017                 sync_pipe_write.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()