[CMake] LINK_FLAGS directory property

Matthew Keeler mkeeler at tenable.com
Wed Apr 27 11:57:14 EDT 2016


Is there an equivalent directory property for the target level LINK_FLAGS property. I can’t see anything according to the documentation but was hoping there was an oversight and something actually existed.

What I am trying to do is pass extra flags to the linker for every target in my project and I didn’t want to have to set it per target. I tried using the link_libraries command but the flags I am adding are msvc specific and start with ‘/‘ and cmake seems to be turning these into ‘\’ when its passed to the linker. Then the linker thinks its trying to link in another file and everything blows up.

Also a secondary question is what does the INTERPROCEDURAL_OPTIMIZATIONS property at the directory level do. I assume on Windows it passes /GL to the compiler but will this also add /LCTG to the linker flags and prevent incremental linking. If I turn this property on will it also do it for debug configurations or just optimized configurations?

-- 
Matt Keeler

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160427/4aea6902/attachment-0001.html>


More information about the CMake mailing list