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