Move u3.{h,c} and g711.{h,c} into wsutil.
[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                 merge.c
766                 proto_hier_stats.c
767                 summary.c
768                 ws80211_utils.c
769                 ${SHARK_COMMON_CAPTURE_SRC}
770                 ${WIRESHARK_COMMON_SRC}
771         )
772 endif()
773
774 if(BUILD_wireshark AND GTK_FOUND)
775         set(wireshark_LIBS
776                 gtkui
777                 ui
778                 ${GTK2_LIBRARIES}
779                 ${GTK3_LIBRARIES}
780                 ${GTHREAD2_LIBRARIES}
781                 codecs
782                 ${PORTAUDIO_LIBRARIES}
783                 ${LIBEPAN_LIBS}
784                 ${APPLE_APPLICATION_SERVICES_LIBRARY}
785                 ${APPLE_CORE_SERVICES_LIBRARY}
786                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
787                 ${NL_LIBRARIES}
788         )
789         # qtshark and wireshark share wireshark_FILES
790
791         add_executable(wireshark ${wireshark_FILES})
792         add_dependencies(wireshark svnversion)
793         set_target_properties(wireshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
794         target_link_libraries(wireshark ${wireshark_LIBS})
795         install(TARGETS wireshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
796 endif()
797
798 if(BUILD_qtshark AND QT_FOUND)
799         set(qtshark_LIBS
800                 qtui
801                 ui
802                 ${QT_LIBRARIES}
803                 ${GTHREAD2_LIBRARIES}
804                 codecs
805                 ${PORTAUDIO_LIBRARIES}
806                 ${LIBEPAN_LIBS}
807                 ${APPLE_APPLICATION_SERVICES_LIBRARY}
808                 ${APPLE_CORE_FOUNDATION_LIBRARY}
809                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
810                 ${NL_LIBRARIES}
811         )
812         # qtshark and wireshark share wireshark_FILES
813
814         add_executable(qtshark ${wireshark_FILES})
815         add_dependencies(qtshark svnversion)
816         set_target_properties(qtshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
817         target_link_libraries(qtshark ${qtshark_LIBS})
818         install(TARGETS qtshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
819 endif()
820
821 register_tap_files(tshark-tap-register.c
822         ${TSHARK_TAP_SRC}
823 )
824
825 if(BUILD_tshark)
826         set(tshark_LIBS
827                 ui
828                 ${LIBEPAN_LIBS}
829                 ${APPLE_CORE_FOUNDATION_LIBRARY}
830                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
831         )
832         set(tshark_FILES
833                 capture_opts.c
834                 capture_sync.c
835                 tshark-tap-register.c
836                 tshark.c
837                 ${TSHARK_TAP_SRC}
838                 ${SHARK_COMMON_CAPTURE_SRC}
839                 ${WIRESHARK_COMMON_SRC}
840         )
841         add_executable(tshark ${tshark_FILES})
842         add_dependencies(tshark svnversion)
843         set_target_properties(tshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
844         target_link_libraries(tshark ${tshark_LIBS})
845         install(TARGETS tshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
846 endif()
847
848 if(BUILD_rawshark AND PCAP_FOUND)
849         set(rawshark_LIBS
850                 ${LIBEPAN_LIBS}
851                 ${APPLE_CORE_FOUNDATION_LIBRARY}
852                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
853         )
854         set(rawshark_FILES
855                 ${WIRESHARK_COMMON_SRC}
856                 rawshark.c
857                 ui/util.c
858         )
859         add_executable(rawshark ${rawshark_FILES})
860         add_dependencies(rawshark svnversion)
861         set_target_properties(rawshark PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
862         target_link_libraries(rawshark ${rawshark_LIBS})
863         install(TARGETS rawshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
864 endif()
865
866 if(BUILD_dftest)
867         set(dftest_LIBS
868                 ${LIBEPAN_LIBS}
869         )
870         set(dftest_FILES
871                 dftest.c
872                 ui/util.c
873         )
874         add_executable(dftest ${dftest_FILES})
875         set_target_properties(dftest PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
876         target_link_libraries(dftest ${dftest_LIBS})
877         install(TARGETS dftest RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
878 endif()
879
880 if(BUILD_randpkt)
881         set(randpkt_LIBS
882                 wiretap
883                 ${M_LIBRARIES}
884                 ${PCAP_LIBRARIES}
885 #               @SOCKET_LIBS@
886 #               @NSL_LIBS@
887                 ${CARES_LIBRARIES}
888                 ${ADNS_LIBRARIES}
889                 ${ZLIB_LIBRARIES}
890         )
891         set(randpkt_FILES
892                 randpkt.c
893         )
894         add_executable(randpkt ${randpkt_FILES})
895         set_target_properties(randpkt PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
896         target_link_libraries(randpkt ${randpkt_LIBS})
897         install(TARGETS randpkt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
898 endif()
899
900 if(BUILD_text2pcap)
901         set(text2pcap_LIBS
902                 wsutil
903                 ${M_LIBRARIES}
904                 ${ZLIB_LIBRARIES}
905         )
906         set(text2pcap_CLEAN_FILES
907                 text2pcap.c
908                 pcapio.c
909         )
910         set(text2pcap_FILES
911                 ${text2pcap_CLEAN_FILES}
912         )
913         add_lex_files(text2pcap_FILES
914                 text2pcap-scanner.l
915         )
916         add_executable(text2pcap ${text2pcap_FILES})
917         add_dependencies(text2pcap svnversion)
918         set_target_properties(text2pcap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
919         target_link_libraries(text2pcap ${text2pcap_LIBS})
920         install(TARGETS text2pcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
921 endif()
922
923 if(BUILD_mergecap)
924         set(mergecap_LIBS
925                 wiretap
926                 ${ZLIB_LIBRARIES}
927         )
928         set(mergecap_FILES
929                 mergecap.c
930                 merge.c
931                 svnversion.h
932                 ${WTAP_PLUGIN_SOURCES}
933         )
934         add_executable(mergecap ${mergecap_FILES})
935         add_dependencies(mergecap svnversion)
936         set_target_properties(mergecap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
937         target_link_libraries(mergecap ${mergecap_LIBS})
938         install(TARGETS mergecap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
939 endif()
940
941 if(BUILD_reordercap)
942         set(reordercap_LIBS
943                 wiretap
944                 ${ZLIB_LIBRARIES}
945         )
946         set(reordercap_FILES
947                 reordercap.c
948                 svnversion.h
949                 ${WTAP_PLUGIN_SOURCES}
950         )
951         add_executable(reordercap ${reordercap_FILES})
952         add_dependencies(reordercap svnversion)
953         set_target_properties(reordercap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
954         target_link_libraries(reordercap ${reordercap_LIBS})
955         install(TARGETS reordercap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
956 endif()
957
958 if(BUILD_capinfos)
959         set(capinfos_LIBS
960                 wiretap
961                 wsutil
962                 ${ZLIB_LIBRARIES}
963                 ${GCRYPT_LIBRARIES}
964         )
965         set(capinfos_FILES
966                 capinfos.c
967                 ${WTAP_PLUGIN_SOURCES}
968         )
969         add_executable(capinfos ${capinfos_FILES})
970         add_dependencies(capinfos svnversion)
971         set_target_properties(capinfos PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
972         target_link_libraries(capinfos ${capinfos_LIBS})
973         install(TARGETS capinfos RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
974 endif()
975
976 if(BUILD_editcap)
977         set(editcap_LIBS
978                 wiretap
979                 ${ZLIB_LIBRARIES}
980         )
981         set(editcap_FILES
982                 editcap.c
983                 epan/crypt/md5.c
984                 ${WTAP_PLUGIN_SOURCES}
985         )
986         add_executable(editcap ${editcap_FILES})
987         add_dependencies(editcap svnversion)
988         set_target_properties(editcap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
989         target_link_libraries(editcap ${editcap_LIBS})
990         install(TARGETS editcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
991 endif()
992
993 if(BUILD_dumpcap AND PCAP_FOUND)
994         set(dumpcap_LIBS
995 #               @INET_NTOP_LO@
996                 wsutil
997                 ${PCAP_LIBRARIES}
998                 ${CAP_LIBRARIES}
999 #               @SOCKET_LIBS@
1000 #               @NSL_LIBS@
1001                 ${GLIB2_LIBRARIES}
1002                 ${GTHREAD2_LIBRARIES}
1003                 ${ZLIB_LIBRARIES}
1004                 ${APPLE_CORE_FOUNDATION_LIBRARY}
1005                 ${APPLE_SYSTEM_CONFIGURATION_LIBRARY}
1006                 ${NL_LIBRARIES}
1007         )
1008         set(dumpcap_FILES
1009                 svnversion.h
1010                 capture_opts.c
1011                 capture-pcap-util.c
1012                 capture_stop_conditions.c
1013                 cfutils.c
1014                 clopts_common.c
1015                 conditions.c
1016                 dumpcap.c
1017                 pcapio.c
1018                 ringbuffer.c
1019                 sync_pipe_write.c
1020                 version_info.c
1021                 ws80211_utils.c
1022                 ${PLATFORM_SRC}
1023         )
1024         add_executable(dumpcap ${dumpcap_FILES})
1025         add_dependencies(dumpcap svnversion)
1026         set_target_properties(dumpcap PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
1027         target_link_libraries(dumpcap ${dumpcap_LIBS})
1028         install(TARGETS dumpcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1029 endif()
1030
1031 ADD_CUSTOM_COMMAND(
1032         OUTPUT  ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1033         COMMAND ${PERL}
1034                 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1035                 ${CMAKE_SOURCE_DIR}/doc/make-authors-short.pl
1036                 < ${CMAKE_SOURCE_DIR}/AUTHORS
1037                 > ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1038         DEPENDS
1039                 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1040                 ${CMAKE_SOURCE_DIR}/doc/make-authors-short.pl
1041                 ${CMAKE_SOURCE_DIR}/AUTHORS
1042 )
1043
1044 ADD_CUSTOM_COMMAND(
1045         OUTPUT  ${CMAKE_BINARY_DIR}/AUTHORS-SHORT-FORMAT
1046                 ${CMAKE_BINARY_DIR}/wireshark.pod
1047         COMMAND ${PERL}
1048                 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1049                 ${CMAKE_SOURCE_DIR}/doc/make-authors-format.pl
1050                 < ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1051                 > ${CMAKE_BINARY_DIR}/AUTHORS-SHORT-FORMAT
1052         COMMAND cat
1053                 ${CMAKE_SOURCE_DIR}/doc/wireshark.pod.template
1054                 ${CMAKE_BINARY_DIR}/AUTHORS-SHORT-FORMAT
1055                 > ${CMAKE_BINARY_DIR}/wireshark.pod
1056         DEPENDS
1057                 ${CMAKE_SOURCE_DIR}/doc/perlnoutf.pl
1058                 ${CMAKE_SOURCE_DIR}/doc/make-authors-format.pl
1059                 ${CMAKE_BINARY_DIR}/AUTHORS-SHORT
1060                 ${CMAKE_SOURCE_DIR}/doc/wireshark.pod.template
1061 )
1062
1063 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/capinfos 1 )
1064 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/dftest 1 )
1065 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/dumpcap 1 )
1066 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/editcap 1 )
1067 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/asn2deb 1 )
1068 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/idl2deb 1 )
1069 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/idl2wrs 1 )
1070 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/mergecap 1 )
1071 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/randpkt 1 )
1072 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/rawshark 1 )
1073 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/reordercap 1 )
1074 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/text2pcap 1 )
1075 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/tshark 1 )
1076 pod2manhtml( wireshark 1 )
1077 pod2manhtml( ${CMAKE_SOURCE_DIR}/doc/wireshark-filter 4 )
1078
1079 add_custom_target(
1080         auxiliary ALL
1081         DEPENDS
1082                 AUTHORS-SHORT
1083                 capinfos.html
1084                 dftest.html
1085                 dumpcap.html
1086                 editcap.html
1087                 asn2deb.html
1088                 idl2deb.html
1089                 idl2wrs.html
1090                 mergecap.html
1091                 randpkt.html
1092                 rawshark.html
1093                 reordercap.html
1094                 text2pcap.html
1095                 tshark.html
1096                 wireshark.html
1097                 wireshark-filter.html
1098 )
1099
1100 set(MAN1_FILES
1101         ${CMAKE_BINARY_DIR}/capinfos.1
1102         ${CMAKE_BINARY_DIR}/dftest.1
1103         ${CMAKE_BINARY_DIR}/dumpcap.1
1104         ${CMAKE_BINARY_DIR}/editcap.1
1105         ${CMAKE_BINARY_DIR}/idl2wrs.1
1106         ${CMAKE_BINARY_DIR}/mergecap.1
1107         ${CMAKE_BINARY_DIR}/randpkt.1
1108         ${CMAKE_BINARY_DIR}/rawshark.1
1109         ${CMAKE_BINARY_DIR}/reordercap.1
1110         ${CMAKE_BINARY_DIR}/text2pcap.1
1111         ${CMAKE_BINARY_DIR}/tshark.1
1112         ${CMAKE_BINARY_DIR}/wireshark.1
1113 )
1114
1115 set(MAN4_FILES
1116         ${CMAKE_BINARY_DIR}/wireshark-filter.4
1117 )
1118
1119 set(CLEAN_FILES
1120         ${wireshark_FILES}
1121         ${tshark_FILES}
1122         ${rawshark_FILES}
1123         ${dftest_FILES}
1124         ${randpkt_FILES}
1125         ${text2pcap_CLEAN_FILES}
1126         ${mergecap_FILES}
1127         ${capinfos_FILES}
1128         ${editcap_FILES}
1129         ${dumpcap_FILES}
1130 )
1131
1132 if (WERROR)
1133         set_source_files_properties(
1134                 ${CLEAN_FILES}
1135                 PROPERTIES
1136                 COMPILE_FLAGS -Werror
1137         )
1138 endif()
1139
1140 install(
1141         FILES
1142                 ${INSTALL_FILES}
1143         DESTINATION
1144                 ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}
1145 )
1146
1147 install(
1148         FILES
1149                 ${MAN1_FILES}
1150         DESTINATION
1151                 ${CMAKE_INSTALL_MANDIR}/man1
1152 )
1153
1154 install(
1155         FILES
1156                 ${MAN4_FILES}
1157         DESTINATION
1158                 ${CMAKE_INSTALL_MANDIR}/man4
1159 )
1160
1161 install(
1162         DIRECTORY
1163                 ${INSTALL_DIRS}
1164         DIRECTORY_PERMISSIONS
1165                 OWNER_EXECUTE OWNER_WRITE OWNER_READ
1166                 GROUP_EXECUTE GROUP_READ
1167                 WORLD_EXECUTE WORLD_READ
1168         DESTINATION
1169                 ${CMAKE_INSTALL_DATADIR}/${CPACK_PACKAGE_NAME}
1170         PATTERN ".svn" EXCLUDE
1171         PATTERN "Makefile.*" EXCLUDE
1172         PATTERN "faq.py" EXCLUDE
1173 )
1174
1175
1176 if(DOC_DIR)
1177         message(STATUS "Docdir install: ${DOC_DIR}")
1178         INSTALL(
1179                 DIRECTORY
1180                         ${CMAKE_BINARY_DIR}/docbook/
1181                 DIRECTORY_PERMISSIONS
1182                         OWNER_EXECUTE OWNER_WRITE OWNER_READ
1183                         GROUP_EXECUTE GROUP_READ
1184                         WORLD_EXECUTE WORLD_READ
1185                 DESTINATION
1186                         ${DOC_DIR}/guides
1187                 FILES_MATCHING
1188                 PATTERN "*.pdf"
1189         )
1190 endif()