[CMake] Interface Libraries allow include directories but not link directories.. Why?
Brian Davis
bitminer at gmail.com
Mon Aug 21 20:17:25 EDT 2017
Why does:
Interface Libraries
https://cmake.org/cmake/help/latest/command/add_library.html?highlight=add_library#id3
allow include directories via
target_include_directories(INTERFACE)
but not link_directories
https://cmake.org/cmake/help/latest/prop_dir/LINK_DIRECTORIES.html?highlight=link_directories
which if we look at property scope:
https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html
Why is include_directories at target resolution while link_directories is
at directory resolution.
link_directories is a property on a directory which if I recalled correctly
I complained about many many moons ago (circa 2009) when I first realized
this. I did not understand this logic then and don't understand this logic
now. Someone what to give me the recipe for the CMake cool-aid so I can
mix that up, drink it down, and re-read the doc and finally come to terms
with this. Or could the powers that be redesign CMake to make sense. At
the time I wrapped this nonsense in a macro and pretended it did not happen
... now I am rewriting my project for "new" CMake and still don't get this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170821/b8330ffb/attachment.html>
More information about the CMake
mailing list