<div dir="ltr">C comments<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 22, 2017 at 8:01 AM, Robert Maynard <span dir="ltr"><<a href="mailto:robert.maynard@kitware.com" target="_blank">robert.maynard@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Usage of link_directories is discouraged, and was part of the reason<br>
why a target based option was not added. As the documentation for<br>
link_directories states "Note that this command is rarely necessary.<br>
Library locations returned by find_package() and find_library() are<br>
absolute paths. Pass these absolute library file paths directly to the<br>
target_link_libraries() command. CMake will ensure the linker finds<br>
them."<br>
<div><div class="gmail-h5"><br></div></div></blockquote><div><br></div><div>Oh the horror.  We are not expected to have abs paths to our libs to ensure "CMake finds them" vs supporting link library directories which all compilers support for some reason.  I mean hey maybe CMake could support / expose functionality of the underlying tools to the user in a way and means that make sense and let them decide if abs paths or use of link libs dir is appropriate.  I know which one I would choose.  Is it really that difficult to make Link_directories a target specific property?<br><br></div><div>It's as though tying a remote control to a grandmother so as to "ensure" she can turn on the TV is also a good idea.<br><br></div><div>I hope I never understand this logic.<br><br></div><div>Has any one read my post on ITK and use of abs paths where there is a 50 char limit imposed on where itk is built due to command line limitations on windows for the build.  I am starting to understand how and why I now have to build itk at C:/itk... I asked ITK if I should just build at c:\ but they stated graciously something to the affect that I could  use those extra 3 chars... boy was I happy then!<br></div><div><br>I ask that kitware read:<br><br><a href="https://cmake.org/pipermail/cmake/2017-March/065227.html">https://cmake.org/pipermail/cmake/2017-March/065227.html</a> <br><br></div><div>and reassess logic of abs paths<br></div><div><br></div><div>Snips in line here for convenience:<br><br><br>-- snip --<br><br>But ITK is no great example either<br>as on windows has a limit due to path length limiting on where ITK can be<br>build (build dir) I think it's something like 56 characters (resulting in<br>build paths outside the project like C:\itk\src\ITK-4.8.1)  and I have<br>stated my aggravation regarding this on ITK's user forum.   I must be<br>joking right?  well from ITK root CMakeLists.txt file:<br><br>if( CMAKE_HOST_WIN32 )<br><br>  string( LENGTH "${CMAKE_CURRENT_SOURCE_DIR}" n )<br>  if( n GREATER 50 )<br>    message(<br>      FATAL_ERROR<br>      "ITK source code directory path length is too long (${n} > 50)."<br>      "Please move the ITK source code directory to a directory with a<br>shorter path."<br>      )<br>  endif()<br><br>Sadly no and .. ok so it's 50.<br><br>-- snip --<br><br></div><div>I would certainly like to hear a defense of this "logic". I like to say that I discourage insanity.<br><br></div><div><br></div><div><br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-h5">
On Mon, Aug 21, 2017 at 8:17 PM, Brian Davis <<a href="mailto:bitminer@gmail.com">bitminer@gmail.com</a>> wrote:<br>
> Why does:<br>
><br>
> Interface Libraries<br>
> <a href="https://cmake.org/cmake/help/latest/command/add_library.html?highlight=add_library#id3" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/<wbr>latest/command/add_library.<wbr>html?highlight=add_library#id3</a><br>
><br>
> allow include directories via<br>
><br>
> target_include_directories(<wbr>INTERFACE)<br>
><br>
> but not link_directories<br>
><br>
> <a href="https://cmake.org/cmake/help/latest/prop_dir/LINK_DIRECTORIES.html?highlight=link_directories" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/<wbr>latest/prop_dir/LINK_<wbr>DIRECTORIES.html?highlight=<wbr>link_directories</a><br>
><br>
> which if we look at property scope:<br>
><br>
> <a href="https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/<wbr>latest/manual/cmake-<wbr>properties.7.html</a><br>
><br>
> Why is include_directories at target resolution while link_directories is at<br>
> directory resolution.<br>
><br>
> link_directories is a property on a directory which if I recalled correctly<br>
> I complained about many many moons ago (circa 2009) when I first realized<br>
> this.  I did not understand this logic then and don't understand this logic<br>
> now.  Someone what to give me the recipe for the CMake cool-aid so I can mix<br>
> that up, drink it down, and re-read the doc and finally come to terms with<br>
> this.  Or could the powers that be redesign CMake to make sense.  At the<br>
> time I wrapped this nonsense in a macro and pretended it did not happen ...<br>
> now I am rewriting my project for "new" CMake and still don't get this.<br>
><br>
><br>
><br>
><br>
</div></div>> --<br>
><br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Please keep messages on-topic and check the CMake FAQ at:<br>
> <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
><br>
> Kitware offers various services to support the CMake community. For more<br>
> information on each offering, please visit:<br>
><br>
> CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/cmake</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Brian J. Davis<br></div>
</div></div></div>