summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-10-28 15:24:08 (GMT)
committerBrad King <brad.king@kitware.com>2009-10-28 15:24:08 (GMT)
commit172d503c615c8392638e9d3a64f7994c667a278d (patch)
tree53b3a20192dfd05eec05125816600f8fd25a0855 /Source/cmCoreTryCompile.cxx
parentbc3cab3634f3a342c49702eb7051a4974c628a66 (diff)
downloadCMake-172d503c615c8392638e9d3a64f7994c667a278d.zip
CMake-172d503c615c8392638e9d3a64f7994c667a278d.tar.gz
CMake-172d503c615c8392638e9d3a64f7994c667a278d.tar.bz2
Fix try_compile when file cannot be found
The try_compile() command's COPY_FILE option should not try to actually copy the file if it cannot be found. Some C runtime library's fopen cannot handle an empty file name.
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r--Source/cmCoreTryCompile.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 4746f06..dab0c0d 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -317,7 +317,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
if ((res==0) && (copyFile.size()))
{
- if(!cmSystemTools::CopyFileAlways(this->OutputFile.c_str(),
+ if(this->OutputFile.empty() ||
+ !cmSystemTools::CopyFileAlways(this->OutputFile.c_str(),
copyFile.c_str()))
{
cmOStringStream emsg;