Skip to content

Commit ffa9d3c

Browse files
committed
Merge pull request #8 from insomniacslk/cmake
Merging branch Cmake into master
2 parents 501283c + ea77508 commit ffa9d3c

18 files changed

+97
-869
lines changed

Diff for: .gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
*.o
22
.*.swp
3-
*.pyc
43
*.so

Diff for: .gitmodules

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "dependencies/jsoncpp"]
2-
path = dependencies/jsoncpp
2+
path = external/jsoncpp
33
url = https://github.com/open-source-parsers/jsoncpp.git
44
[submodule "dependencies/libtins"]
5-
path = dependencies/libtins
5+
path = external/libtins
66
url = https://github.com/mfontanini/libtins.git

Diff for: .travis.yml

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
language: cpp
22

3-
script: make
3+
before_script:
4+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then .travis/install_dependencies_linux.sh ; fi
5+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then .travis/install_dependencies_osx.sh ; fi
6+
- mkdir build
7+
- cd build
8+
- cmake ..
9+
10+
script: make VERBOSE=1
11+
12+
after_script:
13+
- ./dublin-traceroute
414

515
sudo: required
16+
dist: trusty
617

718
os:
819
- linux
@@ -12,6 +23,11 @@ compiler:
1223
- clang
1324
- gcc
1425

26+
matrix:
27+
exclude:
28+
- os: osx
29+
compiler: gcc
30+
1531
addons:
1632
apt:
1733
sources:
@@ -22,6 +38,8 @@ addons:
2238
- llvm-3.6-dev
2339
- clang-3.6
2440
- libpcap-dev
41+
- jsoncpp
42+
- libtins
2543
coverity_scan:
2644

2745
# GitHub project metadata
@@ -37,7 +55,11 @@ addons:
3755
# build_command_prepend: ./configure
3856

3957
# The command that will be added as an argument to "cov-build" to compile your project for analysis,
40-
build_command: make
58+
build_command:
59+
- mkdir build
60+
- cd build
61+
- cmake ..
62+
- make
4163

4264
# Pattern to match selecting branches that will run analysis. We recommend leaving this set to 'coverity_scan'.
4365
# Take care in resource usage, and consider the build frequency allowances per
@@ -47,6 +69,7 @@ addons:
4769
install:
4870
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8"; fi
4971
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$CXX" = "clang++" ]; then export CXX="clang++-3.6"; fi
72+
- if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$CXX" = "g++" ]; then export CXXFLAGS="-stdlib=libstdc++"; fi
5073

5174
env:
5275
global:

Diff for: .travis/install_dependencies_linux.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# install libtins
4+
git clone https://github.com/mfontanini/libtins.git
5+
cd libtins
6+
mkdir build
7+
cd build
8+
cmake ..
9+
make
10+
sudo make install
11+
12+
# install jsoncpp
13+
git clone https://github.com/open-source-parsers/jsoncpp.git
14+
cd jsoncpp
15+
mkdir build
16+
cd build
17+
cmake .. -DBUILD_SHARED_LIBS=on
18+
make
19+
sudo make install

Diff for: .travis/install_dependencies_osx.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
brew update
4+
brew install --HEAD libtins
5+
brew uninstall json-c
6+
brew install jsoncpp

Diff for: CMakeLists.txt

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
cmake_minimum_required (VERSION 2.8)
2+
project (dublin-traceroute)
3+
4+
set (dublin-traceroute_VERSION_MAJOR_1)
5+
set (dublin-traceroute_VERSION_MINOR_0)
6+
7+
include_directories("${PROJECT_SOURCE_DIR}/include")
8+
9+
add_library(dublintraceroute SHARED
10+
src/common.cc
11+
src/dublin_traceroute.cc
12+
src/hop.cc
13+
src/traceroute_results.cc
14+
)
15+
16+
find_package (Threads)
17+
18+
add_executable(dublin-traceroute src/main.cc)
19+
target_link_libraries (dublin-traceroute ${CMAKE_THREAD_LIBS_INIT})
20+
target_link_libraries(dublin-traceroute dublintraceroute)
21+
target_link_libraries(dublintraceroute tins)
22+
target_link_libraries(dublintraceroute jsoncpp)
23+
24+
add_dependencies(dublin-traceroute dublintraceroute)
25+
26+
set_property(TARGET dublintraceroute PROPERTY CXX_STANDARD 11)
27+
set_property(TARGET dublin-traceroute PROPERTY CXX_STANDARD 11)
28+
29+
install(TARGETS dublin-traceroute dublintraceroute
30+
RUNTIME DESTINATION bin
31+
LIBRARY DESTINATION lib
32+
)
33+
install(DIRECTORY include/dublintraceroute DESTINATION include)

Diff for: DEPENDENCIES.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
cmake
22
a recent enough C++11 compiler (gcc >= 4.6 or clang >= 3.3)
33
libpcap-dev
4-
libtins >= 3 (or use the one provided here)
5-
python-dev
6-
python-pygraphviz
7-
python-tabulate
4+
libtins >= 3.3

Diff for: Makefile

-173
This file was deleted.

Diff for: dependencies/jsoncpp

-1
This file was deleted.

Diff for: dependencies/libtins

-1
This file was deleted.

Diff for: documentation/readme/README.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ due.
8282
Dublin Traceroute is written in C++11 on top of a beautiful network packet sniffing and
8383
crafting library, [libtins](https://libtins.github.io).
8484
Dublin Traceroute also features a Python extension on top of the C++ core if you
85-
prefer.
85+
prefer. The bindings now live in a separate repository, see
86+
[python-dublin-traceroute](https://github.com/insomniacslk/python-dublin-traceroute) .
8687

8788
See the [examples](examples.md) to see Dublin Traceroute at work.
8889

@@ -133,17 +134,18 @@ git clone https://github.com/insomniacslk/dublin-traceroute.git
133134
source code, but in short you need:
134135

135136
* cmake
136-
* gcc >= 4.6 or clang >= 3.3
137+
* gcc >= 4.7 or clang >= 3.3
137138
* libpcap-dev
138-
* libtins >= 3 (or use the one provided by Dublin Traceroute)
139-
* python-dev (if you want to build the Python extension)
140-
* python-pygraphviz (to plot graphs from the Python extension)
141-
* python-tabulate (to print the traceroute output to the console)
139+
* libtins >= 3.3
140+
* jsoncpp
142141

143142
* Build it
144143

145144
```bash
146145
cd dublin-traceroute
146+
mkdir build
147+
cd build
148+
cmake ..
147149
make
148150
```
149151

0 commit comments

Comments
 (0)