From ecd4271b0b71a832ef5c2c74dc14f05df7be8d93 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 21 Sep 2011 07:55:24 -0700 Subject: core: attempt at fixing up generation logic in gengen (filter, trellis TODO) --- gnuradio-core/src/lib/gengen/CMakeLists.txt | 193 +++++++++------------------- 1 file changed, 61 insertions(+), 132 deletions(-) (limited to 'gnuradio-core/src/lib/gengen') diff --git a/gnuradio-core/src/lib/gengen/CMakeLists.txt b/gnuradio-core/src/lib/gengen/CMakeLists.txt index a06a61e6d..990fcbc91 100644 --- a/gnuradio-core/src/lib/gengen/CMakeLists.txt +++ b/gnuradio-core/src/lib/gengen/CMakeLists.txt @@ -20,144 +20,73 @@ ######################################################################## # This file included, use CMake directory variables ######################################################################## - -######################################################################## -# Generate the makefile.gen, then extract its sources: -# This is a round-about way to extract the sources, -# but it requires minimum changed to the python utils. -# -# The recommended way to do this: -# - Make a generation macro that registers the sources command. -# - List the generation macro with each templated source file. -# - Create a python script (very generic) to perform generation. -# - This way the targets would depend only on their sources. -######################################################################## -EXECUTE_PROCESS( - COMMAND ${PYTHON_EXECUTABLE} -c " -import os, sys -sys.path.append('${GR_CORE_PYTHONPATH}') -sys.path.append('${CMAKE_CURRENT_SOURCE_DIR}') -os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}' -os.environ['gendir'] = '${CMAKE_CURRENT_BINARY_DIR}' -os.environ['do_makefile'] = '1' -os.environ['do_sources'] = '0' -from generate_all import generate_all -generate_all() - " WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i + "// This file is machine generated. All edits will be overwritten\n" ) -MACRO(GEGEN_GEN_EXTRACT outvar ext) - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import os; print ';'.join( - map(lambda x: os.path.join('${CMAKE_CURRENT_BINARY_DIR}', x.replace('\\\\', '').strip()), - filter(lambda f: '${ext}' in f, open('${CMAKE_CURRENT_BINARY_DIR}/Makefile.gen').readlines() - )))" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE ${outvar}) - FILE(TO_CMAKE_PATH "${${outvar}}" ${outvar}) -ENDMACRO(GEGEN_GEN_EXTRACT) +MACRO(expand_h_cc_i_sig root sig) + STRING(REGEX REPLACE "X+" ${sig} name ${root}) + FOREACH(ext cc h i) + ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}.${ext} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.${ext}.t + COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} -c +\"import os, sys\; sys.path.append('${GR_CORE_PYTHONPATH}')\; os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'\; import build_utils\; build_utils.expand_template(build_utils.standard_dict('${name}', '${sig}'), '${root}.${ext}.t')\" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + ENDFOREACH(ext) -GEGEN_GEN_EXTRACT(generated_gengen_sources ".cc") -GEGEN_GEN_EXTRACT(generated_gengen_includes ".h") -GEGEN_GEN_EXTRACT(generated_gengen_swigs ".i") + # install rules for the generated cc, h, and i files + LIST(APPEND generated_gengen_sources ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc) + LIST(APPEND generated_gengen_includes ${CMAKE_CURRENT_BINARY_DIR}/${name}.h) + LIST(APPEND generated_gengen_swigs ${CMAKE_CURRENT_BINARY_DIR}/${name}.i) -#TODO simplify this list with a triple-threat for loop -SET(generated_gengen_deps - ${CMAKE_CURRENT_SOURCE_DIR}/generate_all.py - ${CMAKE_CURRENT_SOURCE_DIR}/generate_common.py - ${CMAKE_CURRENT_SOURCE_DIR}/gr_add_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_add_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_add_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_add_const_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_add_const_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_add_const_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_add_const_vXX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_add_const_vXX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_add_const_vXX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_argmax_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_argmax_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_argmax_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_chunks_to_symbols_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_chunks_to_symbols_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_chunks_to_symbols_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_divide_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_divide_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_divide_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_integrate_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_integrate_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_integrate_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_max_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_max_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_max_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_multiply_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_multiply_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_multiply_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_multiply_const_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_multiply_const_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_multiply_const_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_multiply_const_vXX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_multiply_const_vXX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_multiply_const_vXX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_mute_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_mute_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_mute_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_noise_source_X.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_noise_source_X.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_noise_source_X.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_packed_to_unpacked_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_packed_to_unpacked_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_packed_to_unpacked_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_peak_detector_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_peak_detector_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_peak_detector_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_sample_and_hold_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_sample_and_hold_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_sample_and_hold_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_sig_source_X.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_sig_source_X.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_sig_source_X.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_sub_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_sub_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_sub_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_unpacked_to_packed_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_unpacked_to_packed_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_unpacked_to_packed_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_vector_source_X.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_vector_source_X.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_vector_source_X.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_vector_sink_X.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_vector_sink_X.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_vector_sink_X.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_xor_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_xor_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_xor_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_and_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_and_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_and_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_and_const_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_and_const_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_and_const_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_or_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_or_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_or_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_not_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_not_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_not_XX.i.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_moving_average_XX.cc.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_moving_average_XX.h.t - ${CMAKE_CURRENT_SOURCE_DIR}/gr_moving_average_XX.i.t -) + # append entries into the global swig include file + FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%{#include<${name}.h>%}\n") + FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%include<${name}.i>\n") -ADD_CUSTOM_COMMAND( - OUTPUT - ${generated_gengen_sources} - ${generated_gengen_includes} - ${generated_gengen_swigs} - DEPENDS ${generated_gengen_deps} - COMMAND ${PYTHON_EXECUTABLE} -B -c - \"import os, sys\;sys.path.append('${GR_CORE_PYTHONPATH}')\;sys.path.append('${CMAKE_CURRENT_SOURCE_DIR}')\;os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'\;from generate_all import generate_all\;generate_all()\" - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "generating gengen files" -) +ENDMACRO(expand_h_cc_i_sig) + +MACRO(expand_h_cc_i root) + FOREACH(sig ${ARGN}) + expand_h_cc_i_sig(${root} ${sig}) + ENDFOREACH(sig) +ENDMACRO(expand_h_cc_i) + +######################################################################## +# Invoke macro to generate various sources +######################################################################## +expand_h_cc_i(gr_vector_source_X b s i f c) +expand_h_cc_i(gr_vector_sink_X b s i f c) +expand_h_cc_i(gr_noise_source_X s i f c) +expand_h_cc_i(gr_sig_source_X s i f c) + +expand_h_cc_i(gr_add_const_XX ss ii ff cc sf) +expand_h_cc_i(gr_multiply_const_XX ss ii ff cc) +expand_h_cc_i(gr_add_XX ss ii ff cc) +expand_h_cc_i(gr_sub_XX ss ii ff cc) +expand_h_cc_i(gr_multiply_XX ss ii ff cc) +expand_h_cc_i(gr_divide_XX ss ii ff cc) +expand_h_cc_i(gr_mute_XX ss ii ff cc) +expand_h_cc_i(gr_add_const_vXX ss ii ff cc) +expand_h_cc_i(gr_multiply_const_vXX ss ii ff cc) +expand_h_cc_i(gr_integrate_XX ss ii ff cc) +expand_h_cc_i(gr_moving_average_XX ss ii ff cc) + +expand_h_cc_i(gr_chunks_to_symbols_XX bf bc sf sc if ic) +expand_h_cc_i(gr_unpacked_to_packed_XX bb ss ii) +expand_h_cc_i(gr_packed_to_unpacked_XX bb ss ii) +expand_h_cc_i(gr_xor_XX bb ss ii) +expand_h_cc_i(gr_and_XX bb ss ii) +expand_h_cc_i(gr_and_const_XX bb ss ii) +expand_h_cc_i(gr_or_XX bb ss ii) +expand_h_cc_i(gr_not_XX bb ss ii) +expand_h_cc_i(gr_sample_and_hold_XX bb ss ii ff) +expand_h_cc_i(gr_argmax_XX fs is ss) +expand_h_cc_i(gr_max_XX ff ii ss) +expand_h_cc_i(gr_peak_detector_XX fb ib sb) -ADD_CUSTOM_TARGET(gengen_generated DEPENDS +ADD_CUSTOM_TARGET(gengen_generated ALL DEPENDS ${generated_gengen_sources} ${generated_gengen_includes} ${generated_gengen_swigs} -- cgit From f55fe0bd647131388bfbfa1637317660df59b86b Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 21 Sep 2011 12:30:15 -0700 Subject: core: re-work gengen generation (hope its simpler) --- gnuradio-core/src/lib/gengen/CMakeLists.txt | 82 +++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 22 deletions(-) (limited to 'gnuradio-core/src/lib/gengen') diff --git a/gnuradio-core/src/lib/gengen/CMakeLists.txt b/gnuradio-core/src/lib/gengen/CMakeLists.txt index 990fcbc91..ca390656c 100644 --- a/gnuradio-core/src/lib/gengen/CMakeLists.txt +++ b/gnuradio-core/src/lib/gengen/CMakeLists.txt @@ -20,37 +20,56 @@ ######################################################################## # This file included, use CMake directory variables ######################################################################## -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i - "// This file is machine generated. All edits will be overwritten\n" -) -MACRO(expand_h_cc_i_sig root sig) - STRING(REGEX REPLACE "X+" ${sig} name ${root}) +######################################################################## +# generate the python helper script which calls into the build utils +######################################################################## +FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py " +#!${PYTHON_EXECUTABLE} + +import sys, os, re +sys.path.append('${GR_CORE_PYTHONPATH}') +os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}' +os.chdir('${CMAKE_CURRENT_BINARY_DIR}') + +if __name__ == '__main__': + import build_utils + root, out = sys.argv[1:3] + for sig in sys.argv[3:]: + name = re.sub ('X+', sig, root) + d = build_utils.standard_dict(name, sig) + build_utils.expand_template(d, out) + +") + +######################################################################## +# generation helper macro to generate various files from template +######################################################################## +MACRO(expand_h_cc_i root) + FOREACH(ext cc h i) + #make a list of all the generated files + UNSET(expanded_files_${ext}) + FOREACH(sig ${ARGN}) + STRING(REGEX REPLACE "X+" ${sig} name ${root}) + LIST(APPEND expanded_files_${ext} ${CMAKE_CURRENT_BINARY_DIR}/${name}.${ext}) + ENDFOREACH(sig) + + #create a command to generate the files ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}.${ext} + OUTPUT ${expanded_files_${ext}} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.${ext}.t - COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} -c -\"import os, sys\; sys.path.append('${GR_CORE_PYTHONPATH}')\; os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}'\; import build_utils\; build_utils.expand_template(build_utils.standard_dict('${name}', '${sig}'), '${root}.${ext}.t')\" - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} + ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py + ${root} ${root}.${ext}.t ${ARGN} ) ENDFOREACH(ext) # install rules for the generated cc, h, and i files - LIST(APPEND generated_gengen_sources ${CMAKE_CURRENT_BINARY_DIR}/${name}.cc) - LIST(APPEND generated_gengen_includes ${CMAKE_CURRENT_BINARY_DIR}/${name}.h) - LIST(APPEND generated_gengen_swigs ${CMAKE_CURRENT_BINARY_DIR}/${name}.i) - - # append entries into the global swig include file - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%{#include<${name}.h>%}\n") - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%include<${name}.i>\n") - -ENDMACRO(expand_h_cc_i_sig) + LIST(APPEND generated_gengen_sources ${expanded_files_cc}) + LIST(APPEND generated_gengen_includes ${expanded_files_h}) + LIST(APPEND generated_gengen_swigs ${expanded_files_i}) -MACRO(expand_h_cc_i root) - FOREACH(sig ${ARGN}) - expand_h_cc_i_sig(${root} ${sig}) - ENDFOREACH(sig) ENDMACRO(expand_h_cc_i) ######################################################################## @@ -92,6 +111,25 @@ ADD_CUSTOM_TARGET(gengen_generated ALL DEPENDS ${generated_gengen_swigs} ) +######################################################################## +# Create the master gengen swig include files +######################################################################## +FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i + "// This file is machine generated. All edits will be overwritten\n" +) + +FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%{\n") +FOREACH(swig_file ${generated_gengen_swigs}) + GET_FILENAME_COMPONENT(name ${swig_file} NAME) + FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i " #include<${name}.h>\n") +ENDFOREACH(swig_file) +FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%}\n") + +FOREACH(swig_file ${generated_gengen_swigs}) + GET_FILENAME_COMPONENT(name ${swig_file} NAME) + FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%include<${name}.h>\n") +ENDFOREACH(swig_file) + ######################################################################## # Handle the generated sources + a few non-generated ones ######################################################################## -- cgit From bb98061115a2c7299fb24ed90ba48786118bf32e Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 21 Sep 2011 23:38:38 -0700 Subject: trellis: performed generation re-work on gr-trellis lib --- gnuradio-core/src/lib/gengen/CMakeLists.txt | 30 +++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'gnuradio-core/src/lib/gengen') diff --git a/gnuradio-core/src/lib/gengen/CMakeLists.txt b/gnuradio-core/src/lib/gengen/CMakeLists.txt index ca390656c..a223d291f 100644 --- a/gnuradio-core/src/lib/gengen/CMakeLists.txt +++ b/gnuradio-core/src/lib/gengen/CMakeLists.txt @@ -34,11 +34,11 @@ os.chdir('${CMAKE_CURRENT_BINARY_DIR}') if __name__ == '__main__': import build_utils - root, out = sys.argv[1:3] + 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) - build_utils.expand_template(d, out) + build_utils.expand_template(d, inp) ") @@ -47,7 +47,7 @@ if __name__ == '__main__': ######################################################################## MACRO(expand_h_cc_i root) - FOREACH(ext cc h i) + FOREACH(ext h cc i) #make a list of all the generated files UNSET(expanded_files_${ext}) FOREACH(sig ${ARGN}) @@ -65,7 +65,12 @@ MACRO(expand_h_cc_i root) ) ENDFOREACH(ext) - # install rules for the generated cc, h, and i files + #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, h, and i files LIST(APPEND generated_gengen_sources ${expanded_files_cc}) LIST(APPEND generated_gengen_includes ${expanded_files_h}) LIST(APPEND generated_gengen_swigs ${expanded_files_i}) @@ -105,8 +110,7 @@ expand_h_cc_i(gr_argmax_XX fs is ss) expand_h_cc_i(gr_max_XX ff ii ss) expand_h_cc_i(gr_peak_detector_XX fb ib sb) -ADD_CUSTOM_TARGET(gengen_generated ALL DEPENDS - ${generated_gengen_sources} +ADD_CUSTOM_TARGET(gengen_generated DEPENDS ${generated_gengen_includes} ${generated_gengen_swigs} ) @@ -114,20 +118,22 @@ ADD_CUSTOM_TARGET(gengen_generated ALL DEPENDS ######################################################################## # Create the master gengen swig include files ######################################################################## -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i - "// This file is machine generated. All edits will be overwritten\n" -) +FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i " +// +// This file is machine generated. All edits will be overwritten +// +") FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%{\n") FOREACH(swig_file ${generated_gengen_swigs}) - GET_FILENAME_COMPONENT(name ${swig_file} NAME) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i " #include<${name}.h>\n") + GET_FILENAME_COMPONENT(name ${swig_file} NAME_WE) + FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "#include<${name}.h>\n") ENDFOREACH(swig_file) FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%}\n") FOREACH(swig_file ${generated_gengen_swigs}) GET_FILENAME_COMPONENT(name ${swig_file} NAME) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%include<${name}.h>\n") + FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/gengen_generated.i "%include<${name}>\n") ENDFOREACH(swig_file) ######################################################################## -- cgit