diff --git a/CMakeLists.txt b/CMakeLists.txt index 4790143c3..6c1f3ccce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,7 @@ option(ENABLE_CUDA "Enable building of processing blocks implemented with CUDA ( option(ENABLE_GENERIC_ARCH "Builds a portable binary" OFF) option(ENABLE_PACKAGING "Enable software packaging" OFF) option(ENABLE_OWN_GLOG "Download glog and link it to gflags" OFF) +option(ENABLE_OWN_ARMADILLO "Download and build Armadillo locally" OFF) option(ENABLE_LOG "Enable logging" ON) if(ENABLE_PACKAGING) set(ENABLE_GENERIC_ARCH ON) @@ -875,7 +876,7 @@ if(OS_IS_LINUX) endif(OS_IS_LINUX) find_package(Armadillo) -if(NOT ARMADILLO_FOUND) +if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) message(STATUS " Armadillo has not been found.") message(STATUS " Armadillo will be downloaded and built automatically ") message(STATUS " when doing 'make'. ") @@ -924,11 +925,12 @@ if(NOT ARMADILLO_FOUND) file(COPY ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo ) -else(NOT ARMADILLO_FOUND) + set(ARMADILLO_VERSION_STRING ${armadillo_RELEASE}) +else(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) set(armadillo_RELEASE ${ARMADILLO_VERSION_STRING}) add_library(armadillo-${armadillo_RELEASE} UNKNOWN IMPORTED) set_property(TARGET armadillo-${armadillo_RELEASE} PROPERTY IMPORTED_LOCATION "${ARMADILLO_LIBRARIES}") -endif(NOT ARMADILLO_FOUND) +endif(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 0dc9e830a..3dae17162 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -252,6 +252,9 @@ include_directories( # Unit testing ################################################################################ if(ENABLE_UNIT_TESTING) + if( ${ARMADILLO_VERSION_STRING} STRGREATER "5.300") # make sure interp1 is present + add_definitions(-DMODERN_ARMADILLO) + endif( ${ARMADILLO_VERSION_STRING} STRGREATER "5.300") add_executable(run_tests ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc) add_custom_command(TARGET run_tests POST_BUILD diff --git a/src/tests/test_main.cc b/src/tests/test_main.cc index e35d32a1d..d97af1e8c 100644 --- a/src/tests/test_main.cc +++ b/src/tests/test_main.cc @@ -125,9 +125,11 @@ DECLARE_string(log_dir); #if EXTRA_TESTS #include "unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc" +#include "unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc" +#if MODERN_ARMADILLO #include "unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc" #include "unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc" -#include "unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc" +#endif #endif // For GPS NAVIGATION (L1)