Bläddra i källkod

Merge topic 'doc-target_link_libraries-scope'

999ce0a Document target_link_libraries target scope (#11058)
Brad King 15 år sedan
förälder
incheckning
419302e2d6
2 ändrade filer med 6 tillägg och 2 borttagningar
  1. 2 2
      Source/cmMakefile.cxx
  2. 4 0
      Source/cmTargetLinkLibrariesCommand.h

+ 2 - 2
Source/cmMakefile.cxx

@@ -1364,8 +1364,8 @@ void cmMakefile::AddLinkLibraryForTarget(const char *target,
     cmOStringStream e;
     e << "Attempt to add link library \""
       << lib << "\" to target \""
-      << target << "\" which is not built by this project.";
-    cmSystemTools::Error(e.str().c_str());
+      << target << "\" which is not built in this directory.";
+    this->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
     }
 }
 

+ 4 - 0
Source/cmTargetLinkLibrariesCommand.h

@@ -62,6 +62,10 @@ public:
       "  target_link_libraries(<target> [item1 [item2 [...]]]\n"
       "                        [[debug|optimized|general] <item>] ...)\n"
       "Specify libraries or flags to use when linking a given target.  "
+      "The named <target> must have been created in the current directory "
+      "by a command such as add_executable or add_library.  "
+      "The remaining arguments specify library names or flags."
+      "\n"
       "If a library name matches that of another target in the project "
       "a dependency will automatically be added in the build system to make "
       "sure the library being linked is up-to-date before the target links.  "