Commit | Line | Data |
---|---|---|
26650731 GMF |
1 | # package: find external packages |
2 | include(FindPkgConfig) | |
3 | ||
0dc2435f | 4 | # package: required boost libraries |
96d2fb59 | 5 | set(Boost_USE_STATIC_LIBS OFF) |
365036be | 6 | set(Boost_USE_MULTITHREADED OFF) |
0dc2435f | 7 | set(Boost_USE_STATIC_RUNTIME OFF) |
c5b4902d | 8 | find_package(Boost 1.44 COMPONENTS filesystem program_options system serialization date_time REQUIRED) |
d3692dd9 GMF |
9 | include_directories(${Boost_INCLUDE_DIRS}) |
10 | link_directories(${Boost_LIBRARY_DIRS}) | |
0dc2435f | 11 | |
22c5aae4 GMF |
12 | # package: boost-custom |
13 | include_directories(${CMAKE_SOURCE_DIR}/lib/boost-custom) | |
14 | ||
26650731 GMF |
15 | # package: boost-net-dns |
16 | include_directories(${CMAKE_SOURCE_DIR}/lib/boost-net-dns) | |
d3692dd9 GMF |
17 | |
18 | # package: libi2ncommon | |
0dc2435f | 19 | pkg_check_modules(I2NCOMMON REQUIRED libi2ncommon) |
d3692dd9 GMF |
20 | include_directories(${I2NCOMMON_INCLUDE_DIRS}) |
21 | link_directories(${I2NCOMMON_LIBRARY_DIRS}) | |
0dc2435f | 22 | |
83f83043 GMF |
23 | # package: doxygen |
24 | find_package(Doxygen) | |
25 | ||
0dc2435f | 26 | # compiler: include directories where the source code is located |
d3692dd9 | 27 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) |
ced28dc7 | 28 | |
0dc2435f GMF |
29 | # compiler: source code files |
30 | set(SOURCES | |
ced28dc7 | 31 | config/configuration.cpp |
aec4a350 GMF |
32 | config/configurationcommandline.cpp |
33 | config/configurationfile.cpp | |
34 | config/configurationinterface.cpp | |
35 | config/configurationoptions.cpp | |
ced28dc7 | 36 | config/configurationreader.cpp |
77a7ddf9 | 37 | config/host.cpp |
adc78821 GMF |
38 | config/option/daemonoption.cpp |
39 | config/option/configfileoption.cpp | |
82cb0214 GMF |
40 | config/option/configurationoption.cpp |
41 | config/option/hostconfigurationoption.cpp | |
42 | config/option/hostpingintervaloption.cpp | |
43 | config/option/hostpingprotocoloption.cpp | |
44 | config/option/hostportoption.cpp | |
45 | config/option/hostnameoption.cpp | |
74dd30e1 | 46 | config/option/hostsourcenetworkinterfaceoption.cpp |
5596767b | 47 | config/option/hostsdownlimitoption.cpp |
82cb0214 GMF |
48 | config/option/linkdownintervaloption.cpp |
49 | config/option/linkupintervaloption.cpp | |
7ca853fe | 50 | config/option/logleveloption.cpp |
5ba17410 | 51 | config/option/logoutputoption.cpp |
82cb0214 GMF |
52 | config/option/nameserveroption.cpp |
53 | config/option/pingfaillimitoption.cpp | |
54 | config/option/sourcenetworkinterfaceoption.cpp | |
55 | config/option/statusnotifiercmdoption.cpp | |
adc78821 | 56 | config/option/versionoption.cpp |
096b06ef | 57 | config/option/ratiorandomhostsoption.cpp |
079d19ab CH |
58 | config/option/pingreplytimeoutoption.cpp |
59 | config/option/maxaddressresolutionattemptsoption.cpp | |
60 | config/option/resolvedipttlthresholdoption.cpp | |
a901aed6 | 61 | config/option/dnscachefileoption.cpp |
9490a7bd | 62 | dns/timetolive.cpp |
c5b4902d CH |
63 | dns/hostaddress.cpp |
64 | dns/dnscache.cpp | |
65 | dns/resolverbase.cpp | |
66 | dns/dnsresolver.cpp | |
67 | dns/dnsmaster.cpp | |
6c14bbee | 68 | host/hoststatus.cpp |
7ca853fe | 69 | host/loglevel.cpp |
5ba17410 | 70 | host/logoutput.cpp |
4939ed75 | 71 | host/messagepayload.cpp |
bc4d0a3a | 72 | host/networkinterfacelist.cpp |
cd395966 | 73 | host/pinger.cpp |
475ad07c | 74 | host/pingerfactory.cpp |
f4fc8957 | 75 | host/pinginterval.cpp |
3fd74a53 | 76 | host/pingprotocol.cpp |
8f66f529 | 77 | host/pingscheduler.cpp |
688d4b27 | 78 | tools/pcap.cpp |
39d326f2 | 79 | icmp/icmpdata.cpp |
15023b99 | 80 | icmp/icmpdata_pingfailreply.cpp |
0ba8adc0 CH |
81 | icmp/icmpechodata.cpp |
82 | icmp/icmpdestinationunreachabledata.cpp | |
15023b99 | 83 | icmp/icmptimeexceededdata.cpp |
39d326f2 | 84 | icmp/icmpheader.cpp |
8ddcec43 | 85 | icmp/icmppacket.cpp |
511ced78 | 86 | icmp/icmppinger.cpp |
f076f8d4 | 87 | icmp/icmppacketfactory.cpp |
d0c85dd8 | 88 | ip/ipheader.cpp |
3bd915ea | 89 | ip/ipv4header.cpp |
e2a72897 | 90 | ip/ipv6header.cpp |
72e54d1c | 91 | link/linkstatus.cpp |
8f66f529 | 92 | link/statusnotifiercommand.cpp |
12a35dbb | 93 | tcp/tcpheader.cpp |
cd395966 | 94 | tcp/tcppinger.cpp |
c2601cc9 | 95 | tcp/tcpipv4segment.cpp |
bc4d0a3a | 96 | tcp/tcpipv6segment.cpp |
c2601cc9 | 97 | tcp/tcpsegment.cpp |
24ed023f | 98 | tcp/tcpsegmentfactory.cpp |
780b0bca | 99 | boost_assert_handler.cpp |
ced28dc7 GMF |
100 | main.cpp |
101 | ) | |
102 | ||
83f83043 GMF |
103 | # documentation: add a target to generate API documentation with Doxygen |
104 | if(DOXYGEN_FOUND) | |
105 | configure_file( | |
106 | ${CMAKE_SOURCE_DIR}/doc/doxyfile.in | |
107 | ${CMAKE_BINARY_DIR}/doc/Doxyfile @ONLY | |
108 | ) | |
109 | add_custom_target( | |
110 | doc | |
111 | ${DOXYGEN_EXECUTABLE} | |
112 | ${CMAKE_BINARY_DIR}/doc/Doxyfile | |
113 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/doc | |
114 | COMMENT "Generating API documentation with Doxygen" VERBATIM | |
115 | ) | |
116 | endif(DOXYGEN_FOUND) | |
117 | ||
0dc2435f GMF |
118 | # compiler: creates the binary |
119 | add_executable(${TARGET} ${SOURCES}) | |
4c2fe1f1 | 120 | |
0dc2435f GMF |
121 | # linker: link the program against the libraries |
122 | target_link_libraries( | |
123 | ${TARGET} | |
124 | ${Boost_LIBRARIES} | |
d3692dd9 | 125 | ${I2NCOMMON_LIBRARIES} |
0dc2435f | 126 | ) |
4ea9706c | 127 | |
ced28dc7 | 128 | # creates the install rule for the binary |
0dc2435f | 129 | install(TARGETS ${TARGET} DESTINATION bin) |
a8a038e7 CH |
130 | |
131 | ||
132 | # create a library from the same files to feed into the linker for tools | |
133 | add_library(lib_for_tools STATIC ${SOURCES}) | |
134 | ||
135 | # now create an executable for tools/feed_packet_data that depends on lib_for_tools | |
688d4b27 | 136 | set(feed_packet_data_SOURCES tools/pcap.cpp tools/feed_packet_data.cpp) |
a8a038e7 CH |
137 | add_executable(feed_packet_data ${feed_packet_data_SOURCES}) |
138 | target_link_libraries( | |
139 | feed_packet_data | |
140 | lib_for_tools | |
141 | ${Boost_LIBRARIES} | |
142 | ${I2NCOMMON_LIBRARIES} | |
143 | ) | |
144 | # no install! install(TARGETS feed_packet_data DESTINATION bin) |