diff options
author | Alex Neundorf <neundorf@kde.org> | 2011-09-15 14:28:35 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2011-09-15 14:28:35 (GMT) |
commit | c886e312bbd6e26f049215c8bcc821d9597fed8c (patch) | |
tree | d1c200dfb2b1a63b64cf75071651c71cf611b202 /Source/cmTryRunCommand.cxx | |
parent | 31f43fdb5af80029bc644bffd853c81a25424623 (diff) | |
download | CMake-c886e312bbd6e26f049215c8bcc821d9597fed8c.zip CMake-c886e312bbd6e26f049215c8bcc821d9597fed8c.tar.gz CMake-c886e312bbd6e26f049215c8bcc821d9597fed8c.tar.bz2 |
Improve behaviour of --find-package mode with try_run/try_compile
Instead of failing with an error message which says things have not been
setup correctly, it now says that try_compile/try_run() are not
supported in find_package mode (#12426).
Alex
Diffstat (limited to 'Source/cmTryRunCommand.cxx')
-rw-r--r-- | Source/cmTryRunCommand.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index ce402a8..9044cf8 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -22,6 +22,14 @@ bool cmTryRunCommand return false; } + if(this->Makefile->GetCMakeInstance()->GetWorkingMode() == + cmake::FIND_PACKAGE_MODE) + { + cmSystemTools::Error( + "The TRY_RUN() command is not supported in --find-package mode."); + return false; + } + // build an arg list for TryCompile and extract the runArgs, std::vector<std::string> tryCompile; |