summaryrefslogtreecommitdiff
path: root/Source/cmTryCompileCommand.cxx
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2011-09-15 16:28:35 +0200
committerAlex Neundorf <neundorf@kde.org>2011-09-15 16:28:35 +0200
commitc886e312bbd6e26f049215c8bcc821d9597fed8c (patch)
treed1c200dfb2b1a63b64cf75071651c71cf611b202 /Source/cmTryCompileCommand.cxx
parent31f43fdb5af80029bc644bffd853c81a25424623 (diff)
downloadcmake-c886e312bbd6e26f049215c8bcc821d9597fed8c.tar.gz
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/cmTryCompileCommand.cxx')
-rw-r--r--Source/cmTryCompileCommand.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx
index 4d39d54567..546e42fbd2 100644
--- a/Source/cmTryCompileCommand.cxx
+++ b/Source/cmTryCompileCommand.cxx
@@ -20,6 +20,14 @@ bool cmTryCompileCommand
return false;
}
+ if(this->Makefile->GetCMakeInstance()->GetWorkingMode() ==
+ cmake::FIND_PACKAGE_MODE)
+ {
+ cmSystemTools::Error(
+ "The TRY_COMPILE() command is not supported in --find-package mode.");
+ return false;
+ }
+
this->TryCompileCode(argv);
// if They specified clean then we clean up what we can
@@ -32,4 +40,3 @@ bool cmTryCompileCommand
}
return true;
}
-