<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 13, 2018 at 2:38 PM, ThePhD <span dir="ltr"><<a href="mailto:jm3689@columbia.edu" target="_blank">jm3689@columbia.edu</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"><div><div>I have a project where I attempt to add linker flags to a Visual Studio project using<br><br></div> target_link_libraries(lib_<wbr>target PRIVATE /OPT:NOREF)<br><br></div>But it seems like the `/` syntax automatically has CMake assuming that the flag is a file, and it complains it cannot find the file. Is there any way to have CMake recognize a passed-in linker flag using this syntax? As a side note, is there perhaps a better way of passing in Linker flags that I am not aware of? Documentation stated that using "target_link_libraries" is preferred, and I did not find "target_link_options".<br></div></blockquote><div><br>You can try this; I don't know if this is the preferred way to do it.<br><br>
set_property( TARGET
lib_<wbr>target
APPEND_STRING PROPERTY LINK_FLAGS "
/OPT:NOREF" )<br><div class="gmail_extra"><br></div>
Jano <br></div></div><br></div></div>