summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/gengen
diff options
context:
space:
mode:
authorJosh Blum2011-11-04 21:44:10 -0700
committerJosh Blum2011-11-04 21:44:10 -0700
commit0b3a4a2c43e9fd4e3cc03c694b408034954c9d74 (patch)
tree3c49d2ec6ab91a3b43ad8015c069a55d82cffb70 /gnuradio-core/src/lib/gengen
parent56fcd5f9b22af33976f9413d3a9d0aec41a7b556 (diff)
downloadgnuradio-0b3a4a2c43e9fd4e3cc03c694b408034954c9d74.tar.gz
gnuradio-0b3a4a2c43e9fd4e3cc03c694b408034954c9d74.tar.bz2
gnuradio-0b3a4a2c43e9fd4e3cc03c694b408034954c9d74.zip
cmake: fixed up swig deps properly for make -j*
Also took the time to fix up the swig index file generation. This may have not-been auto-regenerating before as well.
Diffstat (limited to 'gnuradio-core/src/lib/gengen')
-rw-r--r--gnuradio-core/src/lib/gengen/CMakeLists.txt43
1 files changed, 17 insertions, 26 deletions
diff --git a/gnuradio-core/src/lib/gengen/CMakeLists.txt b/gnuradio-core/src/lib/gengen/CMakeLists.txt
index e3da278f2..a7292f131 100644
--- a/gnuradio-core/src/lib/gengen/CMakeLists.txt
+++ b/gnuradio-core/src/lib/gengen/CMakeLists.txt
@@ -118,37 +118,28 @@ add_custom_target(gengen_generated DEPENDS
########################################################################
# Create the master gengen swig include files
########################################################################
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.py "
-import os, sys
-if __name__ == '__main__':
- incs = sys.argv[2:]
- h_incs = '\\n'.join(['#include<%s.h>'%(os.path.splitext(os.path.basename(inc))[0]) for inc in incs])
- i_incs = '\\n'.join(['%%include<%s>'%(os.path.basename(inc)) for inc in incs])
- open(sys.argv[1], 'w').write('''
+set(generated_index ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i.in)
+file(WRITE ${generated_index} "
//
// This file is machine generated. All edits will be overwritten
//
-
-%%{
-%s
-%%}
-
-%s
-
-'''%(h_incs, i_incs))
")
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i
- DEPENDS ${generated_gengen_swigs}
- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
- ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.py
- ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i
- ${generated_gengen_swigs}
-)
-
-add_custom_target(gengen_generated_index DEPENDS
- ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i
+file(APPEND ${generated_index} "%{\n")
+foreach(swig_file ${generated_gengen_swigs})
+ get_filename_component(name ${swig_file} NAME_WE)
+ file(APPEND ${generated_index} "#include<${name}.h>\n")
+endforeach(swig_file)
+file(APPEND ${generated_index} "%}\n")
+
+foreach(swig_file ${generated_gengen_swigs})
+ get_filename_component(name ${swig_file} NAME)
+ file(APPEND ${generated_index} "%include<${name}>\n")
+endforeach(swig_file)
+
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${generated_index} ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i
)
########################################################################