summaryrefslogtreecommitdiffstats
path: root/Modules/UseSWIG.cmake
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2011-03-28 16:12:26 (GMT)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2011-04-08 13:13:57 (GMT)
commitc08853651836aa0bae0494703cd4368451b738ae (patch)
tree9430d605a59e71bf47f58863c33f47b2e5f6fdf8 /Modules/UseSWIG.cmake
parent0e66141bea25a93a5ef42c39d5c3a0b6612c1fe6 (diff)
downloadCMake-c08853651836aa0bae0494703cd4368451b738ae.zip
CMake-c08853651836aa0bae0494703cd4368451b738ae.tar.gz
CMake-c08853651836aa0bae0494703cd4368451b738ae.tar.bz2
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
Diffstat (limited to 'Modules/UseSWIG.cmake')
-rw-r--r--Modules/UseSWIG.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index b547dc7..486d03d 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -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)
SET(swig_outdir ${CMAKE_SWIG_OUTDIR})
- # it may not exist, so create it:
- file(MAKE_DIRECTORY ${CMAKE_SWIG_OUTDIR})
ELSE(CMAKE_SWIG_OUTDIR)
SET(swig_outdir ${CMAKE_CURRENT_BINARY_DIR})
ENDIF(CMAKE_SWIG_OUTDIR)
@@ -168,6 +166,8 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
ENDIF(SWIG_MODULE_${name}_EXTRA_FLAGS)
ADD_CUSTOM_COMMAND(
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}"
ARGS "-${SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG}"
${swig_source_file_flags}