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 |
fda777ea | 52 | config/option/logfileoption.cpp |
82cb0214 GMF |
53 | config/option/nameserveroption.cpp |
54 | config/option/pingfaillimitoption.cpp | |
55 | config/option/sourcenetworkinterfaceoption.cpp | |
56 | config/option/statusnotifiercmdoption.cpp | |
adc78821 | 57 | config/option/versionoption.cpp |
096b06ef | 58 | config/option/ratiorandomhostsoption.cpp |
079d19ab CH |
59 | config/option/pingreplytimeoutoption.cpp |
60 | config/option/maxaddressresolutionattemptsoption.cpp | |
61 | config/option/resolvedipttlthresholdoption.cpp | |
f833126b | 62 | config/option/mintimebetweenresolvesoption.cpp |
a901aed6 | 63 | config/option/dnscachefileoption.cpp |
9490a7bd | 64 | dns/timetolive.cpp |
c5b4902d | 65 | dns/hostaddress.cpp |
8f00b3df | 66 | dns/dnsipprotocol.cpp |
c5b4902d CH |
67 | dns/dnscache.cpp |
68 | dns/resolverbase.cpp | |
69 | dns/dnsresolver.cpp | |
70 | dns/dnsmaster.cpp | |
6c14bbee | 71 | host/hoststatus.cpp |
96c4e7a4 | 72 | host/pingstatus.cpp |
7ca853fe | 73 | host/loglevel.cpp |
5ba17410 | 74 | host/logoutput.cpp |
4939ed75 | 75 | host/messagepayload.cpp |
bc4d0a3a | 76 | host/networkinterfacelist.cpp |
cd395966 | 77 | host/pinger.cpp |
475ad07c | 78 | host/pingerfactory.cpp |
f4fc8957 | 79 | host/pinginterval.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} | |
128 | ${Boost_LIBRARIES} | |
d3692dd9 | 129 | ${I2NCOMMON_LIBRARIES} |
0dc2435f | 130 | ) |
4ea9706c | 131 | |
ced28dc7 | 132 | # creates the install rule for the binary |
0dc2435f | 133 | install(TARGETS ${TARGET} DESTINATION bin) |
a8a038e7 CH |
134 | |
135 | ||
136 | # create a library from the same files to feed into the linker for tools | |
137 | add_library(lib_for_tools STATIC ${SOURCES}) | |
138 | ||
139 | # now create an executable for tools/feed_packet_data that depends on lib_for_tools | |
688d4b27 | 140 | set(feed_packet_data_SOURCES tools/pcap.cpp tools/feed_packet_data.cpp) |
a8a038e7 CH |
141 | add_executable(feed_packet_data ${feed_packet_data_SOURCES}) |
142 | target_link_libraries( | |
143 | feed_packet_data | |
144 | lib_for_tools | |
145 | ${Boost_LIBRARIES} | |
146 | ${I2NCOMMON_LIBRARIES} | |
147 | ) | |
148 | # no install! install(TARGETS feed_packet_data DESTINATION bin) |