Skip to content

Commit

Permalink
Merge pull request #76 from insomniacslk/fix_homebrew_build
Browse files Browse the repository at this point in the history
Fix build for macOS
  • Loading branch information
insomniacslk authored Apr 3, 2020
2 parents ec93f25 + 8e3d350 commit 2079431
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,20 @@ else (${libtins_FOUND})
pkg_search_module(libtins REQUIRED libtins)
endif (${libtins_FOUND})

pkg_search_module(JSONCPP REQUIRED jsoncpp)
if (${jsoncpp_FOUND})
MESSAGE(STATUS "jsoncpp found via CMake")
else (${jsoncpp_FOUND})
MESSAGE(STATUS "jsoncpp not found via CMake, trying pkg-config")
pkg_search_module(JSONCPP REQUIRED jsoncpp)
endif (${jsoncpp_FOUND})

add_executable(dublin-traceroute src/main.cc)
target_link_libraries(dublintraceroute ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(dublin-traceroute dublintraceroute)
target_link_libraries(dublintraceroute tins)

target_link_libraries(dublintraceroute ${JSONCPP_LIBRARIES} jsoncpp)
target_include_directories(dublintraceroute PUBLIC ${JSONCPP_INCLUDE_DIRS})
target_include_directories(dublintraceroute PUBLIC ${JSONCPP_INCLUDE_DIRS} ${TINS_INCLUDE_DIRS})

#set_property(TARGET dublintraceroute PROPERTY CXX_STANDARD 11)
#set_property(TARGET dublintraceroute PROPERTY CXX_STANDARD_REQUIRED ON)
Expand Down
3 changes: 2 additions & 1 deletion documentation/readme/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ cmake ..
make
```

#### Building on OS X
#### Building on macOS

You need the latest XCode installed to build this project. Then run:
```bash
brew install https://raw.githubusercontent.com/insomniacslk/dublin-traceroute/master/homebrew/dublin-traceroute.rb
```
Expand Down
26 changes: 16 additions & 10 deletions homebrew/dublin-traceroute.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# frozen_string_literal: true

# You need the latest XCode for this formula to build
class DublinTraceroute < Formula
desc "NAT-aware multipath tracerouting tool"
homepage "https://dublin-traceroute.net"
url "https://github.com/insomniacslk/dublin-traceroute/archive/v0.4.2.tar.gz"
sha256 "255980a630fb0d8b1cac270a656d6236bfddc5ba253bda4b898302918caf76d1"
head "https://github.com/insomniacslk/dublin-traceroute.git"
desc 'NAT-aware multipath tracerouting tool'
homepage 'https://dublin-traceroute.net'
url 'https://github.com/insomniacslk/dublin-traceroute/archive/v0.4.2.tar.gz'
sha256 '255980a630fb0d8b1cac270a656d6236bfddc5ba253bda4b898302918caf76d1'
head 'https://github.com/insomniacslk/dublin-traceroute.git'

depends_on "cmake" => :build
depends_on "libtins"
depends_on "jsoncpp"
depends_on 'cmake' => :build
depends_on 'pkg-config' => :build
# this should be in the libtins formula
depends_on 'libpcap'
depends_on 'libtins'
depends_on 'jsoncpp'

def install
system "cmake", ".", *std_cmake_args
system "make", "install"
system 'cmake', '.', *std_cmake_args
system 'make', 'install'
end

test do
Expand Down

0 comments on commit 2079431

Please sign in to comment.