summaryrefslogtreecommitdiff
path: root/cmake/Modules
diff options
context:
space:
mode:
authorAndrej Rode <mail@andrejro.de>2019-03-23 17:31:36 +0100
committerGitHub <noreply@github.com>2019-03-23 17:31:36 +0100
commit59e0044591989860b840447645d2b0f3b43be25d (patch)
tree3be4040afe4163626bccc9bb3bbffb608e943f04 /cmake/Modules
parentb238e90b1f8c50f4a7855192c3b82a5871786062 (diff)
parentf760c6ff55572d27e2746a62c069e021db357248 (diff)
cmake: Export settings for OOTs
Reduce CMake code duplication needed for a OOT. Used Python version and setting if GRC is enabled are now set in GnuradioConfig.cmake.
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/FindTHRIFT.cmake1
-rw-r--r--cmake/Modules/GnuradioConfig.cmake.in53
2 files changed, 44 insertions, 10 deletions
diff --git a/cmake/Modules/FindTHRIFT.cmake b/cmake/Modules/FindTHRIFT.cmake
index 3aa2bf2ce7..970a9c4c31 100644
--- a/cmake/Modules/FindTHRIFT.cmake
+++ b/cmake/Modules/FindTHRIFT.cmake
@@ -65,7 +65,6 @@ endif(THRIFT_VERSION VERSION_LESS THRIFT_REQ_VERSION)
IF (CMAKE_CROSSCOMPILING)
SET(PYTHON_THRIFT_FOUND TRUE)
ELSE (CMAKE_CROSSCOMPILING)
- include(GrPython)
GR_PYTHON_CHECK_MODULE("Thrift" thrift "1" PYTHON_THRIFT_FOUND)
ENDIF (CMAKE_CROSSCOMPILING)
diff --git a/cmake/Modules/GnuradioConfig.cmake.in b/cmake/Modules/GnuradioConfig.cmake.in
index bfed6fb0b0..832e8fcca7 100644
--- a/cmake/Modules/GnuradioConfig.cmake.in
+++ b/cmake/Modules/GnuradioConfig.cmake.in
@@ -1,4 +1,4 @@
-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013, 2019 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -22,10 +22,6 @@ include(CMakeFindDependencyMacro)
# Allows us to use all .cmake files in this directory
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_LIST_DIR}")
-# Easily access all libraries and includes of GNU Radio
-set(GNURADIO_ALL_LIBRARIES "")
-set(GNURADIO_ALL_INCLUDE_DIRS "")
-
find_dependency(LOG4CPP)
find_dependency(MPLIB)
find_dependency(Boost "@Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@.@Boost_SUBMINOR_VERSION@" COMPONENTS
@@ -38,15 +34,54 @@ find_dependency(Boost "@Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@.@Boost_SUBMIN
unit_test_framework
)
find_dependency(Volk)
+set(ENABLE_PYTHON @ENABLE_PYTHON@ CACHE BOOL "Enable Python & SWIG")
+if(${ENABLE_PYTHON})
+ set(PYTHON_EXECUTABLE @PYTHON_EXECUTABLE@)
+ set(GR_PYTHON_DIR @GR_PYTHON_DIR@)
+ include(GrPython)
+endif()
-include("${CMAKE_CURRENT_LIST_DIR}/gnuradio-pmtTargets.cmake")
-include("${CMAKE_CURRENT_LIST_DIR}/gnuradio-runtimeTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/gnuradio-pmtConfig.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/gnuradio-runtimeConfig.cmake")
cmake_policy(SET CMP0012 NEW)
cmake_policy(SET CMP0057 NEW)
-if(@ENABLE_PYTHON@)
-include("${CMAKE_CURRENT_LIST_DIR}/runtime_swigTargets.cmake")
+
+#Can't use Python if GNU Radio was built without support for it
+if(${ENABLE_PYTHON})
+ include("${CMAKE_CURRENT_LIST_DIR}/runtime_swigTargets.cmake")
endif()
+# Propagate the enabledness of GRC:
+# Since GRC doesn't contain proper CMake targets (yet?), we need to do this
+# manually
+set(ENABLE_GRC @ENABLE_GRC@ CACHE BOOL "Enable GRC features (export block YAML)")
+if(@ENABLE_GRC@)
+ set(GRC_BLOCKS_DIR "@GRC_BLOCKS_DIR@")
+endif()
+# Same for a few "special" features.
+set(GR_PERFORMANCE_COUNTERS @GR_PERFORMANCE_COUNTERS@)
+set(GR_CTRLPORT @GR_CTRLPORT@)
+set(GR_RPCSERVER_ENABLED @GR_RPCSERVER_ENABLED@)
+set(ENABLE_CTRLPORT_THRIFT @ENABLE_CTRLPORT_THRIFT@)
+set(GR_RPCSERVER_THRIFT @GR_RPCSERVER_THRIFT@)
+
+# Propagate global options
+set(GR_RUNTIME_DIR "@GR_RUNTIME_DIR@")
+set(GR_LIBRARY_DIR "@GR_LIBRARY_DIR@")
+set(GR_DATA_DIR "@GR_DATA_DIR@")
+set(GR_PKG_DATA_DIR "@GR_PKG_DATA_DIR@")
+set(GR_DOC_DIR "@GR_DOC_DIR@")
+set(GR_PKG_DOC_DIR "@GR_PKG_DOC_DIR@")
+set(GR_LIBEXEC_DIR "@GR_LIBEXEC_DIR@")
+set(GR_PKG_LIBEXEC_DIR "@GR_PKG_LIBEXEC_DIR@")
+set(GR_THEMES_DIR "@GR_THEMES_DIR@")
+set(GR_CONF_DIR "@GR_CONF_DIR@")
+set(SYSCONFDIR "@SYSCONFDIR@")
+set(GR_PREFSDIR "@GR_PREFSDIR@")
+
+
+# We check the requested components in the order given by the list below –
+# ordering matters; we have module interdependencies.
set(GR_COMPONENTS
blocks
fec