<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[117181] trunk/dports/science/gnuradio</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/117181">117181</a></dd>
<dt>Author</dt> <dd>michaelld@macports.org</dd>
<dt>Date</dt> <dd>2014-02-18 10:21:51 -0800 (Tue, 18 Feb 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>gnuradio:
+ update devel to cf8997cc and next to a41a1e1b, both 20140216;
+ rev-bump releaase and legacy for new UHD API;
+ make cmake-expand patch different for release and devel.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportssciencegnuradioPortfile">trunk/dports/science/gnuradio/Portfile</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportssciencegnuradiofilespatchcmakeexpanddeveldiff">trunk/dports/science/gnuradio/files/patch-cmake-expand.devel.diff</a></li>
<li><a href="#trunkdportssciencegnuradiofilespatchcmakeexpandreleasediff">trunk/dports/science/gnuradio/files/patch-cmake-expand.release.diff</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkdportssciencegnuradiofilespatchcmakeexpanddiff">trunk/dports/science/gnuradio/files/patch-cmake-expand.diff</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportssciencegnuradioPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/science/gnuradio/Portfile (117180 => 117181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/science/gnuradio/Portfile        2014-02-18 18:19:49 UTC (rev 117180)
+++ trunk/dports/science/gnuradio/Portfile        2014-02-18 18:21:51 UTC (rev 117181)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> if {${subport} eq ${name}} {
</span><span class="cx">
</span><span class="cx"> version 3.7.2.1
</span><del>- revision 1
</del><ins>+ revision 2
</ins><span class="cx">
</span><span class="cx"> long_description ${description}: \
</span><span class="cx"> This port is kept up with the GNU Radio release, currently ${version}, which is typically updated every few months.
</span><span class="lines">@@ -38,6 +38,9 @@
</span><span class="cx"> rmd160 14a04753ce6185daa92ebcb6619df9c130a70757 \
</span><span class="cx"> sha256 8c6b7e1fda31e9228bdd62a137af901b28757d7e1b044de2e985b96e53c83c80
</span><span class="cx">
</span><ins>+ patchfiles-append \
+ patch-cmake-expand.release.diff
+
</ins><span class="cx"> livecheck.url http://gnuradio.org/releases/gnuradio/?C=M&O=D
</span><span class="cx"> livecheck.regex >LATEST-IS-(\[^<\]*)<
</span><span class="cx">
</span><span class="lines">@@ -46,7 +49,7 @@
</span><span class="cx"> subport gnuradio-legacy {
</span><span class="cx">
</span><span class="cx"> version 3.6.5.1
</span><del>- revision 5
</del><ins>+ revision 6
</ins><span class="cx">
</span><span class="cx"> long_description ${description}: \
</span><span class="cx"> This port is for GNU Radio ${version}, reflecting the final release in the 3.6 API series. It is for legacy purposes only\; please consider updating your code to the GNU Radio 3.7 API.
</span><span class="lines">@@ -86,14 +89,16 @@
</span><span class="cx"> long_description ${description}: \
</span><span class="cx"> This port is kept up with the GNU Radio GIT 'master' branch, which is typically updated daily to weekly. This version of GNU Radio generally contains fixes to, and its API is compatible with, the current GNU Radio release, and will be incorporated in an upcoming release. This port may or not compile or function correctly, as it represents a work in progress. If it does not work, check back in a few days. Or try deactivating the currently active gnuradio port, cleaning any current builds, and trying again.
</span><span class="cx">
</span><del>- version 3.7.3_20140211
</del><ins>+ version 3.7.3_20140216
</ins><span class="cx">
</span><span class="cx"> conflicts gnuradio-legacy gnuradio gnuradio-next
</span><span class="cx">
</span><span class="cx"> fetch.type git
</span><span class="cx"> git.url http://git.gnuradio.org/git/gnuradio.git
</span><del>- git.branch 295ba353abebfedf90ece523343bcfeea2c2149d
</del><ins>+ git.branch cf8997ccc1e9c543aa234e561e7f002a176e13dc
</ins><span class="cx">
</span><ins>+ patchfiles-append patch-cmake-expand.devel.diff
+
</ins><span class="cx"> livecheck.url http://gnuradio.org/cgit/cgit.cgi/gnuradio/log/?h=master
</span><span class="cx"> livecheck.version ${git.branch}
</span><span class="cx"> livecheck.regex id=(\[a-f0-9\]+).*>master<
</span><span class="lines">@@ -105,13 +110,13 @@
</span><span class="cx"> long_description ${description}: \
</span><span class="cx"> This port is kept up with the GNU Radio GIT 'next' branch, which is typically updated daily to weekly. This version of GNU Radio represents the next major release of GNU Radio, and hence its API is likely to be different than that provided by either gnuradio or gnuradio-devel. This port may or not compile or function correctly, as it represents a work in progress. If it does not work, check back in a few days. Or try deactivating the currently active gnuradio port, cleaning any current builds, and trying again.
</span><span class="cx">
</span><del>- version 3.8.0_20140211
</del><ins>+ version 3.8.0_20140216
</ins><span class="cx">
</span><span class="cx"> conflicts gnuradio-legacy gnuradio gnuradio-devel
</span><span class="cx">
</span><span class="cx"> fetch.type git
</span><span class="cx"> git.url http://git.gnuradio.org/git/gnuradio.git
</span><del>- git.branch 1e6a0dcdb925bd38cd6e67773e6c30c32e386fd3
</del><ins>+ git.branch a41a1e1b4f326ad12864142575418f9ed848656a
</ins><span class="cx">
</span><span class="cx"> livecheck.url http://gnuradio.org/cgit/cgit.cgi/gnuradio/log/?h=next
</span><span class="cx"> livecheck.version ${git.branch}
</span><span class="lines">@@ -138,9 +143,6 @@
</span><span class="cx"> configure.args-append -DENABLE_GR_CTRLPORT=OFF
</span><span class="cx">
</span><span class="cx"> }
</span><del>-
- patchfiles-append patch-cmake-expand.diff
-
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> use_parallel_build yes
</span></span></pre></div>
<a id="trunkdportssciencegnuradiofilespatchcmakeexpanddeveldifffromrev117178trunkdportssciencegnuradiofilespatchcmakeexpanddiff"></a>
<div class="copfile"><h4>Copied: trunk/dports/science/gnuradio/files/patch-cmake-expand.devel.diff (from rev 117178, trunk/dports/science/gnuradio/files/patch-cmake-expand.diff) (0 => 117181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/science/gnuradio/files/patch-cmake-expand.devel.diff         (rev 0)
+++ trunk/dports/science/gnuradio/files/patch-cmake-expand.devel.diff        2014-02-18 18:21:51 UTC (rev 117181)
</span><span class="lines">@@ -0,0 +1,1154 @@
</span><ins>+--- cmake/Modules/GrMiscUtils.cmake.orig
++++ cmake/Modules/GrMiscUtils.cmake
+@@ -333,7 +333,7 @@ set(CMAKE_REQUIRED_LIBRARIES -lpthread)
+ } " HAVE_PTHREAD_SETSCHEDPARAM
+ )
+ GR_ADD_COND_DEF(HAVE_PTHREAD_SETSCHEDPARAM)
+-
++
+ CHECK_CXX_SOURCE_COMPILES("
+ #include <sched.h>
+ int main(){
+@@ -345,3 +345,210 @@ set(CMAKE_REQUIRED_LIBRARIES -lpthread)
+ GR_ADD_COND_DEF(HAVE_SCHED_SETSCHEDULER)
+ endmacro(GR_CHECK_LINUX_SCHED_AVAIL)
+
++########################################################################
++# Macros to generate source and header files from template
++########################################################################
++macro(GR_EXPAND_X_H component root)
++
++ include(GrPython)
++
++ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++"#!${PYTHON_EXECUTABLE}
++
++import sys, os, re
++sys.path.append('${GR_RUNTIME_PYTHONPATH}')
++os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
++os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
++
++if __name__ == '__main__':
++ import build_utils
++ root, inp = sys.argv[1:3]
++ for sig in sys.argv[3:]:
++ name = re.sub ('X+', sig, root)
++ d = build_utils.standard_dict2(name, sig, '${component}')
++ build_utils.expand_template(d, inp)
++")
++
++ #make a list of all the generated headers
++ unset(expanded_files_h)
++ foreach(sig ${ARGN})
++ string(REGEX REPLACE "X+" ${sig} name ${root})
++ list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
++ endforeach(sig)
++ unset(name)
++
++ #try to force generate the headers
++ execute_process(
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}.h.t ${ARGN}
++ )
++
++ #create a command to generate the headers
++ add_custom_command(
++ OUTPUT ${expanded_files_h}
++ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}.h.t ${ARGN}
++ )
++
++ #install rules for the generated headers
++ list(APPEND generated_includes ${expanded_files_h})
++
++endmacro(GR_EXPAND_X_H)
++
++macro(GR_EXPAND_X_CC_H component root)
++
++ include(GrPython)
++
++ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++"#!${PYTHON_EXECUTABLE}
++
++import sys, os, re
++sys.path.append('${GR_RUNTIME_PYTHONPATH}')
++os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
++os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
++
++if __name__ == '__main__':
++ import build_utils
++ root, inp = sys.argv[1:3]
++ for sig in sys.argv[3:]:
++ name = re.sub ('X+', sig, root)
++ d = build_utils.standard_impl_dict2(name, sig, '${component}')
++ build_utils.expand_template(d, inp)
++")
++
++ #make a list of all the generated files
++ unset(expanded_files_cc)
++ unset(expanded_files_h)
++ foreach(sig ${ARGN})
++ string(REGEX REPLACE "X+" ${sig} name ${root})
++ list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
++ list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
++ endforeach(sig)
++ unset(name)
++
++ #try to force generate the source files
++ execute_process(
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}.cc.t ${ARGN}
++ )
++
++ #create a command to generate the source files
++ add_custom_command(
++ OUTPUT ${expanded_files_cc}
++ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}.cc.t ${ARGN}
++ )
++
++ #try to force generate the header files
++ execute_process(
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}.h.t ${ARGN}
++ )
++
++ #create a command to generate the header files
++ add_custom_command(
++ OUTPUT ${expanded_files_h}
++ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}.h.t ${ARGN}
++ )
++
++ #make source files depends on headers to force generation
++ set_source_files_properties(${expanded_files_cc}
++ PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
++ )
++
++ #install rules for the generated files
++ list(APPEND generated_sources ${expanded_files_cc})
++ list(APPEND generated_headers ${expanded_files_h})
++
++endmacro(GR_EXPAND_X_CC_H)
++
++macro(GR_EXPAND_X_CC_H_IMPL component root)
++
++ include(GrPython)
++
++ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++"#!${PYTHON_EXECUTABLE}
++
++import sys, os, re
++sys.path.append('${GR_RUNTIME_PYTHONPATH}')
++os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
++os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
++
++if __name__ == '__main__':
++ import build_utils
++ root, inp = sys.argv[1:3]
++ for sig in sys.argv[3:]:
++ name = re.sub ('X+', sig, root)
++ d = build_utils.standard_dict(name, sig, '${component}')
++ build_utils.expand_template(d, inp, '_impl')
++")
++
++ #make a list of all the generated files
++ unset(expanded_files_cc_impl)
++ unset(expanded_files_h_impl)
++ unset(expanded_files_h)
++ foreach(sig ${ARGN})
++ string(REGEX REPLACE "X+" ${sig} name ${root})
++ list(APPEND expanded_files_cc_impl ${CMAKE_CURRENT_BINARY_DIR}/${name}_impl.cc)
++ list(APPEND expanded_files_h_impl ${CMAKE_CURRENT_BINARY_DIR}/${name}_impl.h)
++ list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/../include/gnuradio/${component}/${name}.h)
++ endforeach(sig)
++ unset(name)
++
++ #try to force generate the _impl.cc files
++ execute_process(
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}_impl.cc.t ${ARGN}
++ )
++
++ #create a command to generate the _impl.cc files
++ add_custom_command(
++ OUTPUT ${expanded_files_cc_impl}
++ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.cc.t
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}_impl.cc.t ${ARGN}
++ )
++
++ #try to force generate the _impl.h files
++ execute_process(
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}_impl.h.t ${ARGN}
++ )
++
++ #create a command to generate the _impl.h files
++ add_custom_command(
++ OUTPUT ${expanded_files_h_impl}
++ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.h.t
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}_impl.h.t ${ARGN}
++ )
++
++ #make _impl.cc source files depend on _impl.h to force generation
++ set_source_files_properties(${expanded_files_cc_impl}
++ PROPERTIES OBJECT_DEPENDS "${expanded_files_h_impl}"
++ )
++
++ #make _impl.h source files depend on headers to force generation
++ set_source_files_properties(${expanded_files_h_impl}
++ PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
++ )
++
++ #install rules for the generated files
++ list(APPEND generated_sources ${expanded_files_cc_impl})
++ list(APPEND generated_headers ${expanded_files_h_impl})
++
++endmacro(GR_EXPAND_X_CC_H_IMPL)
+--- gr-analog/include/gnuradio/analog/CMakeLists.txt.orig
++++ gr-analog/include/gnuradio/analog/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-# Copyright 2012 Free Software Foundation, Inc.
++# Copyright 2012-2013 Free Software Foundation, Inc.
+ #
+ # This file is part of GNU Radio
+ #
+@@ -18,55 +18,12 @@
+ # Boston, MA 02110-1301, USA.
+
+ ########################################################################
+-# generate helper scripts to expand templated files
+-########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_dict2(name, sig, 'analog')
+- build_utils.expand_template(d, inp)
+-
+-")
+-
+-macro(expand_h root)
+- #make a list of all the generated files
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the files
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #install rules for the generated h files
+- list(APPEND generated_includes ${expanded_files_h})
+-endmacro(expand_h)
+-
+-########################################################################
+-# Invoke macro to generate various sources
++# Invoke macro to generate various headers
+ #######################################################################
+-expand_h(noise_source_X s i f c)
+-expand_h(fastnoise_source_X s i f c)
+-expand_h(sig_source_X s i f c)
++include(GrMiscUtils)
++GR_EXPAND_X_H(analog noise_source_X s i f c)
++GR_EXPAND_X_H(analog fastnoise_source_X s i f c)
++GR_EXPAND_X_H(analog sig_source_X s i f c)
+
+ add_custom_target(analog_generated_includes DEPENDS
+ ${generated_includes}
+--- gr-analog/lib/CMakeLists.txt.orig
++++ gr-analog/lib/CMakeLists.txt
+@@ -41,72 +41,12 @@ if(ENABLE_GR_CTRLPORT)
+ endif(ENABLE_GR_CTRLPORT)
+
+ ########################################################################
+-# generate helper scripts to expand templated files
++# Invoke macro to generate various sources and headers
+ ########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_impl_dict2(name, sig, 'analog')
+- build_utils.expand_template(d, inp)
+-")
+-
+-macro(expand_cc root)
+- #make a list of all the generated files
+- unset(expanded_files_cc)
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the source files
+- add_custom_command(
+- OUTPUT ${expanded_files_cc}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.cc.t ${ARGN}
+- )
+-
+- #create a command to generate the header file
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #make source files depends on headers to force generation
+- set_source_files_properties(${expanded_files_cc}
+- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
+- )
+-
+- #install rules for the generated cc files
+- list(APPEND generated_sources ${expanded_files_cc})
+- list(APPEND generated_headers ${expanded_files_h})
+-endmacro(expand_cc)
+-
+-
+-########################################################################
+-# Invoke macro to generate various sources
+-########################################################################
+-expand_cc(noise_source_X_impl s i f c)
+-expand_cc(fastnoise_source_X_impl s i f c)
+-expand_cc(sig_source_X_impl s i f c)
++include(GrMiscUtils)
++GR_EXPAND_X_CC_H(analog noise_source_X_impl s i f c)
++GR_EXPAND_X_CC_H(analog fastnoise_source_X_impl s i f c)
++GR_EXPAND_X_CC_H(analog sig_source_X_impl s i f c)
+
+ ########################################################################
+ # Setup library
+--- gr-blocks/include/gnuradio/blocks/CMakeLists.txt.orig
++++ gr-blocks/include/gnuradio/blocks/CMakeLists.txt
+@@ -18,79 +18,36 @@
+ # Boston, MA 02110-1301, USA.
+
+ ########################################################################
+-# generate helper scripts to expand templated files
++# Invoke macro to generate various headers
+ ########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_dict(name, sig, 'blocks')
+- build_utils.expand_template(d, inp)
+-
+-")
+-
+-macro(expand_h root)
+- #make a list of all the generated files
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the files
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #install rules for the generated h files
+- list(APPEND generated_includes ${expanded_files_h})
+-endmacro(expand_h)
+-
+-########################################################################
+-# Invoke macro to generate various sources
+-########################################################################
+-expand_h(add_XX ss ii cc)
+-expand_h(add_const_XX bb ss ii ff cc)
+-expand_h(add_const_vXX bb ss ii ff cc)
+-expand_h(and_XX bb ss ii)
+-expand_h(and_const_XX bb ss ii)
+-expand_h(argmax_XX fs is ss)
+-expand_h(divide_XX ss ii ff cc)
+-expand_h(integrate_XX ss ii ff cc)
+-expand_h(max_XX ff ii ss)
+-expand_h(moving_average_XX ss ii ff cc)
+-expand_h(multiply_XX ss ii)
+-expand_h(multiply_const_XX ss ii)
+-expand_h(multiply_const_vXX ss ii ff cc)
+-expand_h(mute_XX ss ii ff cc)
+-expand_h(not_XX bb ss ii)
+-expand_h(or_XX bb ss ii)
+-expand_h(peak_detector_XX fb ib sb)
+-expand_h(probe_signal_X b s i f c)
+-expand_h(probe_signal_vX b s i f c)
+-expand_h(sample_and_hold_XX bb ss ii ff)
+-expand_h(sub_XX ss ii ff cc)
+-expand_h(xor_XX bb ss ii)
+-expand_h(packed_to_unpacked_XX bb ss ii)
+-expand_h(unpacked_to_packed_XX bb ss ii)
+-expand_h(vector_insert_X b s i f c)
+-expand_h(vector_sink_X b s i f c)
+-expand_h(vector_source_X b s i f c)
++include(GrMiscUtils)
++GR_EXPAND_X_H(blocks add_XX ss ii cc)
++GR_EXPAND_X_H(blocks add_const_XX bb ss ii ff cc)
++GR_EXPAND_X_H(blocks add_const_vXX bb ss ii ff cc)
++GR_EXPAND_X_H(blocks and_XX bb ss ii)
++GR_EXPAND_X_H(blocks and_const_XX bb ss ii)
++GR_EXPAND_X_H(blocks argmax_XX fs is ss)
++GR_EXPAND_X_H(blocks divide_XX ss ii ff cc)
++GR_EXPAND_X_H(blocks integrate_XX ss ii ff cc)
++GR_EXPAND_X_H(blocks max_XX ff ii ss)
++GR_EXPAND_X_H(blocks moving_average_XX ss ii ff cc)
++GR_EXPAND_X_H(blocks multiply_XX ss ii)
++GR_EXPAND_X_H(blocks multiply_const_XX ss ii)
++GR_EXPAND_X_H(blocks multiply_const_vXX ss ii ff cc)
++GR_EXPAND_X_H(blocks mute_XX ss ii ff cc)
++GR_EXPAND_X_H(blocks not_XX bb ss ii)
++GR_EXPAND_X_H(blocks or_XX bb ss ii)
++GR_EXPAND_X_H(blocks peak_detector_XX fb ib sb)
++GR_EXPAND_X_H(blocks probe_signal_X b s i f c)
++GR_EXPAND_X_H(blocks probe_signal_vX b s i f c)
++GR_EXPAND_X_H(blocks sample_and_hold_XX bb ss ii ff)
++GR_EXPAND_X_H(blocks sub_XX ss ii ff cc)
++GR_EXPAND_X_H(blocks xor_XX bb ss ii)
++GR_EXPAND_X_H(blocks packed_to_unpacked_XX bb ss ii)
++GR_EXPAND_X_H(blocks unpacked_to_packed_XX bb ss ii)
++GR_EXPAND_X_H(blocks vector_insert_X b s i f c)
++GR_EXPAND_X_H(blocks vector_sink_X b s i f c)
++GR_EXPAND_X_H(blocks vector_source_X b s i f c)
+
+ add_custom_target(blocks_generated_includes DEPENDS
+ ${generated_includes}
+--- gr-blocks/lib/CMakeLists.txt.orig
++++ gr-blocks/lib/CMakeLists.txt
+@@ -23,100 +23,36 @@
+ include(${CMAKE_CURRENT_SOURCE_DIR}/ConfigChecks.cmake)
+
+ ########################################################################
+-# generate helper scripts to expand templated files
+-########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_dict(name, sig, 'blocks')
+- build_utils.expand_template(d, inp, '_impl')
+-")
+-
+-macro(expand_cc_h_impl root)
+- #make a list of all the generated files
+- unset(expanded_files_cc_impl)
+- unset(expanded_files_h_impl)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_cc_impl ${CMAKE_CURRENT_BINARY_DIR}/${name}_impl.cc)
+- list(APPEND expanded_files_h_impl ${CMAKE_CURRENT_BINARY_DIR}/${name}_impl.h)
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/../include/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the _impl.cc files
+- add_custom_command(
+- OUTPUT ${expanded_files_cc_impl}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.cc.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}_impl.cc.t ${ARGN}
+- )
+-
+- #create a command to generate the _impl.h files
+- add_custom_command(
+- OUTPUT ${expanded_files_h_impl}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}_impl.h.t ${ARGN}
+- )
+-
+- #make _impl.cc source files depend on headers to force generation
+- set_source_files_properties(${expanded_files_cc_impl}
+- PROPERTIES OBJECT_DEPENDS "${expanded_files_h_impl}"
+- )
+-
+- #make _impl.h source files depend on headers to force generation
+- set_source_files_properties(${expanded_files_h_impl}
+- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
+- )
+-
+- #install rules for the generated cc files
+- list(APPEND generated_sources ${expanded_files_cc_impl})
+-endmacro(expand_cc_h_impl)
+-
+-########################################################################
+ # Invoke macro to generate various sources
+ ########################################################################
+-expand_cc_h_impl(add_XX ss ii cc)
+-expand_cc_h_impl(add_const_XX bb ss ii ff cc)
+-expand_cc_h_impl(add_const_vXX bb ss ii ff cc)
+-expand_cc_h_impl(and_XX bb ss ii)
+-expand_cc_h_impl(and_const_XX bb ss ii)
+-expand_cc_h_impl(argmax_XX fs is ss)
+-expand_cc_h_impl(divide_XX ss ii ff cc)
+-expand_cc_h_impl(integrate_XX ss ii ff cc)
+-expand_cc_h_impl(max_XX ff ii ss)
+-expand_cc_h_impl(moving_average_XX ss ii ff cc)
+-expand_cc_h_impl(multiply_XX ss ii)
+-expand_cc_h_impl(multiply_const_XX ss ii)
+-expand_cc_h_impl(multiply_const_vXX ss ii ff cc)
+-expand_cc_h_impl(mute_XX ss ii ff cc)
+-expand_cc_h_impl(not_XX bb ss ii)
+-expand_cc_h_impl(or_XX bb ss ii)
+-expand_cc_h_impl(peak_detector_XX fb ib sb)
+-expand_cc_h_impl(probe_signal_X b s i f c)
+-expand_cc_h_impl(probe_signal_vX b s i f c)
+-expand_cc_h_impl(sample_and_hold_XX bb ss ii ff)
+-expand_cc_h_impl(sub_XX ss ii ff cc)
+-expand_cc_h_impl(xor_XX bb ss ii)
+-expand_cc_h_impl(packed_to_unpacked_XX bb ss ii)
+-expand_cc_h_impl(unpacked_to_packed_XX bb ss ii)
+-expand_cc_h_impl(vector_insert_X b s i f c)
+-expand_cc_h_impl(vector_sink_X b s i f c)
+-expand_cc_h_impl(vector_source_X b s i f c)
++include(GrMiscUtils)
++GR_EXPAND_X_CC_H_IMPL(blocks add_XX ss ii cc)
++GR_EXPAND_X_CC_H_IMPL(blocks add_const_XX bb ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks add_const_vXX bb ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks and_XX bb ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks and_const_XX bb ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks argmax_XX fs is ss)
++GR_EXPAND_X_CC_H_IMPL(blocks divide_XX ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks integrate_XX ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks max_XX ff ii ss)
++GR_EXPAND_X_CC_H_IMPL(blocks moving_average_XX ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks multiply_XX ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks multiply_const_XX ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks multiply_const_vXX ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks mute_XX ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks not_XX bb ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks or_XX bb ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks peak_detector_XX fb ib sb)
++GR_EXPAND_X_CC_H_IMPL(blocks probe_signal_X b s i f c)
++GR_EXPAND_X_CC_H_IMPL(blocks probe_signal_vX b s i f c)
++GR_EXPAND_X_CC_H_IMPL(blocks sample_and_hold_XX bb ss ii ff)
++GR_EXPAND_X_CC_H_IMPL(blocks sub_XX ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks xor_XX bb ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks packed_to_unpacked_XX bb ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks unpacked_to_packed_XX bb ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks vector_insert_X b s i f c)
++GR_EXPAND_X_CC_H_IMPL(blocks vector_sink_X b s i f c)
++GR_EXPAND_X_CC_H_IMPL(blocks vector_source_X b s i f c)
+
+ ########################################################################
+ # Setup the include and linker paths
+--- gr-digital/include/gnuradio/digital/CMakeLists.txt.orig
++++ gr-digital/include/gnuradio/digital/CMakeLists.txt
+@@ -17,54 +17,12 @@
+ # the Free Software Foundation, Inc., 51 Franklin Street,
+ # Boston, MA 02110-1301, USA.
+
++#################################################################
+ ########################################################################
+-# generate helper scripts to expand templated files
+-########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_dict2(name, sig, 'digital')
+- build_utils.expand_template(d, inp)
+-
+-")
+-
+-macro(expand_h root)
+- #make a list of all the generated files
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the files
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #install rules for the generated h files
+- list(APPEND generated_includes ${expanded_files_h})
+-endmacro(expand_h)
+-
+-########################################################################
+-# Invoke macro to generate various sources
++# Invoke macro to generate various headers
+ #######################################################################
+-expand_h(chunks_to_symbols_XX bf bc sf sc if ic)
++include(GrMiscUtils)
++GR_EXPAND_X_H(digital chunks_to_symbols_XX bf bc sf sc if ic)
+
+ add_custom_target(digital_generated_includes DEPENDS
+ ${generated_includes}
+--- gr-digital/lib/CMakeLists.txt.orig
++++ gr-digital/lib/CMakeLists.txt
+@@ -42,70 +42,10 @@ if(ENABLE_GR_CTRLPORT)
+ endif(ENABLE_GR_CTRLPORT)
+
+ ########################################################################
+-# generate helper scripts to expand templated files
++# Invoke macro to generate various sources and headers
+ ########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_impl_dict2(name, sig, 'digital')
+- build_utils.expand_template(d, inp)
+-")
+-
+-macro(expand_cc root)
+- #make a list of all the generated files
+- unset(expanded_files_cc)
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the source files
+- add_custom_command(
+- OUTPUT ${expanded_files_cc}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.cc.t ${ARGN}
+- )
+-
+- #create a command to generate the header file
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #make source files depends on headers to force generation
+- set_source_files_properties(${expanded_files_cc}
+- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
+- )
+-
+- #install rules for the generated cc files
+- list(APPEND generated_sources ${expanded_files_cc})
+- list(APPEND generated_headers ${expanded_files_h})
+-endmacro(expand_cc)
+-
+-
+-########################################################################
+-# Invoke macro to generate various sources
+-########################################################################
+-expand_cc(chunks_to_symbols_XX_impl bf bc sf sc if ic)
++include(GrMiscUtils)
++GR_EXPAND_X_CC_H(digital chunks_to_symbols_XX_impl bf bc sf sc if ic)
+
+ ########################################################################
+ # Setup library
+@@ -198,7 +138,6 @@ list(APPEND digital_libs
+ ${LOG4CPP_LIBRARIES}
+ )
+
+-
+ add_library(gnuradio-digital SHARED ${digital_sources})
+ target_link_libraries(gnuradio-digital ${digital_libs})
+ GR_LIBRARY_FOO(gnuradio-digital RUNTIME_COMPONENT "digital_runtime" DEVEL_COMPONENT "digital_devel")
+--- gr-fec/include/gnuradio/fec/CMakeLists.txt.orig
++++ gr-fec/include/gnuradio/fec/CMakeLists.txt
+@@ -18,63 +18,9 @@
+ # Boston, MA 02110-1301, USA.
+
+ ########################################################################
+-# generate helper scripts to expand templated files
+-########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_dict(name, sig, 'fec')
+- build_utils.expand_template(d, inp)
+-
+-")
+-
+-macro(expand_h root)
+- #make a list of all the generated files
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the files
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #install rules for the generated h files
+- list(APPEND generated_includes ${expanded_files_h})
+-endmacro(expand_h)
+-
+-########################################################################
+-# Invoke macro to generate various sources
+-########################################################################
+-#expand_h(foo_XX ss ii cc)
+-
+-add_custom_target(fec_generated_includes DEPENDS
+- ${generated_includes}
+-)
+-
+-########################################################################
+ # Install header files
+ ########################################################################
+ install(FILES
+- ${generated_includes}
+ api.h
+ decode_ccsds_27_fb.h
+ encode_ccsds_27_bb.h
+--- gr-filter/include/gnuradio/filter/CMakeLists.txt.orig
++++ gr-filter/include/gnuradio/filter/CMakeLists.txt
+@@ -18,56 +18,13 @@
+ # Boston, MA 02110-1301, USA.
+
+ ########################################################################
+-# generate helper scripts to expand templated files
+-########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_dict2(name, sig, 'filter')
+- build_utils.expand_template(d, inp)
+-
+-")
+-
+-macro(expand_h root)
+- #make a list of all the generated files
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the files
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #install rules for the generated h files
+- list(APPEND generated_includes ${expanded_files_h})
+-endmacro(expand_h)
+-
+-########################################################################
+-# Invoke macro to generate various sources
++# Invoke macro to generate various headers
+ #######################################################################
+-expand_h(fir_filter_XXX ccc ccf fcc fff fsf scc)
+-expand_h(freq_xlating_fir_filter_XXX ccc ccf fcc fcf scf scc)
+-expand_h(interp_fir_filter_XXX ccc ccf fcc fff fsf scc)
+-expand_h(rational_resampler_base_XXX ccc ccf fcc fff fsf scc)
++include(GrMiscUtils)
++GR_EXPAND_X_H(filter fir_filter_XXX ccc ccf fcc fff fsf scc)
++GR_EXPAND_X_H(filter freq_xlating_fir_filter_XXX ccc ccf fcc fcf scf scc)
++GR_EXPAND_X_H(filter interp_fir_filter_XXX ccc ccf fcc fff fsf scc)
++GR_EXPAND_X_H(filter rational_resampler_base_XXX ccc ccf fcc fff fsf scc)
+
+ add_custom_target(filter_generated_includes DEPENDS
+ ${generated_includes}
+--- gr-filter/lib/CMakeLists.txt.orig
++++ gr-filter/lib/CMakeLists.txt
+@@ -18,73 +18,13 @@
+ # Boston, MA 02110-1301, USA.
+
+ ########################################################################
+-# generate helper scripts to expand templated files
++# Invoke macro to generate various sources and headers
+ ########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_impl_dict2(name, sig, 'filter')
+- build_utils.expand_template(d, inp)
+-")
+-
+-macro(expand_cc root)
+- #make a list of all the generated files
+- unset(expanded_files_cc)
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the source files
+- add_custom_command(
+- OUTPUT ${expanded_files_cc}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.cc.t ${ARGN}
+- )
+-
+- #create a command to generate the header file
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #make source files depends on headers to force generation
+- set_source_files_properties(${expanded_files_cc}
+- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
+- )
+-
+- #install rules for the generated cc files
+- list(APPEND generated_sources ${expanded_files_cc})
+- list(APPEND generated_headers ${expanded_files_h})
+-endmacro(expand_cc)
+-
+-########################################################################
+-# Invoke macro to generate various sources
+-########################################################################
+-expand_cc(fir_filter_XXX_impl ccc ccf fcc fff fsf scc)
+-expand_cc(freq_xlating_fir_filter_XXX_impl ccc ccf fcc fcf scf scc)
+-expand_cc(interp_fir_filter_XXX_impl ccc ccf fcc fff fsf scc)
+-expand_cc(rational_resampler_base_XXX_impl ccc ccf fcc fff fsf scc)
+-
++include(GrMiscUtils)
++GR_EXPAND_X_CC_H(filter fir_filter_XXX_impl ccc ccf fcc fff fsf scc)
++GR_EXPAND_X_CC_H(filter freq_xlating_fir_filter_XXX_impl ccc ccf fcc fcf scf scc)
++GR_EXPAND_X_CC_H(filter interp_fir_filter_XXX_impl ccc ccf fcc fff fsf scc)
++GR_EXPAND_X_CC_H(filter rational_resampler_base_XXX_impl ccc ccf fcc fff fsf scc)
+
+ ########################################################################
+ # Setup the include and linker paths
+--- gr-trellis/include/gnuradio/trellis/CMakeLists.txt.orig
++++ gr-trellis/include/gnuradio/trellis/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-# Copyright 2012 Free Software Foundation, Inc.
++# Copyright 2012-2013 Free Software Foundation, Inc.
+ #
+ # This file is part of GNU Radio
+ #
+@@ -18,62 +18,19 @@
+ # Boston, MA 02110-1301, USA.
+
+ ########################################################################
+-# generate helper scripts to expand templated files
+-########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_dict2(name, sig, 'trellis')
+- build_utils.expand_template(d, inp)
+-
+-")
+-
+-macro(expand_h root)
+- #make a list of all the generated files
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the files
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #install rules for the generated h files
+- list(APPEND generated_includes ${expanded_files_h})
+-endmacro(expand_h)
+-
+-########################################################################
+-# Invoke macro to generate various sources
++# Invoke macro to generate various headers
+ #######################################################################
+-expand_h(encoder_XX bb bs bi ss si ii)
+-expand_h(sccc_encoder_XX bb bs bi ss si ii)
+-expand_h(pccc_encoder_XX bb bs bi ss si ii)
+-expand_h(metrics_X s i f c)
+-expand_h(viterbi_X b s i)
+-expand_h(viterbi_combined_XX sb ss si ib is ii fb fs fi cb cs ci)
+-expand_h(sccc_decoder_X b s i)
+-expand_h(sccc_decoder_combined_XX fb fs fi cb cs ci)
+-expand_h(pccc_decoder_X b s i)
+-expand_h(pccc_decoder_combined_XX fb fs fi cb cs ci)
++include(GrMiscUtils)
++GR_EXPAND_X_H(trellis encoder_XX bb bs bi ss si ii)
++GR_EXPAND_X_H(trellis sccc_encoder_XX bb bs bi ss si ii)
++GR_EXPAND_X_H(trellis pccc_encoder_XX bb bs bi ss si ii)
++GR_EXPAND_X_H(trellis metrics_X s i f c)
++GR_EXPAND_X_H(trellis viterbi_X b s i)
++GR_EXPAND_X_H(trellis viterbi_combined_XX sb ss si ib is ii fb fs fi cb cs ci)
++GR_EXPAND_X_H(trellis sccc_decoder_X b s i)
++GR_EXPAND_X_H(trellis sccc_decoder_combined_XX fb fs fi cb cs ci)
++GR_EXPAND_X_H(trellis pccc_decoder_X b s i)
++GR_EXPAND_X_H(trellis pccc_decoder_combined_XX fb fs fi cb cs ci)
+
+ add_custom_target(trellis_generated_includes DEPENDS
+ ${generated_includes}
+--- gr-trellis/lib/CMakeLists.txt.orig
++++ gr-trellis/lib/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-# Copyright 2012 Free Software Foundation, Inc.
++# Copyright 2012-2013 Free Software Foundation, Inc.
+ #
+ # This file is part of GNU Radio
+ #
+@@ -37,79 +37,20 @@ if(ENABLE_GR_CTRLPORT)
+ include_directories(${ICE_INCLUDE_DIR})
+ endif(ENABLE_GR_CTRLPORT)
+
+-#######################################################################
+-# generate the python helper script which calls into the build utils
+ ########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_impl_dict2(name, sig, 'trellis')
+- build_utils.expand_template(d, inp)
+-")
+-
+-macro(expand_cc root)
+- #make a list of all the generated files
+- unset(expanded_files_cc)
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the source files
+- add_custom_command(
+- OUTPUT ${expanded_files_cc}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.cc.t ${ARGN}
+- )
+-
+- #create a command to generate the header file
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #make source files depends on headers to force generation
+- set_source_files_properties(${expanded_files_cc}
+- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
+- )
+-
+- #install rules for the generated cc files
+- list(APPEND generated_sources ${expanded_files_cc})
+- list(APPEND generated_headers ${expanded_files_h})
+-endmacro(expand_cc)
+-
+-########################################################################
+-# Invoke macro to generate various sources
++# Invoke macro to generate various sources and headers
+ ########################################################################
+-expand_cc(encoder_XX_impl bb bs bi ss si ii)
+-expand_cc(sccc_encoder_XX_impl bb bs bi ss si ii)
+-expand_cc(pccc_encoder_XX_impl bb bs bi ss si ii)
+-expand_cc(metrics_X_impl s i f c)
+-expand_cc(viterbi_X_impl b s i)
+-expand_cc(viterbi_combined_XX_impl sb ss si ib is ii fb fs fi cb cs ci)
+-expand_cc(sccc_decoder_X_impl b s i)
+-expand_cc(sccc_decoder_combined_XX_impl fb fs fi cb cs ci)
+-expand_cc(pccc_decoder_X_impl b s i)
+-expand_cc(pccc_decoder_combined_XX_impl fb fs fi cb cs ci)
++include(GrMiscUtils)
++GR_EXPAND_X_CC_H(trellis encoder_XX_impl bb bs bi ss si ii)
++GR_EXPAND_X_CC_H(trellis sccc_encoder_XX_impl bb bs bi ss si ii)
++GR_EXPAND_X_CC_H(trellis pccc_encoder_XX_impl bb bs bi ss si ii)
++GR_EXPAND_X_CC_H(trellis metrics_X_impl s i f c)
++GR_EXPAND_X_CC_H(trellis viterbi_X_impl b s i)
++GR_EXPAND_X_CC_H(trellis viterbi_combined_XX_impl sb ss si ib is ii fb fs fi cb cs ci)
++GR_EXPAND_X_CC_H(trellis sccc_decoder_X_impl b s i)
++GR_EXPAND_X_CC_H(trellis sccc_decoder_combined_XX_impl fb fs fi cb cs ci)
++GR_EXPAND_X_CC_H(trellis pccc_decoder_X_impl b s i)
++GR_EXPAND_X_CC_H(trellis pccc_decoder_combined_XX_impl fb fs fi cb cs ci)
+
+ ########################################################################
+ # Setup library
</ins></span></pre></div>
<a id="trunkdportssciencegnuradiofilespatchcmakeexpanddiff"></a>
<div class="delfile"><h4>Deleted: trunk/dports/science/gnuradio/files/patch-cmake-expand.diff (117180 => 117181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/science/gnuradio/files/patch-cmake-expand.diff        2014-02-18 18:19:49 UTC (rev 117180)
+++ trunk/dports/science/gnuradio/files/patch-cmake-expand.diff        2014-02-18 18:21:51 UTC (rev 117181)
</span><span class="lines">@@ -1,1154 +0,0 @@
</span><del>---- cmake/Modules/GrMiscUtils.cmake.orig
-+++ cmake/Modules/GrMiscUtils.cmake
-@@ -333,7 +333,7 @@ set(CMAKE_REQUIRED_LIBRARIES -lpthread)
- } " HAVE_PTHREAD_SETSCHEDPARAM
- )
- GR_ADD_COND_DEF(HAVE_PTHREAD_SETSCHEDPARAM)
--
-+
- CHECK_CXX_SOURCE_COMPILES("
- #include <sched.h>
- int main(){
-@@ -345,3 +345,210 @@ set(CMAKE_REQUIRED_LIBRARIES -lpthread)
- GR_ADD_COND_DEF(HAVE_SCHED_SETSCHEDULER)
- endmacro(GR_CHECK_LINUX_SCHED_AVAIL)
-
-+########################################################################
-+# Macros to generate source and header files from template
-+########################################################################
-+macro(GR_EXPAND_X_H component root)
-+
-+ include(GrPython)
-+
-+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-+"#!${PYTHON_EXECUTABLE}
-+
-+import sys, os, re
-+sys.path.append('${GR_RUNTIME_PYTHONPATH}')
-+os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
-+os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
-+
-+if __name__ == '__main__':
-+ import build_utils
-+ root, inp = sys.argv[1:3]
-+ for sig in sys.argv[3:]:
-+ name = re.sub ('X+', sig, root)
-+ d = build_utils.standard_dict2(name, sig, '${component}')
-+ build_utils.expand_template(d, inp)
-+")
-+
-+ #make a list of all the generated headers
-+ unset(expanded_files_h)
-+ foreach(sig ${ARGN})
-+ string(REGEX REPLACE "X+" ${sig} name ${root})
-+ list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
-+ endforeach(sig)
-+ unset(name)
-+
-+ #try to force generate the headers
-+ execute_process(
-+ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-+ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-+ ${root} ${root}.h.t ${ARGN}
-+ )
-+
-+ #create a command to generate the headers
-+ add_custom_command(
-+ OUTPUT ${expanded_files_h}
-+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
-+ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-+ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-+ ${root} ${root}.h.t ${ARGN}
-+ )
-+
-+ #install rules for the generated headers
-+ list(APPEND generated_includes ${expanded_files_h})
-+
-+endmacro(GR_EXPAND_X_H)
-+
-+macro(GR_EXPAND_X_CC_H component root)
-+
-+ include(GrPython)
-+
-+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-+"#!${PYTHON_EXECUTABLE}
-+
-+import sys, os, re
-+sys.path.append('${GR_RUNTIME_PYTHONPATH}')
-+os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
-+os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
-+
-+if __name__ == '__main__':
-+ import build_utils
-+ root, inp = sys.argv[1:3]
-+ for sig in sys.argv[3:]:
-+ name = re.sub ('X+', sig, root)
-+ d = build_utils.standard_impl_dict2(name, sig, '${component}')
-+ build_utils.expand_template(d, inp)
-+")
-+
-+ #make a list of all the generated files
-+ unset(expanded_files_cc)
-+ unset(expanded_files_h)
-+ foreach(sig ${ARGN})
-+ string(REGEX REPLACE "X+" ${sig} name ${root})
-+ list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
-+ list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
-+ endforeach(sig)
-+ unset(name)
-+
-+ #try to force generate the source files
-+ execute_process(
-+ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-+ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-+ ${root} ${root}.cc.t ${ARGN}
-+ )
-+
-+ #create a command to generate the source files
-+ add_custom_command(
-+ OUTPUT ${expanded_files_cc}
-+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
-+ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-+ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-+ ${root} ${root}.cc.t ${ARGN}
-+ )
-+
-+ #try to force generate the header files
-+ execute_process(
-+ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-+ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-+ ${root} ${root}.h.t ${ARGN}
-+ )
-+
-+ #create a command to generate the header files
-+ add_custom_command(
-+ OUTPUT ${expanded_files_h}
-+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
-+ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-+ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-+ ${root} ${root}.h.t ${ARGN}
-+ )
-+
-+ #make source files depends on headers to force generation
-+ set_source_files_properties(${expanded_files_cc}
-+ PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
-+ )
-+
-+ #install rules for the generated files
-+ list(APPEND generated_sources ${expanded_files_cc})
-+ list(APPEND generated_headers ${expanded_files_h})
-+
-+endmacro(GR_EXPAND_X_CC_H)
-+
-+macro(GR_EXPAND_X_CC_H_IMPL component root)
-+
-+ include(GrPython)
-+
-+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-+"#!${PYTHON_EXECUTABLE}
-+
-+import sys, os, re
-+sys.path.append('${GR_RUNTIME_PYTHONPATH}')
-+os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
-+os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
-+
-+if __name__ == '__main__':
-+ import build_utils
-+ root, inp = sys.argv[1:3]
-+ for sig in sys.argv[3:]:
-+ name = re.sub ('X+', sig, root)
-+ d = build_utils.standard_dict(name, sig, '${component}')
-+ build_utils.expand_template(d, inp, '_impl')
-+")
-+
-+ #make a list of all the generated files
-+ unset(expanded_files_cc_impl)
-+ unset(expanded_files_h_impl)
-+ unset(expanded_files_h)
-+ foreach(sig ${ARGN})
-+ string(REGEX REPLACE "X+" ${sig} name ${root})
-+ list(APPEND expanded_files_cc_impl ${CMAKE_CURRENT_BINARY_DIR}/${name}_impl.cc)
-+ list(APPEND expanded_files_h_impl ${CMAKE_CURRENT_BINARY_DIR}/${name}_impl.h)
-+ list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/../include/gnuradio/${component}/${name}.h)
-+ endforeach(sig)
-+ unset(name)
-+
-+ #try to force generate the _impl.cc files
-+ execute_process(
-+ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-+ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-+ ${root} ${root}_impl.cc.t ${ARGN}
-+ )
-+
-+ #create a command to generate the _impl.cc files
-+ add_custom_command(
-+ OUTPUT ${expanded_files_cc_impl}
-+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.cc.t
-+ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-+ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-+ ${root} ${root}_impl.cc.t ${ARGN}
-+ )
-+
-+ #try to force generate the _impl.h files
-+ execute_process(
-+ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-+ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-+ ${root} ${root}_impl.h.t ${ARGN}
-+ )
-+
-+ #create a command to generate the _impl.h files
-+ add_custom_command(
-+ OUTPUT ${expanded_files_h_impl}
-+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.h.t
-+ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-+ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-+ ${root} ${root}_impl.h.t ${ARGN}
-+ )
-+
-+ #make _impl.cc source files depend on _impl.h to force generation
-+ set_source_files_properties(${expanded_files_cc_impl}
-+ PROPERTIES OBJECT_DEPENDS "${expanded_files_h_impl}"
-+ )
-+
-+ #make _impl.h source files depend on headers to force generation
-+ set_source_files_properties(${expanded_files_h_impl}
-+ PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
-+ )
-+
-+ #install rules for the generated files
-+ list(APPEND generated_sources ${expanded_files_cc_impl})
-+ list(APPEND generated_headers ${expanded_files_h_impl})
-+
-+endmacro(GR_EXPAND_X_CC_H_IMPL)
---- gr-analog/include/gnuradio/analog/CMakeLists.txt.orig
-+++ gr-analog/include/gnuradio/analog/CMakeLists.txt
-@@ -1,4 +1,4 @@
--# Copyright 2012 Free Software Foundation, Inc.
-+# Copyright 2012-2013 Free Software Foundation, Inc.
- #
- # This file is part of GNU Radio
- #
-@@ -18,55 +18,12 @@
- # Boston, MA 02110-1301, USA.
-
- ########################################################################
--# generate helper scripts to expand templated files
--########################################################################
--include(GrPython)
--
--file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
--#!${PYTHON_EXECUTABLE}
--
--import sys, os, re
--sys.path.append('${GR_RUNTIME_PYTHONPATH}')
--os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
--os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
--
--if __name__ == '__main__':
-- import build_utils
-- root, inp = sys.argv[1:3]
-- for sig in sys.argv[3:]:
-- name = re.sub ('X+', sig, root)
-- d = build_utils.standard_dict2(name, sig, 'analog')
-- build_utils.expand_template(d, inp)
--
--")
--
--macro(expand_h root)
-- #make a list of all the generated files
-- unset(expanded_files_h)
-- foreach(sig ${ARGN})
-- string(REGEX REPLACE "X+" ${sig} name ${root})
-- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
-- endforeach(sig)
--
-- #create a command to generate the files
-- add_custom_command(
-- OUTPUT ${expanded_files_h}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}.h.t ${ARGN}
-- )
--
-- #install rules for the generated h files
-- list(APPEND generated_includes ${expanded_files_h})
--endmacro(expand_h)
--
--########################################################################
--# Invoke macro to generate various sources
-+# Invoke macro to generate various headers
- #######################################################################
--expand_h(noise_source_X s i f c)
--expand_h(fastnoise_source_X s i f c)
--expand_h(sig_source_X s i f c)
-+include(GrMiscUtils)
-+GR_EXPAND_X_H(analog noise_source_X s i f c)
-+GR_EXPAND_X_H(analog fastnoise_source_X s i f c)
-+GR_EXPAND_X_H(analog sig_source_X s i f c)
-
- add_custom_target(analog_generated_includes DEPENDS
- ${generated_includes}
---- gr-analog/lib/CMakeLists.txt.orig
-+++ gr-analog/lib/CMakeLists.txt
-@@ -41,72 +41,12 @@ if(ENABLE_GR_CTRLPORT)
- endif(ENABLE_GR_CTRLPORT)
-
- ########################################################################
--# generate helper scripts to expand templated files
-+# Invoke macro to generate various sources and headers
- ########################################################################
--include(GrPython)
--
--file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
--#!${PYTHON_EXECUTABLE}
--
--import sys, os, re
--sys.path.append('${GR_RUNTIME_PYTHONPATH}')
--os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
--os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
--
--if __name__ == '__main__':
-- import build_utils
-- root, inp = sys.argv[1:3]
-- for sig in sys.argv[3:]:
-- name = re.sub ('X+', sig, root)
-- d = build_utils.standard_impl_dict2(name, sig, 'analog')
-- build_utils.expand_template(d, inp)
--")
--
--macro(expand_cc root)
-- #make a list of all the generated files
-- unset(expanded_files_cc)
-- unset(expanded_files_h)
-- foreach(sig ${ARGN})
-- string(REGEX REPLACE "X+" ${sig} name ${root})
-- list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
-- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
-- endforeach(sig)
--
-- #create a command to generate the source files
-- add_custom_command(
-- OUTPUT ${expanded_files_cc}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}.cc.t ${ARGN}
-- )
--
-- #create a command to generate the header file
-- add_custom_command(
-- OUTPUT ${expanded_files_h}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}.h.t ${ARGN}
-- )
--
-- #make source files depends on headers to force generation
-- set_source_files_properties(${expanded_files_cc}
-- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
-- )
--
-- #install rules for the generated cc files
-- list(APPEND generated_sources ${expanded_files_cc})
-- list(APPEND generated_headers ${expanded_files_h})
--endmacro(expand_cc)
--
--
--########################################################################
--# Invoke macro to generate various sources
--########################################################################
--expand_cc(noise_source_X_impl s i f c)
--expand_cc(fastnoise_source_X_impl s i f c)
--expand_cc(sig_source_X_impl s i f c)
-+include(GrMiscUtils)
-+GR_EXPAND_X_CC_H(analog noise_source_X_impl s i f c)
-+GR_EXPAND_X_CC_H(analog fastnoise_source_X_impl s i f c)
-+GR_EXPAND_X_CC_H(analog sig_source_X_impl s i f c)
-
- ########################################################################
- # Setup library
---- gr-blocks/include/gnuradio/blocks/CMakeLists.txt.orig
-+++ gr-blocks/include/gnuradio/blocks/CMakeLists.txt
-@@ -18,79 +18,36 @@
- # Boston, MA 02110-1301, USA.
-
- ########################################################################
--# generate helper scripts to expand templated files
-+# Invoke macro to generate various headers
- ########################################################################
--include(GrPython)
--
--file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
--#!${PYTHON_EXECUTABLE}
--
--import sys, os, re
--sys.path.append('${GR_RUNTIME_PYTHONPATH}')
--os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
--os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
--
--if __name__ == '__main__':
-- import build_utils
-- root, inp = sys.argv[1:3]
-- for sig in sys.argv[3:]:
-- name = re.sub ('X+', sig, root)
-- d = build_utils.standard_dict(name, sig, 'blocks')
-- build_utils.expand_template(d, inp)
--
--")
--
--macro(expand_h root)
-- #make a list of all the generated files
-- unset(expanded_files_h)
-- foreach(sig ${ARGN})
-- string(REGEX REPLACE "X+" ${sig} name ${root})
-- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
-- endforeach(sig)
--
-- #create a command to generate the files
-- add_custom_command(
-- OUTPUT ${expanded_files_h}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}.h.t ${ARGN}
-- )
--
-- #install rules for the generated h files
-- list(APPEND generated_includes ${expanded_files_h})
--endmacro(expand_h)
--
--########################################################################
--# Invoke macro to generate various sources
--########################################################################
--expand_h(add_XX ss ii cc)
--expand_h(add_const_XX bb ss ii ff cc)
--expand_h(add_const_vXX bb ss ii ff cc)
--expand_h(and_XX bb ss ii)
--expand_h(and_const_XX bb ss ii)
--expand_h(argmax_XX fs is ss)
--expand_h(divide_XX ss ii ff cc)
--expand_h(integrate_XX ss ii ff cc)
--expand_h(max_XX ff ii ss)
--expand_h(moving_average_XX ss ii ff cc)
--expand_h(multiply_XX ss ii)
--expand_h(multiply_const_XX ss ii)
--expand_h(multiply_const_vXX ss ii ff cc)
--expand_h(mute_XX ss ii ff cc)
--expand_h(not_XX bb ss ii)
--expand_h(or_XX bb ss ii)
--expand_h(peak_detector_XX fb ib sb)
--expand_h(probe_signal_X b s i f c)
--expand_h(probe_signal_vX b s i f c)
--expand_h(sample_and_hold_XX bb ss ii ff)
--expand_h(sub_XX ss ii ff cc)
--expand_h(xor_XX bb ss ii)
--expand_h(packed_to_unpacked_XX bb ss ii)
--expand_h(unpacked_to_packed_XX bb ss ii)
--expand_h(vector_insert_X b s i f c)
--expand_h(vector_sink_X b s i f c)
--expand_h(vector_source_X b s i f c)
-+include(GrMiscUtils)
-+GR_EXPAND_X_H(blocks add_XX ss ii cc)
-+GR_EXPAND_X_H(blocks add_const_XX bb ss ii ff cc)
-+GR_EXPAND_X_H(blocks add_const_vXX bb ss ii ff cc)
-+GR_EXPAND_X_H(blocks and_XX bb ss ii)
-+GR_EXPAND_X_H(blocks and_const_XX bb ss ii)
-+GR_EXPAND_X_H(blocks argmax_XX fs is ss)
-+GR_EXPAND_X_H(blocks divide_XX ss ii ff cc)
-+GR_EXPAND_X_H(blocks integrate_XX ss ii ff cc)
-+GR_EXPAND_X_H(blocks max_XX ff ii ss)
-+GR_EXPAND_X_H(blocks moving_average_XX ss ii ff cc)
-+GR_EXPAND_X_H(blocks multiply_XX ss ii)
-+GR_EXPAND_X_H(blocks multiply_const_XX ss ii)
-+GR_EXPAND_X_H(blocks multiply_const_vXX ss ii ff cc)
-+GR_EXPAND_X_H(blocks mute_XX ss ii ff cc)
-+GR_EXPAND_X_H(blocks not_XX bb ss ii)
-+GR_EXPAND_X_H(blocks or_XX bb ss ii)
-+GR_EXPAND_X_H(blocks peak_detector_XX fb ib sb)
-+GR_EXPAND_X_H(blocks probe_signal_X b s i f c)
-+GR_EXPAND_X_H(blocks probe_signal_vX b s i f c)
-+GR_EXPAND_X_H(blocks sample_and_hold_XX bb ss ii ff)
-+GR_EXPAND_X_H(blocks sub_XX ss ii ff cc)
-+GR_EXPAND_X_H(blocks xor_XX bb ss ii)
-+GR_EXPAND_X_H(blocks packed_to_unpacked_XX bb ss ii)
-+GR_EXPAND_X_H(blocks unpacked_to_packed_XX bb ss ii)
-+GR_EXPAND_X_H(blocks vector_insert_X b s i f c)
-+GR_EXPAND_X_H(blocks vector_sink_X b s i f c)
-+GR_EXPAND_X_H(blocks vector_source_X b s i f c)
-
- add_custom_target(blocks_generated_includes DEPENDS
- ${generated_includes}
---- gr-blocks/lib/CMakeLists.txt.orig
-+++ gr-blocks/lib/CMakeLists.txt
-@@ -23,100 +23,36 @@
- include(${CMAKE_CURRENT_SOURCE_DIR}/ConfigChecks.cmake)
-
- ########################################################################
--# generate helper scripts to expand templated files
--########################################################################
--include(GrPython)
--
--file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
--#!${PYTHON_EXECUTABLE}
--
--import sys, os, re
--sys.path.append('${GR_RUNTIME_PYTHONPATH}')
--os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
--os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
--
--if __name__ == '__main__':
-- import build_utils
-- root, inp = sys.argv[1:3]
-- for sig in sys.argv[3:]:
-- name = re.sub ('X+', sig, root)
-- d = build_utils.standard_dict(name, sig, 'blocks')
-- build_utils.expand_template(d, inp, '_impl')
--")
--
--macro(expand_cc_h_impl root)
-- #make a list of all the generated files
-- unset(expanded_files_cc_impl)
-- unset(expanded_files_h_impl)
-- foreach(sig ${ARGN})
-- string(REGEX REPLACE "X+" ${sig} name ${root})
-- list(APPEND expanded_files_cc_impl ${CMAKE_CURRENT_BINARY_DIR}/${name}_impl.cc)
-- list(APPEND expanded_files_h_impl ${CMAKE_CURRENT_BINARY_DIR}/${name}_impl.h)
-- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/../include/${name}.h)
-- endforeach(sig)
--
-- #create a command to generate the _impl.cc files
-- add_custom_command(
-- OUTPUT ${expanded_files_cc_impl}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.cc.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}_impl.cc.t ${ARGN}
-- )
--
-- #create a command to generate the _impl.h files
-- add_custom_command(
-- OUTPUT ${expanded_files_h_impl}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.h.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}_impl.h.t ${ARGN}
-- )
--
-- #make _impl.cc source files depend on headers to force generation
-- set_source_files_properties(${expanded_files_cc_impl}
-- PROPERTIES OBJECT_DEPENDS "${expanded_files_h_impl}"
-- )
--
-- #make _impl.h source files depend on headers to force generation
-- set_source_files_properties(${expanded_files_h_impl}
-- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
-- )
--
-- #install rules for the generated cc files
-- list(APPEND generated_sources ${expanded_files_cc_impl})
--endmacro(expand_cc_h_impl)
--
--########################################################################
- # Invoke macro to generate various sources
- ########################################################################
--expand_cc_h_impl(add_XX ss ii cc)
--expand_cc_h_impl(add_const_XX bb ss ii ff cc)
--expand_cc_h_impl(add_const_vXX bb ss ii ff cc)
--expand_cc_h_impl(and_XX bb ss ii)
--expand_cc_h_impl(and_const_XX bb ss ii)
--expand_cc_h_impl(argmax_XX fs is ss)
--expand_cc_h_impl(divide_XX ss ii ff cc)
--expand_cc_h_impl(integrate_XX ss ii ff cc)
--expand_cc_h_impl(max_XX ff ii ss)
--expand_cc_h_impl(moving_average_XX ss ii ff cc)
--expand_cc_h_impl(multiply_XX ss ii)
--expand_cc_h_impl(multiply_const_XX ss ii)
--expand_cc_h_impl(multiply_const_vXX ss ii ff cc)
--expand_cc_h_impl(mute_XX ss ii ff cc)
--expand_cc_h_impl(not_XX bb ss ii)
--expand_cc_h_impl(or_XX bb ss ii)
--expand_cc_h_impl(peak_detector_XX fb ib sb)
--expand_cc_h_impl(probe_signal_X b s i f c)
--expand_cc_h_impl(probe_signal_vX b s i f c)
--expand_cc_h_impl(sample_and_hold_XX bb ss ii ff)
--expand_cc_h_impl(sub_XX ss ii ff cc)
--expand_cc_h_impl(xor_XX bb ss ii)
--expand_cc_h_impl(packed_to_unpacked_XX bb ss ii)
--expand_cc_h_impl(unpacked_to_packed_XX bb ss ii)
--expand_cc_h_impl(vector_insert_X b s i f c)
--expand_cc_h_impl(vector_sink_X b s i f c)
--expand_cc_h_impl(vector_source_X b s i f c)
-+include(GrMiscUtils)
-+GR_EXPAND_X_CC_H_IMPL(blocks add_XX ss ii cc)
-+GR_EXPAND_X_CC_H_IMPL(blocks add_const_XX bb ss ii ff cc)
-+GR_EXPAND_X_CC_H_IMPL(blocks add_const_vXX bb ss ii ff cc)
-+GR_EXPAND_X_CC_H_IMPL(blocks and_XX bb ss ii)
-+GR_EXPAND_X_CC_H_IMPL(blocks and_const_XX bb ss ii)
-+GR_EXPAND_X_CC_H_IMPL(blocks argmax_XX fs is ss)
-+GR_EXPAND_X_CC_H_IMPL(blocks divide_XX ss ii ff cc)
-+GR_EXPAND_X_CC_H_IMPL(blocks integrate_XX ss ii ff cc)
-+GR_EXPAND_X_CC_H_IMPL(blocks max_XX ff ii ss)
-+GR_EXPAND_X_CC_H_IMPL(blocks moving_average_XX ss ii ff cc)
-+GR_EXPAND_X_CC_H_IMPL(blocks multiply_XX ss ii)
-+GR_EXPAND_X_CC_H_IMPL(blocks multiply_const_XX ss ii)
-+GR_EXPAND_X_CC_H_IMPL(blocks multiply_const_vXX ss ii ff cc)
-+GR_EXPAND_X_CC_H_IMPL(blocks mute_XX ss ii ff cc)
-+GR_EXPAND_X_CC_H_IMPL(blocks not_XX bb ss ii)
-+GR_EXPAND_X_CC_H_IMPL(blocks or_XX bb ss ii)
-+GR_EXPAND_X_CC_H_IMPL(blocks peak_detector_XX fb ib sb)
-+GR_EXPAND_X_CC_H_IMPL(blocks probe_signal_X b s i f c)
-+GR_EXPAND_X_CC_H_IMPL(blocks probe_signal_vX b s i f c)
-+GR_EXPAND_X_CC_H_IMPL(blocks sample_and_hold_XX bb ss ii ff)
-+GR_EXPAND_X_CC_H_IMPL(blocks sub_XX ss ii ff cc)
-+GR_EXPAND_X_CC_H_IMPL(blocks xor_XX bb ss ii)
-+GR_EXPAND_X_CC_H_IMPL(blocks packed_to_unpacked_XX bb ss ii)
-+GR_EXPAND_X_CC_H_IMPL(blocks unpacked_to_packed_XX bb ss ii)
-+GR_EXPAND_X_CC_H_IMPL(blocks vector_insert_X b s i f c)
-+GR_EXPAND_X_CC_H_IMPL(blocks vector_sink_X b s i f c)
-+GR_EXPAND_X_CC_H_IMPL(blocks vector_source_X b s i f c)
-
- ########################################################################
- # Setup the include and linker paths
---- gr-digital/include/gnuradio/digital/CMakeLists.txt.orig
-+++ gr-digital/include/gnuradio/digital/CMakeLists.txt
-@@ -17,54 +17,12 @@
- # the Free Software Foundation, Inc., 51 Franklin Street,
- # Boston, MA 02110-1301, USA.
-
-+#################################################################
- ########################################################################
--# generate helper scripts to expand templated files
--########################################################################
--include(GrPython)
--
--file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
--#!${PYTHON_EXECUTABLE}
--
--import sys, os, re
--sys.path.append('${GR_RUNTIME_PYTHONPATH}')
--os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
--os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
--
--if __name__ == '__main__':
-- import build_utils
-- root, inp = sys.argv[1:3]
-- for sig in sys.argv[3:]:
-- name = re.sub ('X+', sig, root)
-- d = build_utils.standard_dict2(name, sig, 'digital')
-- build_utils.expand_template(d, inp)
--
--")
--
--macro(expand_h root)
-- #make a list of all the generated files
-- unset(expanded_files_h)
-- foreach(sig ${ARGN})
-- string(REGEX REPLACE "X+" ${sig} name ${root})
-- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
-- endforeach(sig)
--
-- #create a command to generate the files
-- add_custom_command(
-- OUTPUT ${expanded_files_h}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}.h.t ${ARGN}
-- )
--
-- #install rules for the generated h files
-- list(APPEND generated_includes ${expanded_files_h})
--endmacro(expand_h)
--
--########################################################################
--# Invoke macro to generate various sources
-+# Invoke macro to generate various headers
- #######################################################################
--expand_h(chunks_to_symbols_XX bf bc sf sc if ic)
-+include(GrMiscUtils)
-+GR_EXPAND_X_H(digital chunks_to_symbols_XX bf bc sf sc if ic)
-
- add_custom_target(digital_generated_includes DEPENDS
- ${generated_includes}
---- gr-digital/lib/CMakeLists.txt.orig
-+++ gr-digital/lib/CMakeLists.txt
-@@ -42,70 +42,10 @@ if(ENABLE_GR_CTRLPORT)
- endif(ENABLE_GR_CTRLPORT)
-
- ########################################################################
--# generate helper scripts to expand templated files
-+# Invoke macro to generate various sources and headers
- ########################################################################
--include(GrPython)
--
--file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
--#!${PYTHON_EXECUTABLE}
--
--import sys, os, re
--sys.path.append('${GR_RUNTIME_PYTHONPATH}')
--os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
--os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
--
--if __name__ == '__main__':
-- import build_utils
-- root, inp = sys.argv[1:3]
-- for sig in sys.argv[3:]:
-- name = re.sub ('X+', sig, root)
-- d = build_utils.standard_impl_dict2(name, sig, 'digital')
-- build_utils.expand_template(d, inp)
--")
--
--macro(expand_cc root)
-- #make a list of all the generated files
-- unset(expanded_files_cc)
-- unset(expanded_files_h)
-- foreach(sig ${ARGN})
-- string(REGEX REPLACE "X+" ${sig} name ${root})
-- list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
-- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
-- endforeach(sig)
--
-- #create a command to generate the source files
-- add_custom_command(
-- OUTPUT ${expanded_files_cc}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}.cc.t ${ARGN}
-- )
--
-- #create a command to generate the header file
-- add_custom_command(
-- OUTPUT ${expanded_files_h}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}.h.t ${ARGN}
-- )
--
-- #make source files depends on headers to force generation
-- set_source_files_properties(${expanded_files_cc}
-- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
-- )
--
-- #install rules for the generated cc files
-- list(APPEND generated_sources ${expanded_files_cc})
-- list(APPEND generated_headers ${expanded_files_h})
--endmacro(expand_cc)
--
--
--########################################################################
--# Invoke macro to generate various sources
--########################################################################
--expand_cc(chunks_to_symbols_XX_impl bf bc sf sc if ic)
-+include(GrMiscUtils)
-+GR_EXPAND_X_CC_H(digital chunks_to_symbols_XX_impl bf bc sf sc if ic)
-
- ########################################################################
- # Setup library
-@@ -198,7 +138,6 @@ list(APPEND digital_libs
- ${LOG4CPP_LIBRARIES}
- )
-
--
- add_library(gnuradio-digital SHARED ${digital_sources})
- target_link_libraries(gnuradio-digital ${digital_libs})
- GR_LIBRARY_FOO(gnuradio-digital RUNTIME_COMPONENT "digital_runtime" DEVEL_COMPONENT "digital_devel")
---- gr-fec/include/gnuradio/fec/CMakeLists.txt.orig
-+++ gr-fec/include/gnuradio/fec/CMakeLists.txt
-@@ -18,63 +18,9 @@
- # Boston, MA 02110-1301, USA.
-
- ########################################################################
--# generate helper scripts to expand templated files
--########################################################################
--include(GrPython)
--
--file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
--#!${PYTHON_EXECUTABLE}
--
--import sys, os, re
--sys.path.append('${GR_RUNTIME_PYTHONPATH}')
--os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
--os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
--
--if __name__ == '__main__':
-- import build_utils
-- root, inp = sys.argv[1:3]
-- for sig in sys.argv[3:]:
-- name = re.sub ('X+', sig, root)
-- d = build_utils.standard_dict(name, sig, 'fec')
-- build_utils.expand_template(d, inp)
--
--")
--
--macro(expand_h root)
-- #make a list of all the generated files
-- unset(expanded_files_h)
-- foreach(sig ${ARGN})
-- string(REGEX REPLACE "X+" ${sig} name ${root})
-- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
-- endforeach(sig)
--
-- #create a command to generate the files
-- add_custom_command(
-- OUTPUT ${expanded_files_h}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}.h.t ${ARGN}
-- )
--
-- #install rules for the generated h files
-- list(APPEND generated_includes ${expanded_files_h})
--endmacro(expand_h)
--
--########################################################################
--# Invoke macro to generate various sources
--########################################################################
--#expand_h(foo_XX ss ii cc)
--
--add_custom_target(fec_generated_includes DEPENDS
-- ${generated_includes}
--)
--
--########################################################################
- # Install header files
- ########################################################################
- install(FILES
-- ${generated_includes}
- api.h
- decode_ccsds_27_fb.h
- encode_ccsds_27_bb.h
---- gr-filter/include/gnuradio/filter/CMakeLists.txt.orig
-+++ gr-filter/include/gnuradio/filter/CMakeLists.txt
-@@ -18,56 +18,13 @@
- # Boston, MA 02110-1301, USA.
-
- ########################################################################
--# generate helper scripts to expand templated files
--########################################################################
--include(GrPython)
--
--file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
--#!${PYTHON_EXECUTABLE}
--
--import sys, os, re
--sys.path.append('${GR_RUNTIME_PYTHONPATH}')
--os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
--os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
--
--if __name__ == '__main__':
-- import build_utils
-- root, inp = sys.argv[1:3]
-- for sig in sys.argv[3:]:
-- name = re.sub ('X+', sig, root)
-- d = build_utils.standard_dict2(name, sig, 'filter')
-- build_utils.expand_template(d, inp)
--
--")
--
--macro(expand_h root)
-- #make a list of all the generated files
-- unset(expanded_files_h)
-- foreach(sig ${ARGN})
-- string(REGEX REPLACE "X+" ${sig} name ${root})
-- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
-- endforeach(sig)
--
-- #create a command to generate the files
-- add_custom_command(
-- OUTPUT ${expanded_files_h}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}.h.t ${ARGN}
-- )
--
-- #install rules for the generated h files
-- list(APPEND generated_includes ${expanded_files_h})
--endmacro(expand_h)
--
--########################################################################
--# Invoke macro to generate various sources
-+# Invoke macro to generate various headers
- #######################################################################
--expand_h(fir_filter_XXX ccc ccf fcc fff fsf scc)
--expand_h(freq_xlating_fir_filter_XXX ccc ccf fcc fcf scf scc)
--expand_h(interp_fir_filter_XXX ccc ccf fcc fff fsf scc)
--expand_h(rational_resampler_base_XXX ccc ccf fcc fff fsf scc)
-+include(GrMiscUtils)
-+GR_EXPAND_X_H(filter fir_filter_XXX ccc ccf fcc fff fsf scc)
-+GR_EXPAND_X_H(filter freq_xlating_fir_filter_XXX ccc ccf fcc fcf scf scc)
-+GR_EXPAND_X_H(filter interp_fir_filter_XXX ccc ccf fcc fff fsf scc)
-+GR_EXPAND_X_H(filter rational_resampler_base_XXX ccc ccf fcc fff fsf scc)
-
- add_custom_target(filter_generated_includes DEPENDS
- ${generated_includes}
---- gr-filter/lib/CMakeLists.txt.orig
-+++ gr-filter/lib/CMakeLists.txt
-@@ -18,73 +18,13 @@
- # Boston, MA 02110-1301, USA.
-
- ########################################################################
--# generate helper scripts to expand templated files
-+# Invoke macro to generate various sources and headers
- ########################################################################
--include(GrPython)
--
--file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
--#!${PYTHON_EXECUTABLE}
--
--import sys, os, re
--sys.path.append('${GR_RUNTIME_PYTHONPATH}')
--os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
--os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
--
--if __name__ == '__main__':
-- import build_utils
-- root, inp = sys.argv[1:3]
-- for sig in sys.argv[3:]:
-- name = re.sub ('X+', sig, root)
-- d = build_utils.standard_impl_dict2(name, sig, 'filter')
-- build_utils.expand_template(d, inp)
--")
--
--macro(expand_cc root)
-- #make a list of all the generated files
-- unset(expanded_files_cc)
-- unset(expanded_files_h)
-- foreach(sig ${ARGN})
-- string(REGEX REPLACE "X+" ${sig} name ${root})
-- list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
-- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
-- endforeach(sig)
--
-- #create a command to generate the source files
-- add_custom_command(
-- OUTPUT ${expanded_files_cc}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}.cc.t ${ARGN}
-- )
--
-- #create a command to generate the header file
-- add_custom_command(
-- OUTPUT ${expanded_files_h}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}.h.t ${ARGN}
-- )
--
-- #make source files depends on headers to force generation
-- set_source_files_properties(${expanded_files_cc}
-- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
-- )
--
-- #install rules for the generated cc files
-- list(APPEND generated_sources ${expanded_files_cc})
-- list(APPEND generated_headers ${expanded_files_h})
--endmacro(expand_cc)
--
--########################################################################
--# Invoke macro to generate various sources
--########################################################################
--expand_cc(fir_filter_XXX_impl ccc ccf fcc fff fsf scc)
--expand_cc(freq_xlating_fir_filter_XXX_impl ccc ccf fcc fcf scf scc)
--expand_cc(interp_fir_filter_XXX_impl ccc ccf fcc fff fsf scc)
--expand_cc(rational_resampler_base_XXX_impl ccc ccf fcc fff fsf scc)
--
-+include(GrMiscUtils)
-+GR_EXPAND_X_CC_H(filter fir_filter_XXX_impl ccc ccf fcc fff fsf scc)
-+GR_EXPAND_X_CC_H(filter freq_xlating_fir_filter_XXX_impl ccc ccf fcc fcf scf scc)
-+GR_EXPAND_X_CC_H(filter interp_fir_filter_XXX_impl ccc ccf fcc fff fsf scc)
-+GR_EXPAND_X_CC_H(filter rational_resampler_base_XXX_impl ccc ccf fcc fff fsf scc)
-
- ########################################################################
- # Setup the include and linker paths
---- gr-trellis/include/gnuradio/trellis/CMakeLists.txt.orig
-+++ gr-trellis/include/gnuradio/trellis/CMakeLists.txt
-@@ -1,4 +1,4 @@
--# Copyright 2012 Free Software Foundation, Inc.
-+# Copyright 2012-2013 Free Software Foundation, Inc.
- #
- # This file is part of GNU Radio
- #
-@@ -18,62 +18,19 @@
- # Boston, MA 02110-1301, USA.
-
- ########################################################################
--# generate helper scripts to expand templated files
--########################################################################
--include(GrPython)
--
--file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
--#!${PYTHON_EXECUTABLE}
--
--import sys, os, re
--sys.path.append('${GR_RUNTIME_PYTHONPATH}')
--os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
--os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
--
--if __name__ == '__main__':
-- import build_utils
-- root, inp = sys.argv[1:3]
-- for sig in sys.argv[3:]:
-- name = re.sub ('X+', sig, root)
-- d = build_utils.standard_dict2(name, sig, 'trellis')
-- build_utils.expand_template(d, inp)
--
--")
--
--macro(expand_h root)
-- #make a list of all the generated files
-- unset(expanded_files_h)
-- foreach(sig ${ARGN})
-- string(REGEX REPLACE "X+" ${sig} name ${root})
-- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
-- endforeach(sig)
--
-- #create a command to generate the files
-- add_custom_command(
-- OUTPUT ${expanded_files_h}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}.h.t ${ARGN}
-- )
--
-- #install rules for the generated h files
-- list(APPEND generated_includes ${expanded_files_h})
--endmacro(expand_h)
--
--########################################################################
--# Invoke macro to generate various sources
-+# Invoke macro to generate various headers
- #######################################################################
--expand_h(encoder_XX bb bs bi ss si ii)
--expand_h(sccc_encoder_XX bb bs bi ss si ii)
--expand_h(pccc_encoder_XX bb bs bi ss si ii)
--expand_h(metrics_X s i f c)
--expand_h(viterbi_X b s i)
--expand_h(viterbi_combined_XX sb ss si ib is ii fb fs fi cb cs ci)
--expand_h(sccc_decoder_X b s i)
--expand_h(sccc_decoder_combined_XX fb fs fi cb cs ci)
--expand_h(pccc_decoder_X b s i)
--expand_h(pccc_decoder_combined_XX fb fs fi cb cs ci)
-+include(GrMiscUtils)
-+GR_EXPAND_X_H(trellis encoder_XX bb bs bi ss si ii)
-+GR_EXPAND_X_H(trellis sccc_encoder_XX bb bs bi ss si ii)
-+GR_EXPAND_X_H(trellis pccc_encoder_XX bb bs bi ss si ii)
-+GR_EXPAND_X_H(trellis metrics_X s i f c)
-+GR_EXPAND_X_H(trellis viterbi_X b s i)
-+GR_EXPAND_X_H(trellis viterbi_combined_XX sb ss si ib is ii fb fs fi cb cs ci)
-+GR_EXPAND_X_H(trellis sccc_decoder_X b s i)
-+GR_EXPAND_X_H(trellis sccc_decoder_combined_XX fb fs fi cb cs ci)
-+GR_EXPAND_X_H(trellis pccc_decoder_X b s i)
-+GR_EXPAND_X_H(trellis pccc_decoder_combined_XX fb fs fi cb cs ci)
-
- add_custom_target(trellis_generated_includes DEPENDS
- ${generated_includes}
---- gr-trellis/lib/CMakeLists.txt.orig
-+++ gr-trellis/lib/CMakeLists.txt
-@@ -1,4 +1,4 @@
--# Copyright 2012 Free Software Foundation, Inc.
-+# Copyright 2012-2013 Free Software Foundation, Inc.
- #
- # This file is part of GNU Radio
- #
-@@ -37,79 +37,20 @@ if(ENABLE_GR_CTRLPORT)
- include_directories(${ICE_INCLUDE_DIR})
- endif(ENABLE_GR_CTRLPORT)
-
--#######################################################################
--# generate the python helper script which calls into the build utils
- ########################################################################
--include(GrPython)
--
--file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
--#!${PYTHON_EXECUTABLE}
--
--import sys, os, re
--sys.path.append('${GR_RUNTIME_PYTHONPATH}')
--os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
--os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
--
--if __name__ == '__main__':
-- import build_utils
-- root, inp = sys.argv[1:3]
-- for sig in sys.argv[3:]:
-- name = re.sub ('X+', sig, root)
-- d = build_utils.standard_impl_dict2(name, sig, 'trellis')
-- build_utils.expand_template(d, inp)
--")
--
--macro(expand_cc root)
-- #make a list of all the generated files
-- unset(expanded_files_cc)
-- unset(expanded_files_h)
-- foreach(sig ${ARGN})
-- string(REGEX REPLACE "X+" ${sig} name ${root})
-- list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
-- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
-- endforeach(sig)
--
-- #create a command to generate the source files
-- add_custom_command(
-- OUTPUT ${expanded_files_cc}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}.cc.t ${ARGN}
-- )
--
-- #create a command to generate the header file
-- add_custom_command(
-- OUTPUT ${expanded_files_h}
-- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
-- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
-- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
-- ${root} ${root}.h.t ${ARGN}
-- )
--
-- #make source files depends on headers to force generation
-- set_source_files_properties(${expanded_files_cc}
-- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
-- )
--
-- #install rules for the generated cc files
-- list(APPEND generated_sources ${expanded_files_cc})
-- list(APPEND generated_headers ${expanded_files_h})
--endmacro(expand_cc)
--
--########################################################################
--# Invoke macro to generate various sources
-+# Invoke macro to generate various sources and headers
- ########################################################################
--expand_cc(encoder_XX_impl bb bs bi ss si ii)
--expand_cc(sccc_encoder_XX_impl bb bs bi ss si ii)
--expand_cc(pccc_encoder_XX_impl bb bs bi ss si ii)
--expand_cc(metrics_X_impl s i f c)
--expand_cc(viterbi_X_impl b s i)
--expand_cc(viterbi_combined_XX_impl sb ss si ib is ii fb fs fi cb cs ci)
--expand_cc(sccc_decoder_X_impl b s i)
--expand_cc(sccc_decoder_combined_XX_impl fb fs fi cb cs ci)
--expand_cc(pccc_decoder_X_impl b s i)
--expand_cc(pccc_decoder_combined_XX_impl fb fs fi cb cs ci)
-+include(GrMiscUtils)
-+GR_EXPAND_X_CC_H(trellis encoder_XX_impl bb bs bi ss si ii)
-+GR_EXPAND_X_CC_H(trellis sccc_encoder_XX_impl bb bs bi ss si ii)
-+GR_EXPAND_X_CC_H(trellis pccc_encoder_XX_impl bb bs bi ss si ii)
-+GR_EXPAND_X_CC_H(trellis metrics_X_impl s i f c)
-+GR_EXPAND_X_CC_H(trellis viterbi_X_impl b s i)
-+GR_EXPAND_X_CC_H(trellis viterbi_combined_XX_impl sb ss si ib is ii fb fs fi cb cs ci)
-+GR_EXPAND_X_CC_H(trellis sccc_decoder_X_impl b s i)
-+GR_EXPAND_X_CC_H(trellis sccc_decoder_combined_XX_impl fb fs fi cb cs ci)
-+GR_EXPAND_X_CC_H(trellis pccc_decoder_X_impl b s i)
-+GR_EXPAND_X_CC_H(trellis pccc_decoder_combined_XX_impl fb fs fi cb cs ci)
-
- ########################################################################
- # Setup library
</del></span></pre></div>
<a id="trunkdportssciencegnuradiofilespatchcmakeexpandreleasediff"></a>
<div class="addfile"><h4>Added: trunk/dports/science/gnuradio/files/patch-cmake-expand.release.diff (0 => 117181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/science/gnuradio/files/patch-cmake-expand.release.diff         (rev 0)
+++ trunk/dports/science/gnuradio/files/patch-cmake-expand.release.diff        2014-02-18 18:21:51 UTC (rev 117181)
</span><span class="lines">@@ -0,0 +1,1154 @@
</span><ins>+--- cmake/Modules/GrMiscUtils.cmake.orig
++++ cmake/Modules/GrMiscUtils.cmake
+@@ -333,7 +333,7 @@ set(CMAKE_REQUIRED_LIBRARIES -lpthread)
+ } " HAVE_PTHREAD_SETSCHEDPARAM
+ )
+ GR_ADD_COND_DEF(HAVE_PTHREAD_SETSCHEDPARAM)
+-
++
+ CHECK_CXX_SOURCE_COMPILES("
+ #include <sched.h>
+ int main(){
+@@ -345,3 +345,210 @@ set(CMAKE_REQUIRED_LIBRARIES -lpthread)
+ GR_ADD_COND_DEF(HAVE_SCHED_SETSCHEDULER)
+ endmacro(GR_CHECK_LINUX_SCHED_AVAIL)
+
++########################################################################
++# Macros to generate source and header files from template
++########################################################################
++macro(GR_EXPAND_X_H component root)
++
++ include(GrPython)
++
++ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++"#!${PYTHON_EXECUTABLE}
++
++import sys, os, re
++sys.path.append('${GR_RUNTIME_PYTHONPATH}')
++os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
++os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
++
++if __name__ == '__main__':
++ import build_utils
++ root, inp = sys.argv[1:3]
++ for sig in sys.argv[3:]:
++ name = re.sub ('X+', sig, root)
++ d = build_utils.standard_dict2(name, sig, '${component}')
++ build_utils.expand_template(d, inp)
++")
++
++ #make a list of all the generated headers
++ unset(expanded_files_h)
++ foreach(sig ${ARGN})
++ string(REGEX REPLACE "X+" ${sig} name ${root})
++ list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
++ endforeach(sig)
++ unset(name)
++
++ #try to force generate the headers
++ execute_process(
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}.h.t ${ARGN}
++ )
++
++ #create a command to generate the headers
++ add_custom_command(
++ OUTPUT ${expanded_files_h}
++ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}.h.t ${ARGN}
++ )
++
++ #install rules for the generated headers
++ list(APPEND generated_includes ${expanded_files_h})
++
++endmacro(GR_EXPAND_X_H)
++
++macro(GR_EXPAND_X_CC_H component root)
++
++ include(GrPython)
++
++ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++"#!${PYTHON_EXECUTABLE}
++
++import sys, os, re
++sys.path.append('${GR_RUNTIME_PYTHONPATH}')
++os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
++os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
++
++if __name__ == '__main__':
++ import build_utils
++ root, inp = sys.argv[1:3]
++ for sig in sys.argv[3:]:
++ name = re.sub ('X+', sig, root)
++ d = build_utils.standard_impl_dict2(name, sig, '${component}')
++ build_utils.expand_template(d, inp)
++")
++
++ #make a list of all the generated files
++ unset(expanded_files_cc)
++ unset(expanded_files_h)
++ foreach(sig ${ARGN})
++ string(REGEX REPLACE "X+" ${sig} name ${root})
++ list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
++ list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
++ endforeach(sig)
++ unset(name)
++
++ #try to force generate the source files
++ execute_process(
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}.cc.t ${ARGN}
++ )
++
++ #create a command to generate the source files
++ add_custom_command(
++ OUTPUT ${expanded_files_cc}
++ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}.cc.t ${ARGN}
++ )
++
++ #try to force generate the header files
++ execute_process(
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}.h.t ${ARGN}
++ )
++
++ #create a command to generate the header files
++ add_custom_command(
++ OUTPUT ${expanded_files_h}
++ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}.h.t ${ARGN}
++ )
++
++ #make source files depends on headers to force generation
++ set_source_files_properties(${expanded_files_cc}
++ PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
++ )
++
++ #install rules for the generated files
++ list(APPEND generated_sources ${expanded_files_cc})
++ list(APPEND generated_headers ${expanded_files_h})
++
++endmacro(GR_EXPAND_X_CC_H)
++
++macro(GR_EXPAND_X_CC_H_IMPL component root)
++
++ include(GrPython)
++
++ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++"#!${PYTHON_EXECUTABLE}
++
++import sys, os, re
++sys.path.append('${GR_RUNTIME_PYTHONPATH}')
++os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
++os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
++
++if __name__ == '__main__':
++ import build_utils
++ root, inp = sys.argv[1:3]
++ for sig in sys.argv[3:]:
++ name = re.sub ('X+', sig, root)
++ d = build_utils.standard_dict(name, sig, '${component}')
++ build_utils.expand_template(d, inp, '_impl')
++")
++
++ #make a list of all the generated files
++ unset(expanded_files_cc_impl)
++ unset(expanded_files_h_impl)
++ unset(expanded_files_h)
++ foreach(sig ${ARGN})
++ string(REGEX REPLACE "X+" ${sig} name ${root})
++ list(APPEND expanded_files_cc_impl ${CMAKE_CURRENT_BINARY_DIR}/${name}_impl.cc)
++ list(APPEND expanded_files_h_impl ${CMAKE_CURRENT_BINARY_DIR}/${name}_impl.h)
++ list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/../include/gnuradio/${component}/${name}.h)
++ endforeach(sig)
++ unset(name)
++
++ #try to force generate the _impl.cc files
++ execute_process(
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}_impl.cc.t ${ARGN}
++ )
++
++ #create a command to generate the _impl.cc files
++ add_custom_command(
++ OUTPUT ${expanded_files_cc_impl}
++ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.cc.t
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}_impl.cc.t ${ARGN}
++ )
++
++ #try to force generate the _impl.h files
++ execute_process(
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}_impl.h.t ${ARGN}
++ )
++
++ #create a command to generate the _impl.h files
++ add_custom_command(
++ OUTPUT ${expanded_files_h_impl}
++ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.h.t
++ COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
++ ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
++ ${root} ${root}_impl.h.t ${ARGN}
++ )
++
++ #make _impl.cc source files depend on _impl.h to force generation
++ set_source_files_properties(${expanded_files_cc_impl}
++ PROPERTIES OBJECT_DEPENDS "${expanded_files_h_impl}"
++ )
++
++ #make _impl.h source files depend on headers to force generation
++ set_source_files_properties(${expanded_files_h_impl}
++ PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
++ )
++
++ #install rules for the generated files
++ list(APPEND generated_sources ${expanded_files_cc_impl})
++ list(APPEND generated_headers ${expanded_files_h_impl})
++
++endmacro(GR_EXPAND_X_CC_H_IMPL)
+--- gr-analog/include/gnuradio/analog/CMakeLists.txt.orig
++++ gr-analog/include/gnuradio/analog/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-# Copyright 2012 Free Software Foundation, Inc.
++# Copyright 2012-2013 Free Software Foundation, Inc.
+ #
+ # This file is part of GNU Radio
+ #
+@@ -18,55 +18,12 @@
+ # Boston, MA 02110-1301, USA.
+
+ ########################################################################
+-# generate helper scripts to expand templated files
+-########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_dict2(name, sig, 'analog')
+- build_utils.expand_template(d, inp)
+-
+-")
+-
+-macro(expand_h root)
+- #make a list of all the generated files
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the files
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #install rules for the generated h files
+- list(APPEND generated_includes ${expanded_files_h})
+-endmacro(expand_h)
+-
+-########################################################################
+-# Invoke macro to generate various sources
++# Invoke macro to generate various headers
+ #######################################################################
+-expand_h(noise_source_X s i f c)
+-expand_h(fastnoise_source_X s i f c)
+-expand_h(sig_source_X s i f c)
++include(GrMiscUtils)
++GR_EXPAND_X_H(analog noise_source_X s i f c)
++GR_EXPAND_X_H(analog fastnoise_source_X s i f c)
++GR_EXPAND_X_H(analog sig_source_X s i f c)
+
+ add_custom_target(analog_generated_includes DEPENDS
+ ${generated_includes}
+--- gr-analog/lib/CMakeLists.txt.orig
++++ gr-analog/lib/CMakeLists.txt
+@@ -41,72 +41,12 @@ if(ENABLE_GR_CTRLPORT)
+ endif(ENABLE_GR_CTRLPORT)
+
+ ########################################################################
+-# generate helper scripts to expand templated files
++# Invoke macro to generate various sources and headers
+ ########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_impl_dict2(name, sig, 'analog')
+- build_utils.expand_template(d, inp)
+-")
+-
+-macro(expand_cc root)
+- #make a list of all the generated files
+- unset(expanded_files_cc)
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the source files
+- add_custom_command(
+- OUTPUT ${expanded_files_cc}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.cc.t ${ARGN}
+- )
+-
+- #create a command to generate the header file
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #make source files depends on headers to force generation
+- set_source_files_properties(${expanded_files_cc}
+- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
+- )
+-
+- #install rules for the generated cc files
+- list(APPEND generated_sources ${expanded_files_cc})
+- list(APPEND generated_headers ${expanded_files_h})
+-endmacro(expand_cc)
+-
+-
+-########################################################################
+-# Invoke macro to generate various sources
+-########################################################################
+-expand_cc(noise_source_X_impl s i f c)
+-expand_cc(fastnoise_source_X_impl s i f c)
+-expand_cc(sig_source_X_impl s i f c)
++include(GrMiscUtils)
++GR_EXPAND_X_CC_H(analog noise_source_X_impl s i f c)
++GR_EXPAND_X_CC_H(analog fastnoise_source_X_impl s i f c)
++GR_EXPAND_X_CC_H(analog sig_source_X_impl s i f c)
+
+ ########################################################################
+ # Setup library
+--- gr-blocks/include/gnuradio/blocks/CMakeLists.txt.orig
++++ gr-blocks/include/gnuradio/blocks/CMakeLists.txt
+@@ -18,79 +18,36 @@
+ # Boston, MA 02110-1301, USA.
+
+ ########################################################################
+-# generate helper scripts to expand templated files
++# Invoke macro to generate various headers
+ ########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_dict(name, sig, 'blocks')
+- build_utils.expand_template(d, inp)
+-
+-")
+-
+-macro(expand_h root)
+- #make a list of all the generated files
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the files
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #install rules for the generated h files
+- list(APPEND generated_includes ${expanded_files_h})
+-endmacro(expand_h)
+-
+-########################################################################
+-# Invoke macro to generate various sources
+-########################################################################
+-expand_h(add_XX ss ii cc)
+-expand_h(add_const_XX bb ss ii ff cc)
+-expand_h(add_const_vXX bb ss ii ff cc)
+-expand_h(and_XX bb ss ii)
+-expand_h(and_const_XX bb ss ii)
+-expand_h(argmax_XX fs is ss)
+-expand_h(divide_XX ss ii ff cc)
+-expand_h(integrate_XX ss ii ff cc)
+-expand_h(max_XX ff ii ss)
+-expand_h(moving_average_XX ss ii ff cc)
+-expand_h(multiply_XX ss ii)
+-expand_h(multiply_const_XX ss ii)
+-expand_h(multiply_const_vXX ss ii ff cc)
+-expand_h(mute_XX ss ii ff cc)
+-expand_h(not_XX bb ss ii)
+-expand_h(or_XX bb ss ii)
+-expand_h(peak_detector_XX fb ib sb)
+-expand_h(probe_signal_X b s i f c)
+-expand_h(probe_signal_vX b s i f c)
+-expand_h(sample_and_hold_XX bb ss ii ff)
+-expand_h(sub_XX ss ii ff cc)
+-expand_h(xor_XX bb ss ii)
+-expand_h(packed_to_unpacked_XX bb ss ii)
+-expand_h(unpacked_to_packed_XX bb ss ii)
+-expand_h(vector_insert_X b s i f c)
+-expand_h(vector_sink_X b s i f c)
+-expand_h(vector_source_X b s i f c)
++include(GrMiscUtils)
++GR_EXPAND_X_H(blocks add_XX ss ii cc)
++GR_EXPAND_X_H(blocks add_const_XX bb ss ii ff cc)
++GR_EXPAND_X_H(blocks add_const_vXX bb ss ii ff cc)
++GR_EXPAND_X_H(blocks and_XX bb ss ii)
++GR_EXPAND_X_H(blocks and_const_XX bb ss ii)
++GR_EXPAND_X_H(blocks argmax_XX fs is ss)
++GR_EXPAND_X_H(blocks divide_XX ss ii ff cc)
++GR_EXPAND_X_H(blocks integrate_XX ss ii ff cc)
++GR_EXPAND_X_H(blocks max_XX ff ii ss)
++GR_EXPAND_X_H(blocks moving_average_XX ss ii ff cc)
++GR_EXPAND_X_H(blocks multiply_XX ss ii)
++GR_EXPAND_X_H(blocks multiply_const_XX ss ii)
++GR_EXPAND_X_H(blocks multiply_const_vXX ss ii ff cc)
++GR_EXPAND_X_H(blocks mute_XX ss ii ff cc)
++GR_EXPAND_X_H(blocks not_XX bb ss ii)
++GR_EXPAND_X_H(blocks or_XX bb ss ii)
++GR_EXPAND_X_H(blocks peak_detector_XX fb ib sb)
++GR_EXPAND_X_H(blocks probe_signal_X b s i f c)
++GR_EXPAND_X_H(blocks probe_signal_vX b s i f c)
++GR_EXPAND_X_H(blocks sample_and_hold_XX bb ss ii ff)
++GR_EXPAND_X_H(blocks sub_XX ss ii ff cc)
++GR_EXPAND_X_H(blocks xor_XX bb ss ii)
++GR_EXPAND_X_H(blocks packed_to_unpacked_XX bb ss ii)
++GR_EXPAND_X_H(blocks unpacked_to_packed_XX bb ss ii)
++GR_EXPAND_X_H(blocks vector_insert_X b s i f c)
++GR_EXPAND_X_H(blocks vector_sink_X b s i f c)
++GR_EXPAND_X_H(blocks vector_source_X b s i f c)
+
+ add_custom_target(blocks_generated_includes DEPENDS
+ ${generated_includes}
+--- gr-blocks/lib/CMakeLists.txt.orig
++++ gr-blocks/lib/CMakeLists.txt
+@@ -23,100 +23,36 @@
+ include(${CMAKE_CURRENT_SOURCE_DIR}/ConfigChecks.cmake)
+
+ ########################################################################
+-# generate helper scripts to expand templated files
+-########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_dict(name, sig, 'blocks')
+- build_utils.expand_template(d, inp, '_impl')
+-")
+-
+-macro(expand_cc_h_impl root)
+- #make a list of all the generated files
+- unset(expanded_files_cc_impl)
+- unset(expanded_files_h_impl)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_cc_impl ${CMAKE_CURRENT_BINARY_DIR}/${name}_impl.cc)
+- list(APPEND expanded_files_h_impl ${CMAKE_CURRENT_BINARY_DIR}/${name}_impl.h)
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/../include/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the _impl.cc files
+- add_custom_command(
+- OUTPUT ${expanded_files_cc_impl}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.cc.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}_impl.cc.t ${ARGN}
+- )
+-
+- #create a command to generate the _impl.h files
+- add_custom_command(
+- OUTPUT ${expanded_files_h_impl}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}_impl.h.t ${ARGN}
+- )
+-
+- #make _impl.cc source files depend on headers to force generation
+- set_source_files_properties(${expanded_files_cc_impl}
+- PROPERTIES OBJECT_DEPENDS "${expanded_files_h_impl}"
+- )
+-
+- #make _impl.h source files depend on headers to force generation
+- set_source_files_properties(${expanded_files_h_impl}
+- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
+- )
+-
+- #install rules for the generated cc files
+- list(APPEND generated_sources ${expanded_files_cc_impl})
+-endmacro(expand_cc_h_impl)
+-
+-########################################################################
+ # Invoke macro to generate various sources
+ ########################################################################
+-expand_cc_h_impl(add_XX ss ii cc)
+-expand_cc_h_impl(add_const_XX bb ss ii ff cc)
+-expand_cc_h_impl(add_const_vXX bb ss ii ff cc)
+-expand_cc_h_impl(and_XX bb ss ii)
+-expand_cc_h_impl(and_const_XX bb ss ii)
+-expand_cc_h_impl(argmax_XX fs is ss)
+-expand_cc_h_impl(divide_XX ss ii ff cc)
+-expand_cc_h_impl(integrate_XX ss ii ff cc)
+-expand_cc_h_impl(max_XX ff ii ss)
+-expand_cc_h_impl(moving_average_XX ss ii ff cc)
+-expand_cc_h_impl(multiply_XX ss ii)
+-expand_cc_h_impl(multiply_const_XX ss ii)
+-expand_cc_h_impl(multiply_const_vXX ss ii ff cc)
+-expand_cc_h_impl(mute_XX ss ii ff cc)
+-expand_cc_h_impl(not_XX bb ss ii)
+-expand_cc_h_impl(or_XX bb ss ii)
+-expand_cc_h_impl(peak_detector_XX fb ib sb)
+-expand_cc_h_impl(probe_signal_X b s i f c)
+-expand_cc_h_impl(probe_signal_vX b s i f c)
+-expand_cc_h_impl(sample_and_hold_XX bb ss ii ff)
+-expand_cc_h_impl(sub_XX ss ii ff cc)
+-expand_cc_h_impl(xor_XX bb ss ii)
+-expand_cc_h_impl(packed_to_unpacked_XX bb ss ii)
+-expand_cc_h_impl(unpacked_to_packed_XX bb ss ii)
+-expand_cc_h_impl(vector_insert_X b s i f c)
+-expand_cc_h_impl(vector_sink_X b s i f c)
+-expand_cc_h_impl(vector_source_X b s i f c)
++include(GrMiscUtils)
++GR_EXPAND_X_CC_H_IMPL(blocks add_XX ss ii cc)
++GR_EXPAND_X_CC_H_IMPL(blocks add_const_XX bb ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks add_const_vXX bb ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks and_XX bb ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks and_const_XX bb ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks argmax_XX fs is ss)
++GR_EXPAND_X_CC_H_IMPL(blocks divide_XX ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks integrate_XX ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks max_XX ff ii ss)
++GR_EXPAND_X_CC_H_IMPL(blocks moving_average_XX ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks multiply_XX ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks multiply_const_XX ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks multiply_const_vXX ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks mute_XX ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks not_XX bb ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks or_XX bb ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks peak_detector_XX fb ib sb)
++GR_EXPAND_X_CC_H_IMPL(blocks probe_signal_X b s i f c)
++GR_EXPAND_X_CC_H_IMPL(blocks probe_signal_vX b s i f c)
++GR_EXPAND_X_CC_H_IMPL(blocks sample_and_hold_XX bb ss ii ff)
++GR_EXPAND_X_CC_H_IMPL(blocks sub_XX ss ii ff cc)
++GR_EXPAND_X_CC_H_IMPL(blocks xor_XX bb ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks packed_to_unpacked_XX bb ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks unpacked_to_packed_XX bb ss ii)
++GR_EXPAND_X_CC_H_IMPL(blocks vector_insert_X b s i f c)
++GR_EXPAND_X_CC_H_IMPL(blocks vector_sink_X b s i f c)
++GR_EXPAND_X_CC_H_IMPL(blocks vector_source_X b s i f c)
+
+ ########################################################################
+ # Setup the include and linker paths
+--- gr-digital/include/gnuradio/digital/CMakeLists.txt.orig
++++ gr-digital/include/gnuradio/digital/CMakeLists.txt
+@@ -17,54 +17,12 @@
+ # the Free Software Foundation, Inc., 51 Franklin Street,
+ # Boston, MA 02110-1301, USA.
+
++#################################################################
+ ########################################################################
+-# generate helper scripts to expand templated files
+-########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_dict2(name, sig, 'digital')
+- build_utils.expand_template(d, inp)
+-
+-")
+-
+-macro(expand_h root)
+- #make a list of all the generated files
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the files
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #install rules for the generated h files
+- list(APPEND generated_includes ${expanded_files_h})
+-endmacro(expand_h)
+-
+-########################################################################
+-# Invoke macro to generate various sources
++# Invoke macro to generate various headers
+ #######################################################################
+-expand_h(chunks_to_symbols_XX bf bc sf sc if ic)
++include(GrMiscUtils)
++GR_EXPAND_X_H(digital chunks_to_symbols_XX bf bc sf sc if ic)
+
+ add_custom_target(digital_generated_includes DEPENDS
+ ${generated_includes}
+--- gr-digital/lib/CMakeLists.txt.orig
++++ gr-digital/lib/CMakeLists.txt
+@@ -42,70 +42,10 @@ if(ENABLE_GR_CTRLPORT)
+ endif(ENABLE_GR_CTRLPORT)
+
+ ########################################################################
+-# generate helper scripts to expand templated files
++# Invoke macro to generate various sources and headers
+ ########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_impl_dict2(name, sig, 'digital')
+- build_utils.expand_template(d, inp)
+-")
+-
+-macro(expand_cc root)
+- #make a list of all the generated files
+- unset(expanded_files_cc)
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the source files
+- add_custom_command(
+- OUTPUT ${expanded_files_cc}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.cc.t ${ARGN}
+- )
+-
+- #create a command to generate the header file
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #make source files depends on headers to force generation
+- set_source_files_properties(${expanded_files_cc}
+- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
+- )
+-
+- #install rules for the generated cc files
+- list(APPEND generated_sources ${expanded_files_cc})
+- list(APPEND generated_headers ${expanded_files_h})
+-endmacro(expand_cc)
+-
+-
+-########################################################################
+-# Invoke macro to generate various sources
+-########################################################################
+-expand_cc(chunks_to_symbols_XX_impl bf bc sf sc if ic)
++include(GrMiscUtils)
++GR_EXPAND_X_CC_H(digital chunks_to_symbols_XX_impl bf bc sf sc if ic)
+
+ ########################################################################
+ # Setup library
+@@ -198,7 +138,6 @@ list(APPEND digital_libs
+ ${LOG4CPP_LIBRARIES}
+ )
+
+-
+ add_library(gnuradio-digital SHARED ${digital_sources})
+ target_link_libraries(gnuradio-digital ${digital_libs})
+ GR_LIBRARY_FOO(gnuradio-digital RUNTIME_COMPONENT "digital_runtime" DEVEL_COMPONENT "digital_devel")
+--- gr-fec/include/gnuradio/fec/CMakeLists.txt.orig
++++ gr-fec/include/gnuradio/fec/CMakeLists.txt
+@@ -18,63 +18,9 @@
+ # Boston, MA 02110-1301, USA.
+
+ ########################################################################
+-# generate helper scripts to expand templated files
+-########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_dict(name, sig, 'fec')
+- build_utils.expand_template(d, inp)
+-
+-")
+-
+-macro(expand_h root)
+- #make a list of all the generated files
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the files
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #install rules for the generated h files
+- list(APPEND generated_includes ${expanded_files_h})
+-endmacro(expand_h)
+-
+-########################################################################
+-# Invoke macro to generate various sources
+-########################################################################
+-#expand_h(foo_XX ss ii cc)
+-
+-add_custom_target(fec_generated_includes DEPENDS
+- ${generated_includes}
+-)
+-
+-########################################################################
+ # Install header files
+ ########################################################################
+ install(FILES
+- ${generated_includes}
+ api.h
+ decode_ccsds_27_fb.h
+ encode_ccsds_27_bb.h
+--- gr-filter/include/gnuradio/filter/CMakeLists.txt.orig
++++ gr-filter/include/gnuradio/filter/CMakeLists.txt
+@@ -18,56 +18,13 @@
+ # Boston, MA 02110-1301, USA.
+
+ ########################################################################
+-# generate helper scripts to expand templated files
+-########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_dict2(name, sig, 'filter')
+- build_utils.expand_template(d, inp)
+-
+-")
+-
+-macro(expand_h root)
+- #make a list of all the generated files
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the files
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #install rules for the generated h files
+- list(APPEND generated_includes ${expanded_files_h})
+-endmacro(expand_h)
+-
+-########################################################################
+-# Invoke macro to generate various sources
++# Invoke macro to generate various headers
+ #######################################################################
+-expand_h(fir_filter_XXX ccc ccf fcc fff fsf scc)
+-expand_h(freq_xlating_fir_filter_XXX ccc ccf fcc fcf scf scc)
+-expand_h(interp_fir_filter_XXX ccc ccf fcc fff fsf scc)
+-expand_h(rational_resampler_base_XXX ccc ccf fcc fff fsf scc)
++include(GrMiscUtils)
++GR_EXPAND_X_H(filter fir_filter_XXX ccc ccf fcc fff fsf scc)
++GR_EXPAND_X_H(filter freq_xlating_fir_filter_XXX ccc ccf fcc fcf scf scc)
++GR_EXPAND_X_H(filter interp_fir_filter_XXX ccc ccf fcc fff fsf scc)
++GR_EXPAND_X_H(filter rational_resampler_base_XXX ccc ccf fcc fff fsf scc)
+
+ add_custom_target(filter_generated_includes DEPENDS
+ ${generated_includes}
+--- gr-filter/lib/CMakeLists.txt.orig
++++ gr-filter/lib/CMakeLists.txt
+@@ -18,73 +18,13 @@
+ # Boston, MA 02110-1301, USA.
+
+ ########################################################################
+-# generate helper scripts to expand templated files
++# Invoke macro to generate various sources and headers
+ ########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_impl_dict2(name, sig, 'filter')
+- build_utils.expand_template(d, inp)
+-")
+-
+-macro(expand_cc root)
+- #make a list of all the generated files
+- unset(expanded_files_cc)
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the source files
+- add_custom_command(
+- OUTPUT ${expanded_files_cc}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.cc.t ${ARGN}
+- )
+-
+- #create a command to generate the header file
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #make source files depends on headers to force generation
+- set_source_files_properties(${expanded_files_cc}
+- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
+- )
+-
+- #install rules for the generated cc files
+- list(APPEND generated_sources ${expanded_files_cc})
+- list(APPEND generated_headers ${expanded_files_h})
+-endmacro(expand_cc)
+-
+-########################################################################
+-# Invoke macro to generate various sources
+-########################################################################
+-expand_cc(fir_filter_XXX_impl ccc ccf fcc fff fsf scc)
+-expand_cc(freq_xlating_fir_filter_XXX_impl ccc ccf fcc fcf scf scc)
+-expand_cc(interp_fir_filter_XXX_impl ccc ccf fcc fff fsf scc)
+-expand_cc(rational_resampler_base_XXX_impl ccc ccf fcc fff fsf scc)
+-
++include(GrMiscUtils)
++GR_EXPAND_X_CC_H(filter fir_filter_XXX_impl ccc ccf fcc fff fsf scc)
++GR_EXPAND_X_CC_H(filter freq_xlating_fir_filter_XXX_impl ccc ccf fcc fcf scf scc)
++GR_EXPAND_X_CC_H(filter interp_fir_filter_XXX_impl ccc ccf fcc fff fsf scc)
++GR_EXPAND_X_CC_H(filter rational_resampler_base_XXX_impl ccc ccf fcc fff fsf scc)
+
+ ########################################################################
+ # Setup the include and linker paths
+--- gr-trellis/include/gnuradio/trellis/CMakeLists.txt.orig
++++ gr-trellis/include/gnuradio/trellis/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-# Copyright 2012 Free Software Foundation, Inc.
++# Copyright 2012-2013 Free Software Foundation, Inc.
+ #
+ # This file is part of GNU Radio
+ #
+@@ -18,62 +18,19 @@
+ # Boston, MA 02110-1301, USA.
+
+ ########################################################################
+-# generate helper scripts to expand templated files
+-########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_dict2(name, sig, 'trellis')
+- build_utils.expand_template(d, inp)
+-
+-")
+-
+-macro(expand_h root)
+- #make a list of all the generated files
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the files
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #install rules for the generated h files
+- list(APPEND generated_includes ${expanded_files_h})
+-endmacro(expand_h)
+-
+-########################################################################
+-# Invoke macro to generate various sources
++# Invoke macro to generate various headers
+ #######################################################################
+-expand_h(encoder_XX bb bs bi ss si ii)
+-expand_h(sccc_encoder_XX bb bs bi ss si ii)
+-expand_h(pccc_encoder_XX bb bs bi ss si ii)
+-expand_h(metrics_X s i f c)
+-expand_h(viterbi_X b s i)
+-expand_h(viterbi_combined_XX sb ss si ib is ii fb fs fi cb cs ci)
+-expand_h(sccc_decoder_X b s i)
+-expand_h(sccc_decoder_combined_XX fb fs fi cb cs ci)
+-expand_h(pccc_decoder_X b s i)
+-expand_h(pccc_decoder_combined_XX fb fs fi cb cs ci)
++include(GrMiscUtils)
++GR_EXPAND_X_H(trellis encoder_XX bb bs bi ss si ii)
++GR_EXPAND_X_H(trellis sccc_encoder_XX bb bs bi ss si ii)
++GR_EXPAND_X_H(trellis pccc_encoder_XX bb bs bi ss si ii)
++GR_EXPAND_X_H(trellis metrics_X s i f c)
++GR_EXPAND_X_H(trellis viterbi_X b s i)
++GR_EXPAND_X_H(trellis viterbi_combined_XX sb ss si ib is ii fb fs fi cb cs ci)
++GR_EXPAND_X_H(trellis sccc_decoder_X b s i)
++GR_EXPAND_X_H(trellis sccc_decoder_combined_XX fb fs fi cb cs ci)
++GR_EXPAND_X_H(trellis pccc_decoder_X b s i)
++GR_EXPAND_X_H(trellis pccc_decoder_combined_XX fb fs fi cb cs ci)
+
+ add_custom_target(trellis_generated_includes DEPENDS
+ ${generated_includes}
+--- gr-trellis/lib/CMakeLists.txt.orig
++++ gr-trellis/lib/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-# Copyright 2012 Free Software Foundation, Inc.
++# Copyright 2012-2013 Free Software Foundation, Inc.
+ #
+ # This file is part of GNU Radio
+ #
+@@ -37,79 +37,20 @@ if(ENABLE_GR_CTRLPORT)
+ include_directories(${ICE_INCLUDE_DIR})
+ endif(ENABLE_GR_CTRLPORT)
+
+-#######################################################################
+-# generate the python helper script which calls into the build utils
+ ########################################################################
+-include(GrPython)
+-
+-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py "
+-#!${PYTHON_EXECUTABLE}
+-
+-import sys, os, re
+-sys.path.append('${GR_RUNTIME_PYTHONPATH}')
+-os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'
+-os.chdir('${CMAKE_CURRENT_BINARY_DIR}')
+-
+-if __name__ == '__main__':
+- import build_utils
+- root, inp = sys.argv[1:3]
+- for sig in sys.argv[3:]:
+- name = re.sub ('X+', sig, root)
+- d = build_utils.standard_impl_dict2(name, sig, 'trellis')
+- build_utils.expand_template(d, inp)
+-")
+-
+-macro(expand_cc root)
+- #make a list of all the generated files
+- unset(expanded_files_cc)
+- unset(expanded_files_h)
+- foreach(sig ${ARGN})
+- string(REGEX REPLACE "X+" ${sig} name ${root})
+- list(APPEND expanded_files_cc ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc)
+- list(APPEND expanded_files_h ${CMAKE_CURRENT_BINARY_DIR}/${name}.h)
+- endforeach(sig)
+-
+- #create a command to generate the source files
+- add_custom_command(
+- OUTPUT ${expanded_files_cc}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.cc.t ${ARGN}
+- )
+-
+- #create a command to generate the header file
+- add_custom_command(
+- OUTPUT ${expanded_files_h}
+- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
+- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+- ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
+- ${root} ${root}.h.t ${ARGN}
+- )
+-
+- #make source files depends on headers to force generation
+- set_source_files_properties(${expanded_files_cc}
+- PROPERTIES OBJECT_DEPENDS "${expanded_files_h}"
+- )
+-
+- #install rules for the generated cc files
+- list(APPEND generated_sources ${expanded_files_cc})
+- list(APPEND generated_headers ${expanded_files_h})
+-endmacro(expand_cc)
+-
+-########################################################################
+-# Invoke macro to generate various sources
++# Invoke macro to generate various sources and headers
+ ########################################################################
+-expand_cc(encoder_XX_impl bb bs bi ss si ii)
+-expand_cc(sccc_encoder_XX_impl bb bs bi ss si ii)
+-expand_cc(pccc_encoder_XX_impl bb bs bi ss si ii)
+-expand_cc(metrics_X_impl s i f c)
+-expand_cc(viterbi_X_impl b s i)
+-expand_cc(viterbi_combined_XX_impl sb ss si ib is ii fb fs fi cb cs ci)
+-expand_cc(sccc_decoder_X_impl b s i)
+-expand_cc(sccc_decoder_combined_XX_impl fb fs fi cb cs ci)
+-expand_cc(pccc_decoder_X_impl b s i)
+-expand_cc(pccc_decoder_combined_XX_impl fb fs fi cb cs ci)
++include(GrMiscUtils)
++GR_EXPAND_X_CC_H(trellis encoder_XX_impl bb bs bi ss si ii)
++GR_EXPAND_X_CC_H(trellis sccc_encoder_XX_impl bb bs bi ss si ii)
++GR_EXPAND_X_CC_H(trellis pccc_encoder_XX_impl bb bs bi ss si ii)
++GR_EXPAND_X_CC_H(trellis metrics_X_impl s i f c)
++GR_EXPAND_X_CC_H(trellis viterbi_X_impl b s i)
++GR_EXPAND_X_CC_H(trellis viterbi_combined_XX_impl sb ss si ib is ii fb fs fi cb cs ci)
++GR_EXPAND_X_CC_H(trellis sccc_decoder_X_impl b s i)
++GR_EXPAND_X_CC_H(trellis sccc_decoder_combined_XX_impl fb fs fi cb cs ci)
++GR_EXPAND_X_CC_H(trellis pccc_decoder_X_impl b s i)
++GR_EXPAND_X_CC_H(trellis pccc_decoder_combined_XX_impl fb fs fi cb cs ci)
+
+ ########################################################################
+ # Setup library
</ins></span></pre>
</div>
</div>
</body>
</html>