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