<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Visual Studio's linker (and compiler, for that matter) also accept flags that start with dashes instead of slashes (e.g. you can do -opt:noref instead of /opt:noref).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">CMake <cmake-bounces@cmake.org> on behalf of ThePhD <jm3689@columbia.edu><br>
<b>Date: </b>Tuesday, February 13, 2018 at 1:10 PM<br>
<b>To: </b>"cmake@cmake.org" <cmake@cmake.org><br>
<b>Subject: </b>Re: [CMake] Visual C++ Compile/Link Flags<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:.5in">
Thank you, Jano Svitok and Volker Enderlein.<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-left:.5in">     I settled for using "set_target_properties( ... )", and to specify multiple LINK_FLAGS I encapsulated both arguments I wanted to pass in a single set of quotes (with a space between them). I suppose the APPEND_STRING
 approach could also work well, if I wanted to add multiple.<br>
<br>
I appreciate the help!<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in">On Tue, Feb 13, 2018 at 9:11 AM, Volker Enderlein <<a href="mailto:volker.enderlein@ifm-chemnitz.de" target="_blank">volker.enderlein@ifm-chemnitz.de</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="margin-left:.5in"><br>
set_target_properties(target PROPERTIES LINK_FLAGS "/OPT:NOREF") should work. <o:p>
</o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><br>
<br>
Am 13/02/2018 um 14:38 schrieb ThePhD:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:.5in">
I have a project where I attempt to add linker flags to a Visual Studio project using<br>
<br>
     target_link_libraries(lib_target PRIVATE /OPT:NOREF)<br>
<br>
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".<o:p></o:p></p>
</blockquote>
</div>
</div>
<p class="MsoNormal" style="margin-left:.5in">-- <br>
<br>
-- <br>
<br>
Powered by <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TuF6_dXoirMgs8pxfwOLK76T87AEraphOyvzaCdHZDA&s=H8XZFlDlKPXDJs6Txl7iKXVMfqMldGD1SOfjhCgMNyc&e=" target="_blank">
www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cmake.org_Wiki_CMake-5FFAQ&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TuF6_dXoirMgs8pxfwOLK76T87AEraphOyvzaCdHZDA&s=V3vhi-FAUPQb9zCOzs1Swgy5y6eYcLq5cbmbZYqiwTM&e=" 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="https://urldefense.proofpoint.com/v2/url?u=http-3A__cmake.org_cmake_help_support.html&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TuF6_dXoirMgs8pxfwOLK76T87AEraphOyvzaCdHZDA&s=EyOfGRsbaZJy5-cWrLYXm1PHaZFXQndTGdI1LHiETMc&e=" target="_blank">
http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__cmake.org_cmake_help_consulting.html&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TuF6_dXoirMgs8pxfwOLK76T87AEraphOyvzaCdHZDA&s=gRunwWAHwI2E_hwYQuKRN9zyZc24IcA19T6gjJsv9ck&e=" target="_blank">
http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__cmake.org_cmake_help_training.html&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TuF6_dXoirMgs8pxfwOLK76T87AEraphOyvzaCdHZDA&s=BnZouoLQlKBiCjmNJXqVDrGqG0J54OFJJc6ldsN1rBY&e=" target="_blank">
http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_opensource_opensource.html&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TuF6_dXoirMgs8pxfwOLK76T87AEraphOyvzaCdHZDA&s=SM1OvUqw0STN8RIdtrtd6NPzl-ct4kDSVpCqvL_aXAM&e=" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__cmake.org_mailman_listinfo_cmake&d=DwMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TuF6_dXoirMgs8pxfwOLK76T87AEraphOyvzaCdHZDA&s=s1Qwtnjz3QEPaTSNIgF2f2q1AopU7YrCX0MmXaP5X0Q&e=" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
</div>
</body>
</html>