<div dir="ltr"><div>Hi Andres.<br><br>I cannot comment on the property request itself, but you should be able to work around its absence by using `-` instead of `/` to introduce the linker option - the Visual Studio tools understand both, AFAIK.<br>
<br></div>Petr<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 13, 2014 at 1:42 PM, Anders Lindgren <span dir="ltr"><<a href="mailto:andlind@gmail.com" target="_blank">andlind@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi!<div><br></div><div><div>I have a third party-library only available in Release flavor. When building a Debug configuration, I need to pass the option /NODEFAULTLIB:libcmt to the Visual Studio linker.</div>
</div><div><br></div><div>I have been playing around with the new target interface system. However, I'm missing a way for a library to specify linker options, that would transitively affect targets that use the library (just like the INTERFACE_COMPILE_OPTIONS and INTERFACE_LINK_LIBRARIES do for compiler options and libraries, respectively).</div>
<div><br></div><div>So, I suggest adding a INTERFACE_LINK_OPTIONS target property. That way I would add the library using:<br></div><div><br></div><div> add_library(the_library.lib STATIC IMPORTED)</div><div> set_property(TARGET the_library.lib</div>
<div> PROPERTY INTERFACE_LINK_OPTIONS $<$<CONFIG:Debug>:/NODEFAULTLIB:libcmt>)</div><div><br></div><div>In addition, there are two properties, COMPILE_FLAGS and COMPILE_OPTIONS, with the difference that the latter understands generator expressions. I also suggest adding a LINK_OPTIONS along the same lines.</div>
<div><br></div><div><div>(Note that the INTERFACE_LINK_LIBRARIES property is designed to contain both libraries and linker options. However, an entry is only interpreted as an option if it starts with a "-", which is not the case for Visual Studio options.)</div>
</div><div><br></div><div>Sincerely,</div><div> Anders Lindgren</div><div><br></div></div>
<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div>