From b0e16be2f98d4d8f34df0b927195df6e4367e48f Mon Sep 17 00:00:00 2001
From: Andrej Rode <mail@andrejro.de>
Date: Tue, 14 May 2019 17:36:40 +0200
Subject: cmake: check for python module click as dependency of modtool

Previously cmake did not check if click is installed as it is a runtime
requirement. If CMAKE_CROSSCOMPILING is set the module checking is
skipped.

Closes #2292
---
 gr-utils/python/modtool/CMakeLists.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'gr-utils/python/modtool')

diff --git a/gr-utils/python/modtool/CMakeLists.txt b/gr-utils/python/modtool/CMakeLists.txt
index 2cb7c21487..70fdabedac 100644
--- a/gr-utils/python/modtool/CMakeLists.txt
+++ b/gr-utils/python/modtool/CMakeLists.txt
@@ -19,6 +19,18 @@
 
 include(GrPython)
 
+GR_PYTHON_CHECK_MODULE_RAW(
+  "click"
+  "import click; import click_plugins"
+  CLICK_FOUND
+  )
+
+if(NOT CMAKE_CROSSCOMPILING)
+  if(NOT CLICK_FOUND)
+    message(FATAL_ERROR "Python module click is required for gr-modtool")
+  endif()
+endif()
+
 GR_PYTHON_INSTALL(FILES
     __init__.py
     DESTINATION ${GR_PYTHON_DIR}/gnuradio/modtool
-- 
cgit v1.2.3