From fa85202c3d33ddf534629b1288e9ce20bbe5b282 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Thu, 19 Oct 2017 14:29:03 +0200 Subject: [PATCH] Moved qsniff to separate sub-project --- source/CMakeLists.txt | 22 +--------------------- source/RCSwitch/CMakeLists.txt | 9 +++++++-- source/qsniff/CMakeLists.txt | 24 ++++++++++++++++++++++++ source/{ => qsniff}/mainwindow.cpp | 0 source/{ => qsniff}/mainwindow.h | 0 source/{ => qsniff}/mainwindow.ui | 0 source/{ => qsniff}/qsniff.cpp | 0 source/{ => qsniff}/sniffthread.cpp | 0 source/{ => qsniff}/sniffthread.h | 0 9 files changed, 32 insertions(+), 23 deletions(-) create mode 100644 source/qsniff/CMakeLists.txt rename source/{ => qsniff}/mainwindow.cpp (100%) rename source/{ => qsniff}/mainwindow.h (100%) rename source/{ => qsniff}/mainwindow.ui (100%) rename source/{ => qsniff}/qsniff.cpp (100%) rename source/{ => qsniff}/sniffthread.cpp (100%) rename source/{ => qsniff}/sniffthread.h (100%) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index e63255e..3b2c5fe 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -1,30 +1,9 @@ cmake_minimum_required(VERSION 3.6) -find_package(Qt5Widgets) - set(CMAKE_CXX_STANDARD 11) -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTOUIC ON) add_definitions(-DRPI) -add_executable(qSniff - qsniff.cpp - mainwindow.cpp - mainwindow.h - mainwindow.ui - sniffthread.cpp - sniffthread.h -) - -target_link_libraries(qSniff - sniffer - rc-switch - wiringPi - Qt5::Widgets -) - add_executable(Sniff sniff.cpp ) @@ -37,4 +16,5 @@ target_link_libraries(Sniff add_subdirectory(RCSwitch) add_subdirectory(sniffer) +add_subdirectory(qsniff) diff --git a/source/RCSwitch/CMakeLists.txt b/source/RCSwitch/CMakeLists.txt index ae85280..0834e87 100644 --- a/source/RCSwitch/CMakeLists.txt +++ b/source/RCSwitch/CMakeLists.txt @@ -1,11 +1,16 @@ +project(rc-switch) cmake_minimum_required(VERSION 3.6) -add_library(rc-switch +add_library(${PROJECT_NAME} rc-switch/RCSwitch.cpp rc-switch/RCSwitch.h ) -target_include_directories(rc-switch +target_link_libraries(${PROJECT_NAME} + wiringPi +) + +target_include_directories(${PROJECT_NAME} PUBLIC . ) diff --git a/source/qsniff/CMakeLists.txt b/source/qsniff/CMakeLists.txt new file mode 100644 index 0000000..dfeb3ab --- /dev/null +++ b/source/qsniff/CMakeLists.txt @@ -0,0 +1,24 @@ +project(qSniff) +cmake_minimum_required(VERSION 3.6) + +find_package(Qt5Widgets) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) + +add_executable(${PROJECT_NAME} + qsniff.cpp + mainwindow.cpp + mainwindow.h + mainwindow.ui + sniffthread.cpp + sniffthread.h +) + +target_link_libraries(${PROJECT_NAME} + sniffer + Qt5::Widgets +) + diff --git a/source/mainwindow.cpp b/source/qsniff/mainwindow.cpp similarity index 100% rename from source/mainwindow.cpp rename to source/qsniff/mainwindow.cpp diff --git a/source/mainwindow.h b/source/qsniff/mainwindow.h similarity index 100% rename from source/mainwindow.h rename to source/qsniff/mainwindow.h diff --git a/source/mainwindow.ui b/source/qsniff/mainwindow.ui similarity index 100% rename from source/mainwindow.ui rename to source/qsniff/mainwindow.ui diff --git a/source/qsniff.cpp b/source/qsniff/qsniff.cpp similarity index 100% rename from source/qsniff.cpp rename to source/qsniff/qsniff.cpp diff --git a/source/sniffthread.cpp b/source/qsniff/sniffthread.cpp similarity index 100% rename from source/sniffthread.cpp rename to source/qsniff/sniffthread.cpp diff --git a/source/sniffthread.h b/source/qsniff/sniffthread.h similarity index 100% rename from source/sniffthread.h rename to source/qsniff/sniffthread.h