summaryrefslogtreecommitdiff
path: root/grc
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2016-09-02 09:47:44 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2016-09-02 09:47:44 -0700
commit950159844b526435fd3d8c13c9bdfdbafbd61d5e (patch)
tree46c5ba2f3aadb984fe11782f9abdfa7931384ddd /grc
parent27e18c0cf29a2bf352e73351572cef98c164e97d (diff)
parentace1b8c8832f37bfdc3e186c3d643b8900850929 (diff)
Merge remote-tracking branch 'gnuradio-wg-grc/next_grcwg' into next
Diffstat (limited to 'grc')
-rw-r--r--grc/blocks/CMakeLists.txt23
-rw-r--r--grc/blocks/options.xml (renamed from grc/blocks/options.xml.cmakein)2
2 files changed, 20 insertions, 5 deletions
diff --git a/grc/blocks/CMakeLists.txt b/grc/blocks/CMakeLists.txt
index 8d93852c29..d46b1febbe 100644
--- a/grc/blocks/CMakeLists.txt
+++ b/grc/blocks/CMakeLists.txt
@@ -22,7 +22,18 @@ include(GrPython)
file(GLOB xml_files "*.xml")
-configure_file(options.xml.cmakein "${CMAKE_CURRENT_BINARY_DIR}/options.xml" @ONLY)
+macro(REPLACE_IN_FILE _xml_block match replace)
+ set(xml_block_src "${CMAKE_CURRENT_SOURCE_DIR}/${_xml_block}")
+ set(xml_block "${CMAKE_CURRENT_BINARY_DIR}/${_xml_block}")
+
+ list(REMOVE_ITEM xml_files "${xml_block_src}")
+ file(READ "${xml_block_src}" xml_block_src_text)
+ string(REPLACE "${match}" "${replace}"
+ xml_block_text "${xml_block_src_text}")
+ file(WRITE "${xml_block}" "${xml_block_text}")
+
+ list(APPEND generated_xml_files "${xml_block}")
+endmacro()
macro(GEN_BLOCK_XML _generator _xml_block)
set(generator ${CMAKE_CURRENT_SOURCE_DIR}/${_generator})
@@ -32,13 +43,17 @@ macro(GEN_BLOCK_XML _generator _xml_block)
DEPENDS ${generator} OUTPUT ${xml_block}
COMMAND ${PYTHON_EXECUTABLE} ${generator} ${xml_block}
)
-endmacro(GEN_BLOCK_XML)
+endmacro()
+
+GEN_BLOCK_XML(variable_struct.xml.py variable_struct.xml)
-GEN_BLOCK_XML(variable_struct.xml.py variable_struct.xml)
+if(DESIRED_QT_VERSION EQUAL 4)
+ REPLACE_IN_FILE(options.xml PyQt5 PyQt4)
+endif()
add_custom_target(grc_generated_xml ALL DEPENDS ${generated_xml_files})
install(
- FILES ${xml_files} "${CMAKE_CURRENT_BINARY_DIR}/options.xml" ${generated_xml_files}
+ FILES ${xml_files} ${generated_xml_files}
DESTINATION ${GRC_BLOCKS_DIR}
)
diff --git a/grc/blocks/options.xml.cmakein b/grc/blocks/options.xml
index 985662f82e..e03269292c 100644
--- a/grc/blocks/options.xml.cmakein
+++ b/grc/blocks/options.xml
@@ -16,7 +16,7 @@ from grc_gnuradio import wxgui as grc_wxgui
import wx
#end if
#if $generate_options() == 'qt_gui'
-from PyQt@DESIRED_QT_VERSION@ import Qt
+from PyQt5 import Qt
import sys
#end if
#if not $generate_options().startswith('hb')