[hamradio-commits] [gnss-sdr] 279/303: Fix building when Armadillo < 5.300

Carles Fernandez carles_fernandez-guest at moszumanska.debian.org
Mon Feb 13 22:36:08 UTC 2017


This is an automated email from the git hooks/post-receive script.

carles_fernandez-guest pushed a commit to branch master
in repository gnss-sdr.

commit adb088e36c9c271b45a2130bf55fdc057993a2f6
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date:   Fri Feb 3 12:04:15 2017 +0100

    Fix building when Armadillo < 5.300
---
 CMakeLists.txt           | 8 +++++---
 src/tests/CMakeLists.txt | 3 +++
 src/tests/test_main.cc   | 4 +++-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4790143..6c1f3cc 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 0dc9e83..3dae171 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 e35d32a..d97af1e 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)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/gnss-sdr.git



More information about the pkg-hamradio-commits mailing list