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.
@@ -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;