Commit c0885365 authored by Mathieu Malaterre's avatar Mathieu Malaterre
Browse files

UseSWIG.cmake does not expand $(OutDir)

This commit fixes BUG: 0011215 by properly expanding $(OutDir)
Instead of creating the output directory using file(MAKE_DIRECTORY)
we use cmake -E to create the directory at execution time
parent 0e66141b
...@@ -125,8 +125,6 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) ...@@ -125,8 +125,6 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
# If CMAKE_SWIG_OUTDIR was specified then pass it to -outdir # If CMAKE_SWIG_OUTDIR was specified then pass it to -outdir
IF(CMAKE_SWIG_OUTDIR) IF(CMAKE_SWIG_OUTDIR)
SET(swig_outdir ${CMAKE_SWIG_OUTDIR}) SET(swig_outdir ${CMAKE_SWIG_OUTDIR})
# it may not exist, so create it:
file(MAKE_DIRECTORY ${CMAKE_SWIG_OUTDIR})
ELSE(CMAKE_SWIG_OUTDIR) ELSE(CMAKE_SWIG_OUTDIR)
SET(swig_outdir ${CMAKE_CURRENT_BINARY_DIR}) SET(swig_outdir ${CMAKE_CURRENT_BINARY_DIR})
ENDIF(CMAKE_SWIG_OUTDIR) ENDIF(CMAKE_SWIG_OUTDIR)
...@@ -168,6 +166,8 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) ...@@ -168,6 +166,8 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
ENDIF(SWIG_MODULE_${name}_EXTRA_FLAGS) ENDIF(SWIG_MODULE_${name}_EXTRA_FLAGS)
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT "${swig_generated_file_fullname}" ${swig_extra_generated_files} OUTPUT "${swig_generated_file_fullname}" ${swig_extra_generated_files}
# Let's create the ${swig_outdir} at execution time, in case dir contains $(OutDir)
COMMAND ${CMAKE_COMMAND} -E make_directory ${swig_outdir}
COMMAND "${SWIG_EXECUTABLE}" COMMAND "${SWIG_EXECUTABLE}"
ARGS "-${SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG}" ARGS "-${SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG}"
${swig_source_file_flags} ${swig_source_file_flags}
......
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