From fc6497883cc1408c3e01f90136f2f5d82c8d8421 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Wed, 2 Jan 2008 17:12:33 -0500 Subject: [PATCH] BUG: fix for bug 6151 --- Modules/UseSWIG.cmake | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index 19feb878c..5499f84f8 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -48,9 +48,14 @@ ENDMACRO(SWIG_MODULE_INITIALIZE) # MACRO(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile) - FOREACH(it ${SWIG_PYTHON_EXTRA_FILE_EXTENSION}) + GET_SOURCE_FILE_PROPERTY(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename + ${infile} SWIG_MODULE_NAME) + IF(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND") + GET_FILENAME_COMPONENT(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${infile}" NAME_WE) + ENDIF(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND") + FOREACH(it ${SWIG_${language}_EXTRA_FILE_EXTENSION}) SET(${outfiles} ${${outfiles}} - "${generatedpath}/${infile}.${it}") + "${generatedpath}/${SWIG_GET_EXTRA_OUTPUT_FILES_module_basename}.${it}") ENDFOREACH(it) ENDMACRO(SWIG_GET_EXTRA_OUTPUT_FILES) @@ -105,7 +110,7 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE} swig_extra_generated_files "${swig_outdir}" - "${swig_source_file_name_we}") + "${infile}") SET(swig_generated_file_fullname "${swig_generated_file_fullname}/${swig_source_file_name_we}") # add the language into the name of the file (i.e. TCL_wrap)