summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-02-01 15:43:51 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-02-01 15:43:51 (GMT)
commitc022b6f6862c67885401d24c438acac457c64f31 (patch)
treebf55d0b4cde4da740ed28893bc67cc60fdfcd692 /Source
parente18d0df5ed7170b9cc4eafa9f73c6605cc9b4107 (diff)
parentd257d68138a00758910bbca3dd77dcfcc04e65cc (diff)
downloadCMake-c022b6f6862c67885401d24c438acac457c64f31.zip
CMake-c022b6f6862c67885401d24c438acac457c64f31.tar.gz
CMake-c022b6f6862c67885401d24c438acac457c64f31.tar.bz2
Merge topic 'clarify-add_custom_command-TARGET-scope'
d257d681 add_custom_command: Clarify error when TARGET is out of scope (#15681) 4d53e0a7 Help: Clarify `add_custom_command(TARGET)` scope (#15681) 8c615af4 Help: Clarify policy `CMP0040` documentation (#15681) 63c5808f Help: Clarify scope of `if(TARGET)` expression a336e438 Help: Improve markup in `if` command documentation 88968265 Help: Improve markup in `get_target_property` documentation
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ba0d672..cba29eb 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -791,7 +791,24 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target,
if(issueMessage)
{
- e << "The target name \"" << target << "\" is unknown in this context.";
+ if (cmTarget const* t = this->FindTargetToUse(target))
+ {
+ if (t->IsImported())
+ {
+ e << "TARGET '" << target
+ << "' is IMPORTED and does not build here.";
+ }
+ else
+ {
+ e << "TARGET '" << target
+ << "' was not created in this directory.";
+ }
+ }
+ else
+ {
+ e << "No TARGET '" << target
+ << "' has been created in this directory.";
+ }
IssueMessage(messageType, e.str());
}