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