2023-05-04 11:25:37 +00:00
|
|
|
cmake_minimum_required(VERSION 3.8)
|
2023-12-24 05:35:27 +00:00
|
|
|
if(COMMAND cmake_policy)
|
|
|
|
cmake_policy(SET CMP0003 NEW)
|
|
|
|
endif(COMMAND cmake_policy)
|
2024-01-02 02:52:58 +00:00
|
|
|
|
2023-12-24 01:07:03 +00:00
|
|
|
project(blah2)
|
|
|
|
include(CMakePrintHelpers)
|
2023-12-24 05:35:27 +00:00
|
|
|
include(CTest)
|
2023-05-04 11:25:37 +00:00
|
|
|
|
2023-12-24 01:07:03 +00:00
|
|
|
find_package(Threads REQUIRED)
|
2024-01-13 03:21:55 +00:00
|
|
|
find_package(asio REQUIRED)
|
2024-01-01 16:58:20 +00:00
|
|
|
find_path(RAPIDJSON_INCLUDE_DIRS "rapidjson/allocators.h")
|
2023-12-24 01:07:03 +00:00
|
|
|
find_package(ryml CONFIG REQUIRED)
|
2024-01-01 16:58:20 +00:00
|
|
|
find_package(httplib CONFIG REQUIRED)
|
|
|
|
find_package(Armadillo CONFIG REQUIRED)
|
2023-12-24 01:07:03 +00:00
|
|
|
find_package(Catch2 CONFIG REQUIRED)
|
2023-05-04 11:25:37 +00:00
|
|
|
|
2024-01-13 03:21:55 +00:00
|
|
|
set(CMAKE_PREFIX_PATH "/opt/uhd" ${CMAKE_PREFIX_PATH})
|
|
|
|
find_package(UHD "4.6.0.0" CONFIG REQUIRED)
|
|
|
|
|
2023-12-24 05:35:27 +00:00
|
|
|
SET (PROJECT_ROOT "${PROJECT_SOURCE_DIR}")
|
|
|
|
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin")
|
|
|
|
SET (PROJECT_BINARY_TEST_DIR "${PROJECT_ROOT}/bin/test")
|
2024-01-11 09:11:49 +00:00
|
|
|
SET (PROJECT_BINARY_TEST_UNIT_DIR "${PROJECT_BINARY_TEST_DIR}/unit")
|
2024-05-04 02:41:33 +00:00
|
|
|
SET (PROJECT_BINARY_TEST_FUNCTIONAL_DIR "${PROJECT_BINARY_TEST_DIR}/functional")
|
|
|
|
SET (PROJECT_BINARY_TEST_COMPARISON_DIR "${PROJECT_BINARY_TEST_DIR}/comparison")
|
2023-12-24 05:35:27 +00:00
|
|
|
|
|
|
|
MESSAGE ("Binary path: ${PROJECT_BINARY_DIR}")
|
|
|
|
MESSAGE ("Binary test path: ${PROJECT_BINARY_TEST_DIR}")
|
|
|
|
|
2024-01-02 02:52:58 +00:00
|
|
|
# include from top-level src dir
|
2024-01-13 03:21:55 +00:00
|
|
|
include_directories(src ${UHD_INCLUDE_DIRS})
|
2023-05-04 11:25:37 +00:00
|
|
|
|
2024-01-02 02:52:58 +00:00
|
|
|
# TODO: create FindSdrplay.cmake for this
|
2023-12-24 01:07:03 +00:00
|
|
|
add_library(sdrplay /usr/local/include/sdrplay_api.h)
|
2023-05-04 11:25:37 +00:00
|
|
|
set_target_properties(sdrplay PROPERTIES LINKER_LANGUAGE C)
|
2024-05-27 12:12:40 +00:00
|
|
|
target_link_libraries(sdrplay PUBLIC /usr/local/lib/libsdrplay_api.so.3.15)
|
2023-05-04 11:25:37 +00:00
|
|
|
|
2024-05-04 02:41:33 +00:00
|
|
|
# TODO: Move to separate src/CMakeLists.txt
|
2023-12-24 01:07:03 +00:00
|
|
|
add_executable(blah2
|
|
|
|
src/blah2.cpp
|
|
|
|
src/capture/Capture.cpp
|
2024-01-18 13:17:54 +00:00
|
|
|
src/capture/Source.cpp
|
2023-12-24 01:07:03 +00:00
|
|
|
src/capture/rspduo/RspDuo.cpp
|
2024-01-13 03:21:55 +00:00
|
|
|
src/capture/usrp/Usrp.cpp
|
2024-04-08 12:29:53 +00:00
|
|
|
src/capture/hackrf/HackRf.cpp
|
2024-05-11 14:03:26 +00:00
|
|
|
src/capture/kraken/Kraken.cpp
|
2023-12-24 01:07:03 +00:00
|
|
|
src/process/ambiguity/Ambiguity.cpp
|
|
|
|
src/process/clutter/WienerHopf.cpp
|
|
|
|
src/process/detection/CfarDetector1D.cpp
|
|
|
|
src/process/detection/Centroid.cpp
|
|
|
|
src/process/detection/Interpolate.cpp
|
|
|
|
src/process/tracker/Tracker.cpp
|
|
|
|
src/process/spectrum/SpectrumAnalyser.cpp
|
|
|
|
src/process/meta/HammingNumber.cpp
|
2024-01-31 09:06:41 +00:00
|
|
|
src/process/utility/Socket.cpp
|
2023-12-24 01:07:03 +00:00
|
|
|
src/data/IqData.cpp
|
|
|
|
src/data/Map.cpp
|
|
|
|
src/data/Detection.cpp
|
|
|
|
src/data/Track.cpp
|
|
|
|
src/data/meta/Timing.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(blah2 PRIVATE
|
|
|
|
Threads::Threads
|
|
|
|
asio::asio
|
|
|
|
ryml::ryml
|
|
|
|
httplib::httplib
|
|
|
|
armadillo
|
2024-01-13 22:36:53 +00:00
|
|
|
${UHD_LIBRARIES}
|
2023-12-24 01:07:03 +00:00
|
|
|
fftw3
|
|
|
|
fftw3_threads
|
|
|
|
sdrplay
|
2024-04-08 12:29:53 +00:00
|
|
|
hackrf
|
2024-05-11 14:03:26 +00:00
|
|
|
rtlsdr
|
2023-12-24 05:35:27 +00:00
|
|
|
)
|
2024-01-02 02:52:58 +00:00
|
|
|
target_include_directories(blah2 PRIVATE RAPIDJSON_INCLUDE_DIRS "rapidjson/allocators.h")
|
2023-12-15 06:24:00 +00:00
|
|
|
|
2023-12-18 12:34:47 +00:00
|
|
|
# unit tests
|
|
|
|
add_executable(testAmbiguity
|
2023-12-24 05:35:27 +00:00
|
|
|
test/unit/process/ambiguity/TestAmbiguity.cpp
|
|
|
|
src/data/IqData.cpp
|
|
|
|
src/data/Map.cpp
|
|
|
|
src/process/ambiguity/Ambiguity.cpp
|
2024-05-04 02:41:33 +00:00
|
|
|
src/process/meta/HammingNumber.cpp
|
|
|
|
)
|
|
|
|
target_link_libraries(testAmbiguity PRIVATE
|
|
|
|
Catch2::Catch2WithMain
|
|
|
|
fftw3
|
|
|
|
fftw3_threads
|
|
|
|
)
|
2023-12-28 05:27:43 +00:00
|
|
|
set_target_properties(testAmbiguity PROPERTIES
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_TEST_UNIT_DIR}")
|
|
|
|
|
|
|
|
add_executable(testTracker
|
2023-12-24 05:35:27 +00:00
|
|
|
test/unit/process/tracker/TestTracker.cpp
|
|
|
|
src/data/Detection.cpp
|
|
|
|
src/data/Track.cpp
|
2024-05-04 02:41:33 +00:00
|
|
|
src/process/tracker/Tracker.cpp
|
|
|
|
)
|
|
|
|
target_link_libraries(testTracker PRIVATE
|
|
|
|
Catch2::Catch2WithMain
|
|
|
|
)
|
2023-12-28 05:27:43 +00:00
|
|
|
set_target_properties(testTracker PROPERTIES
|
2023-12-24 05:35:27 +00:00
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_TEST_UNIT_DIR}")
|
|
|
|
|
2024-05-04 02:41:33 +00:00
|
|
|
add_executable(testHammingNumber
|
|
|
|
test/unit/process/meta/TestHammingNumber.cpp
|
|
|
|
src/process/meta/HammingNumber.cpp
|
|
|
|
)
|
|
|
|
target_link_libraries(testHammingNumber PRIVATE
|
|
|
|
Catch2::Catch2WithMain
|
|
|
|
)
|
|
|
|
set_target_properties(testHammingNumber PROPERTIES
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_TEST_UNIT_DIR}")
|
|
|
|
|
|
|
|
# TODO: Unsure if will be using CTest.
|
2023-12-24 05:35:27 +00:00
|
|
|
add_test(NAME testAmbiguity COMMAND testAmbiguity)
|
|
|
|
add_test(NAME testTracker COMMAND testTracker)
|