[PATCH] Tell people that link_directories() is not what they are searching for

Rolf Eike Beer eike-kernel at sf-tec.de
Wed Oct 26 14:43:21 EDT 2011


Judging from the questions I see on the #cmake IRC channel this is one of the
most common pitfalls for people coming from other build systems, especially
plain Makefiles. Finally put this into the documentation to stop people
getting fooled into using this.
---
 Source/cmLinkDirectoriesCommand.h |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Source/cmLinkDirectoriesCommand.h b/Source/cmLinkDirectoriesCommand.h
index e5ff4f0..f40dd25 100644
--- a/Source/cmLinkDirectoriesCommand.h
+++ b/Source/cmLinkDirectoriesCommand.h
@@ -65,7 +65,11 @@ public:
       "For historical reasons, relative paths given to this command are "
       "passed to the linker unchanged "
       "(unlike many CMake commands which interpret them relative to the "
-      "current source directory)."
+      "current source directory).\n"
+      "Please note that this command is usually not what you are searching "
+      "for. In most cases you do not need to explicitely specify the linker "
+      "search path. Just pass the absolute path of your libraries to "
+      "target_link_libraries() and let CMake handle the details."
       ;
     }
   
-- 
1.7.3.2




More information about the cmake-developers mailing list