summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-01-02 17:12:33 -0500
committerBill Hoffman <bill.hoffman@kitware.com>2008-01-02 17:12:33 -0500
commitfc6497883cc1408c3e01f90136f2f5d82c8d8421 (patch)
tree0afd21fa3a4fbba201c6a4f4049d9ef9b65c21c2
parent3da6fd9da4063faf05b85901d749fdc5c8f2d4ad (diff)
downloadcmake-fc6497883cc1408c3e01f90136f2f5d82c8d8421.tar.gz
BUG: fix for bug 6151
-rw-r--r--Modules/UseSWIG.cmake11
1 files changed, 8 insertions, 3 deletions
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 19feb878c8..5499f84f84 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)