Merge topic 'ImproveFindPackageModeWithTryCompile'

f15945e Use makefile->IssueMessage() for better error messages
c886e31 Improve behaviour of --find-package mode with try_run/try_compile
31f43fd Remove trailing whitespace
This commit is contained in:
David Cole 2011-09-30 15:57:20 -04:00 committed by CMake Topic Stage
commit c4e08b5533
4 changed files with 65 additions and 50 deletions

View File

@ -20,6 +20,14 @@ bool cmTryCompileCommand
return false; return false;
} }
if(this->Makefile->GetCMakeInstance()->GetWorkingMode() ==
cmake::FIND_PACKAGE_MODE)
{
this->Makefile->IssueMessage(cmake::FATAL_ERROR,
"The TRY_COMPILE() command is not supported in --find-package mode.");
return false;
}
this->TryCompileCode(argv); this->TryCompileCode(argv);
// if They specified clean then we clean up what we can // if They specified clean then we clean up what we can
@ -32,4 +40,3 @@ bool cmTryCompileCommand
} }
return true; return true;
} }

View File

@ -22,6 +22,14 @@ bool cmTryRunCommand
return false; return false;
} }
if(this->Makefile->GetCMakeInstance()->GetWorkingMode() ==
cmake::FIND_PACKAGE_MODE)
{
this->Makefile->IssueMessage(cmake::FATAL_ERROR,
"The TRY_RUN() command is not supported in --find-package mode.");
return false;
}
// build an arg list for TryCompile and extract the runArgs, // build an arg list for TryCompile and extract the runArgs,
std::vector<std::string> tryCompile; std::vector<std::string> tryCompile;