diff options
author | Brad King <brad.king@kitware.com> | 2013-04-02 18:06:55 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-04-02 18:06:55 (GMT) |
commit | ec0b84576be260dd2274d2e817106d917a875e70 (patch) | |
tree | ec8edf94dc3e06fb772ed2813e332783418c4fe7 /Source | |
parent | 3423915720c10caf2531698d2482a4058d53293a (diff) | |
parent | de13d68d11b9f8f08c67b8cbcdd0f957d5bae6e1 (diff) | |
download | CMake-ec0b84576be260dd2274d2e817106d917a875e70.zip CMake-ec0b84576be260dd2274d2e817106d917a875e70.tar.gz CMake-ec0b84576be260dd2274d2e817106d917a875e70.tar.bz2 |
Merge topic 'clarify-add_dependencies-error'
de13d68 add_dependencies: Distinguish target v. file dependencies in error (#14050)
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmAddDependenciesCommand.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx index a77140d..04a304e 100644 --- a/Source/cmAddDependenciesCommand.cxx +++ b/Source/cmAddDependenciesCommand.cxx @@ -35,10 +35,14 @@ bool cmAddDependenciesCommand } else { - std::string error = "Adding dependency to non-existent target: "; - error += target_name; - this->SetError(error.c_str()); - return false; + cmOStringStream e; + e << "Cannot add target-level dependencies to non-existent target \"" + << target_name << "\".\n" + << "The add_dependencies works for top-level logical targets created " + << "by the add_executable, add_library, or add_custom_target commands. " + << "If you want to add file-level dependencies see the DEPENDS option " + << "of the add_custom_target and add_custom_command commands."; + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); } return true; |