commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 49/50: cmake: fix case for ctrlport when no


From: git
Subject: [Commit-gnuradio] [gnuradio] 49/50: cmake: fix case for ctrlport when no backends installed
Date: Wed, 15 Apr 2015 21:07:58 +0000 (UTC)

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

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 0ab6607ffb0d45816a69c7069a1da90cc94bf047
Author: Tom Rondeau <address@hidden>
Date:   Wed Apr 15 13:42:15 2015 -0700

    cmake: fix case for ctrlport when no backends installed
---
 CMakeLists.txt                                  |  9 ++++++---
 gnuradio-runtime/lib/controlport/CMakeLists.txt | 11 +++++++++++
 gr-blocks/python/blocks/CMakeLists.txt          |  6 +++---
 3 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bfc0acc..e4cd18b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -408,10 +408,13 @@ if(ENABLE_GR_CTRLPORT)
   set(GR_CTRLPORT True)
   add_definitions(-DGR_CTRLPORT)
 
-  if(THRIFT_FOUND)
+  if(CTRLPORT_BACKENDS GREATER 0)
     set(GR_RPCSERVER_ENABLED True)
-    set(GR_RPCSERVER_THRIFT True)
-  endif(THRIFT_FOUND)
+
+    if(THRIFT_FOUND)
+      set(GR_RPCSERVER_THRIFT True)
+    endif(THRIFT_FOUND)
+  endif(CTRLPORT_BACKENDS GREATER 0)
 endif(ENABLE_GR_CTRLPORT)
 
 # Install our Cmake modules into $prefix/lib/cmake/gnuradio
diff --git a/gnuradio-runtime/lib/controlport/CMakeLists.txt 
b/gnuradio-runtime/lib/controlport/CMakeLists.txt
index 4998aeb..f0d2618 100644
--- a/gnuradio-runtime/lib/controlport/CMakeLists.txt
+++ b/gnuradio-runtime/lib/controlport/CMakeLists.txt
@@ -19,6 +19,9 @@
 
 if(ENABLE_GR_CTRLPORT)
 
+# Keep track of the number of backends ControlPort supports
+SET(CTRLPORT_BACKENDS 0)
+
 # Add definition so we can compile in ControlPort to the blocks.
 add_definitions(-DGR_CTRLPORT)
 
@@ -41,6 +44,8 @@ FIND_PACKAGE(Thrift)
 
 if(THRIFT_FOUND)
 
+MATH(EXPR CTRLPORT_BACKENDS "${CTRLPORT_BACKENDS} + 1")
+
 # Indicate thrift as an installed backend in the cmake summary.
 message(STATUS "Found and enabling Thrift backend to ControlPort")
 GR_APPEND_SUBCOMPONENT("thrift")
@@ -90,4 +95,10 @@ endif(ENABLE_CTRLPORT_THRIFT)
 
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
+# Save the number of backends for testing against later
+set(
+  CTRLPORT_BACKENDS ${CTRLPORT_BACKENDS}
+  CACHE INTERNAL "Number of ControlPort backends available"
+)
+
 endif(ENABLE_GR_CTRLPORT)
diff --git a/gr-blocks/python/blocks/CMakeLists.txt 
b/gr-blocks/python/blocks/CMakeLists.txt
index 4497731..19d808b 100644
--- a/gr-blocks/python/blocks/CMakeLists.txt
+++ b/gr-blocks/python/blocks/CMakeLists.txt
@@ -43,14 +43,14 @@ if(ENABLE_TESTING)
   include(GrTest)
   file(GLOB py_qa_test_files "qa_*.py")
 
-  # Force out the controlport QA tests if we've disabled it.
-  if(NOT ENABLE_GR_CTRLPORT)
+  # Force out the controlport QA tests if we have no backends to use.
+  if(CTRLPORT_BACKENDS EQUAL 0)
     list(REMOVE_ITEM py_qa_test_files
       ${CMAKE_CURRENT_SOURCE_DIR}/qa_cpp_py_binding.py
       ${CMAKE_CURRENT_SOURCE_DIR}/qa_cpp_py_binding_set.py
       ${CMAKE_CURRENT_SOURCE_DIR}/qa_ctrlport_probes.py
       )
-  endif(NOT ENABLE_GR_CTRLPORT)
+  endif(CTRLPORT_BACKENDS EQUAL 0)
 
   foreach(py_qa_test_file ${py_qa_test_files})
     get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]