[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.

Text by Brad King.
---
 Source/cmLinkDirectoriesCommand.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/Source/cmLinkDirectoriesCommand.h b/Source/cmLinkDirectoriesCommand.h
index e5ff4f0..aa13589 100644
--- a/Source/cmLinkDirectoriesCommand.h
+++ b/Source/cmLinkDirectoriesCommand.h
@@ -65,7 +65,12 @@ 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"
+      "Note that this command is rarely necessary.  Library locations "
+      "returned by find_package() and find_library() are absolute paths.  "
+      "Pass these absolute library file paths directly to the "
+      "target_link_libraries() command.  CMake will ensure the linker finds "
+      "them."
       ;
     }
   
-- 
1.7.3.2


--nextPart3177050.L33mJioxOZ--

--nextPart6259102.4oQHCElCZU
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)

iEYEABECAAYFAk6oZ+sACgkQXKSJPmm5/E6H/gCfTAN71SMvT4h0WZQi5OLwAxcb
0xwAniAvkpT+8jJTsw42omar/e4Y9zp6
=AGov
-----END PGP SIGNATURE-----

--nextPart6259102.4oQHCElCZU--



More information about the cmake-developers mailing list