Commit 8b7ff9b0 authored by Ken Martin's avatar Ken Martin
Browse files

ENH: patch applied for bug 4517

parent 73a5c33f
...@@ -49,7 +49,7 @@ ENDMACRO(SWIG_MODULE_INITIALIZE) ...@@ -49,7 +49,7 @@ ENDMACRO(SWIG_MODULE_INITIALIZE)
MACRO(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile) MACRO(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
FOREACH(it ${SWIG_PYTHON_EXTRA_FILE_EXTENSION}) FOREACH(it ${SWIG_PYTHON_EXTRA_FILE_EXTENSION})
SET(outfiles ${outfiles} SET(${outfiles} ${${outfiles}}
"${generatedpath}/${infile}.${it}") "${generatedpath}/${infile}.${it}")
ENDFOREACH(it) ENDFOREACH(it)
ENDMACRO(SWIG_GET_EXTRA_OUTPUT_FILES) ENDMACRO(SWIG_GET_EXTRA_OUTPUT_FILES)
...@@ -96,9 +96,15 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) ...@@ -96,9 +96,15 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
SET(swig_generated_file_fullname SET(swig_generated_file_fullname
"${swig_generated_file_fullname}/${swig_source_file_relative_path}") "${swig_generated_file_fullname}/${swig_source_file_relative_path}")
ENDIF(swig_source_file_relative_path) ENDIF(swig_source_file_relative_path)
# If CMAKE_SWIG_OUTDIR was specified then pass it to -outdir
IF(CMAKE_SWIG_OUTDIR)
SET(swig_outdir ${CMAKE_SWIG_OUTDIR})
ELSE(CMAKE_SWIG_OUTDIR)
SET(swig_outdir ${CMAKE_CURRENT_BINARY_DIR})
ENDIF(CMAKE_SWIG_OUTDIR)
SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE} SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE}
swig_extra_generated_files swig_extra_generated_files
"${swig_generated_file_fullname}" "${swig_outdir}"
"${swig_source_file_name_we}") "${swig_source_file_name_we}")
SET(swig_generated_file_fullname SET(swig_generated_file_fullname
"${swig_generated_file_fullname}/${swig_source_file_name_we}") "${swig_generated_file_fullname}/${swig_source_file_name_we}")
...@@ -132,43 +138,24 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) ...@@ -132,43 +138,24 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
IF(SWIG_MODULE_${name}_EXTRA_FLAGS) IF(SWIG_MODULE_${name}_EXTRA_FLAGS)
SET(swig_extra_flags ${swig_extra_flags} ${SWIG_MODULE_${name}_EXTRA_FLAGS}) SET(swig_extra_flags ${swig_extra_flags} ${SWIG_MODULE_${name}_EXTRA_FLAGS})
ENDIF(SWIG_MODULE_${name}_EXTRA_FLAGS) ENDIF(SWIG_MODULE_${name}_EXTRA_FLAGS)
# If CMAKE_SWIG_OUTDIR was specified then pass it to -outdir ADD_CUSTOM_COMMAND(
IF(CMAKE_SWIG_OUTDIR) OUTPUT "${swig_generated_file_fullname}" ${swig_extra_generated_files}
ADD_CUSTOM_COMMAND( COMMAND "${SWIG_EXECUTABLE}"
OUTPUT "${swig_generated_file_fullname}" ARGS "-${SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG}"
COMMAND "${SWIG_EXECUTABLE}" ${swig_source_file_flags}
ARGS "-${SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG}" ${CMAKE_SWIG_FLAGS}
${swig_source_file_flags} -outdir ${swig_outdir}
${CMAKE_SWIG_FLAGS} ${swig_special_flags}
-outdir ${CMAKE_SWIG_OUTDIR} ${swig_extra_flags}
${swig_special_flags} ${swig_include_dirs}
${swig_extra_flags} -o "${swig_generated_file_fullname}"
${swig_include_dirs} "${swig_source_file_fullname}"
-o "${swig_generated_file_fullname}" MAIN_DEPENDENCY "${swig_source_file_fullname}"
"${swig_source_file_fullname}" DEPENDS ${SWIG_MODULE_${name}_EXTRA_DEPS}
MAIN_DEPENDENCY "${swig_source_file_fullname}" COMMENT "Swig source")
DEPENDS ${SWIG_MODULE_${name}_EXTRA_DEPS} SET_SOURCE_FILES_PROPERTIES("${swig_generated_file_fullname}" ${swig_extra_generated_files}
COMMENT "Swig source")
ELSE(CMAKE_SWIG_OUTDIR)
ADD_CUSTOM_COMMAND(
OUTPUT "${swig_generated_file_fullname}"
COMMAND "${SWIG_EXECUTABLE}"
ARGS "-${SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG}"
${swig_source_file_flags}
${CMAKE_SWIG_FLAGS}
${swig_outdir_flags}
${swig_special_flags}
${swig_extra_flags}
${swig_include_dirs}
-o "${swig_generated_file_fullname}"
"${swig_source_file_fullname}"
MAIN_DEPENDENCY "${swig_source_file_fullname}"
DEPENDS ${SWIG_MODULE_${name}_EXTRA_DEPS}
COMMENT "Swig source")
ENDIF(CMAKE_SWIG_OUTDIR)
SET_SOURCE_FILES_PROPERTIES("${swig_generated_file_fullname}"
PROPERTIES GENERATED 1) PROPERTIES GENERATED 1)
SET(${outfiles} "${swig_generated_file_fullname}") SET(${outfiles} "${swig_generated_file_fullname}" ${swig_extra_generated_files})
ENDMACRO(SWIG_ADD_SOURCE_TO_MODULE) ENDMACRO(SWIG_ADD_SOURCE_TO_MODULE)
# #
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment