diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/UseSWIG.cmake | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index 19feb87..5499f84 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) |