From f23985d1e2633d7e2862eb08b21a9bfe9baeb9d1 Mon Sep 17 00:00:00 2001
From: Ryan Volz <ryan.volz@gmail.com>
Date: Sat, 15 May 2021 16:46:07 -0400
Subject: runtime: ctrlport: cmake: Fix thrift dependency for OOTs.

First, this moves find_package(THRIFT) up to the gnuradio-runtime
CMakeLists.txt so that cache variables no longer have to be used to mark
the found components. This fixes an issue where the thrift-specific
headers were not installed even when thrift was enabled, because on
first run the detection was occurring AFTER the runtime include
CMakeLists.txt was evaluated. See further discussion in #2734, which
solved one issue related to this setup.

Further, even with thrift enabled, the thrift headers are not required
for OOTs to build against gnuradio-runtime. OOTs would need to take
special action to use those headers, in which case they should
detect/enable thrift on their own. Thus, this makes the change to not
add thrift as an extra dependency for OOTs and switches linking of
Thrift::thrift from PUBLIC to PRIVATE.

Signed-off-by: Ryan Volz <ryan.volz@gmail.com>
---
 gnuradio-runtime/python/gnuradio/ctrlport/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'gnuradio-runtime/python')

diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/CMakeLists.txt b/gnuradio-runtime/python/gnuradio/ctrlport/CMakeLists.txt
index 0f4a86dc99..5c2773ceda 100644
--- a/gnuradio-runtime/python/gnuradio/ctrlport/CMakeLists.txt
+++ b/gnuradio-runtime/python/gnuradio/ctrlport/CMakeLists.txt
@@ -33,7 +33,7 @@ GR_PYTHON_INSTALL(
     PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
 )
 
-if(THRIFT_FOUND)
+if(ENABLE_CTRLPORT_THRIFT)
 
   list(APPEND thrift_targets
     ${CMAKE_CURRENT_BINARY_DIR}/GNURadio/__init__.py
@@ -67,4 +67,4 @@ if(THRIFT_FOUND)
     DESTINATION ${GR_PYTHON_DIR}/gnuradio/ctrlport/GNURadio
   )
 
-endif(THRIFT_FOUND)
+endif(ENABLE_CTRLPORT_THRIFT)
-- 
cgit v1.2.3