From 84939234eb66fe7957eaf39956f18224e3108c25 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 7 Apr 2017 17:45:02 +0200 Subject: o Refactoring into two parts, sender and receiver that sends protobuf messages over UDP. --- CMakeLists.txt | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index ba802f4..6fa065d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,21 +1,42 @@ cmake_minimum_required(VERSION 3.6) +project(wifi-triangulator) + include(CheckIncludeFiles) include(CheckLibraryExists) -project(wifi-triangulator) +include(FindProtobuf) set(CMAKE_CXX_STANDARD 14) +###################################################### +# Check dependencies check_include_files("pcap.h" HAVE_PCAP_H) -if(NOT HAVE_PCAP_H) +if (NOT HAVE_PCAP_H) message(FATAL_ERROR "Missing pcap.h. You should probably install libpcap-dev or similar.") -endif() +endif () + +find_package(Protobuf REQUIRED) +include_directories(${Protobuf_INCLUDE_DIRS} ${Protobuf_INCLUDE_DIR}) + +# lib wifi-triangulator +protobuf_generate_cpp(PROTO_SRC PROTO_HEADER wifi-triangulator.proto) + +add_library(wifi-triangulator + core.cpp misc.cpp + ${PROTO_SRC} + ${PROTO_HEADER} + include/wifi-triangulator/core.h + third-party/radiotap-library/radiotap.c + third-party/radiotap-library/radiotap.h + third-party/radiotap-library/radiotap_iter.h + third-party/radiotap-library/platform.h) +target_include_directories(wifi-triangulator PUBLIC include ${CMAKE_CURRENT_BINARY_DIR}) +target_link_libraries(wifi-triangulator PUBLIC pcap ${Protobuf_LIBRARIES}) -set(SOURCE_FILES main.cpp - third-party/radiotap-library/radiotap.c - third-party/radiotap-library/radiotap.h - third-party/radiotap-library/radiotap_iter.h - third-party/radiotap-library/platform.h) -add_executable(wifi-triangulator ${SOURCE_FILES}) +# capture +add_executable(capture capture.cpp) +target_link_libraries(capture PUBLIC wifi-triangulator) -target_link_libraries(wifi-triangulator PUBLIC pcap) +# receiver +add_executable(receiver receiver.cpp) +target_link_libraries(receiver PUBLIC wifi-triangulator) -- cgit v1.2.3