<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Malgun Gothic";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"\@Malgun Gothic";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
p.stil1, li.stil1, div.stil1
        {mso-style-name:stil1;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
span.stil5
        {mso-style-name:stil5;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
.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><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Sorry, I don&#8217;t have a nice clean answer like that for you.&nbsp; I&#8217;m too new at cmake I guess.&nbsp; I would just fall back on if statements.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">If(CMAKE_BUILD_TYPE MATCHES Debug)<o:p></o:p></span></p>
<p class="MsoNormal">&nbsp; set_target_properties( ${tgt} COMPILE_FLAGS_DEBUG&nbsp;&nbsp;&nbsp;&nbsp; &quot;/GA&quot; )<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">elseif(CMAKE_BUILD_TYPE MATCHES Release)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&#8230;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">endif()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext"> cmake-bounces@cmake.org [mailto:cmake-bounces@cmake.org]
<b>On Behalf Of </b>&quot;Sören Textor [Ditec-GmbH]&quot;<br>
<b>Sent:</b> Wednesday, June 26, 2013 12:28 AM<br>
<b>To:</b> cmake@cmake.org<br>
<b>Subject:</b> Re: [CMake] add_target_properties( tgt COMPILE_FLAGS_${CONF} &quot;abc&quot; )<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal">sorry my fault. <br>
<br>
add_target_properties is a helper macro that I wrote.<br>
<br>
Finally this is what I need:<br>
set_target_properties( ${tgt} COMPILE_FLAGS_DEBUG&nbsp;&nbsp;&nbsp;&nbsp; &quot;/GA&quot; )<br>
set_target_properties( ${tgt} COMPILE_FLAGS_RELEASE&nbsp;&nbsp; &quot;/GB&quot; )<br>
set_target_properties( ${tgt} COMPILE_FLAGS_MYCONFIG1 &quot;/GC&quot; )<br>
set_target_properties( ${tgt} COMPILE_FLAGS_MYCONFIG1 &quot;/GD&quot; )<br>
<br>
And this is what already works:<br>
set_target_properties( ${tgt} LINK_FLAGS_DEBUG&nbsp;&nbsp;&nbsp;&nbsp; &quot;/Libpath:xxx1&quot; )<br>
set_target_properties( ${tgt} LINK_FLAGS_RELEASE&nbsp;&nbsp; &quot;/Libpath:xxx2&quot; )<br>
set_target_properties( ${tgt} LINK_FLAGS_MYCONFIG1 &quot;/Libpath:xxx3&quot; )<br>
set_target_properties( ${tgt} LINK_FLAGS_MYCONFIG1 &quot;/Libpath:xxx4&quot; )<br>
<br>
<br>
<br>
<br>
<br>
Am 26.06.2013 09:07, schrieb &quot;Sören Textor [Ditec-GmbH]&quot;:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"><span style="color:#666666">okay, it seems that there's a missunderstanding.<br>
<br>
The thing I want to do is this:</span><br>
<br>
<o:p></o:p></p>
<pre>add_target_properties( ${tgt} COMPILE_FLAGS_DEBUG&nbsp;&nbsp;&nbsp;&nbsp; &quot;/GA&quot; )<o:p></o:p></pre>
<pre>add_target_properties( ${tgt} COMPILE_FLAGS_RELEASE&nbsp;&nbsp; &quot;/GB&quot; )<o:p></o:p></pre>
<pre>add_target_properties( ${tgt} COMPILE_FLAGS_MYCONFIG1 &quot;/GC&quot; )<o:p></o:p></pre>
<pre>add_target_properties( ${tgt} COMPILE_FLAGS_MYCONFIG1 &quot;/GD&quot; )<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>like I do already:<o:p></o:p></pre>
<pre>add_target_properties( ${tgt} LINK_FLAGS_DEBUG&nbsp;&nbsp;&nbsp;&nbsp; &quot;/Libpath:xxx1&quot; )<o:p></o:p></pre>
<pre>add_target_properties( ${tgt} LINK_FLAGS_RELEASE&nbsp;&nbsp; &quot;/Libpath:xxx2&quot; )<o:p></o:p></pre>
<pre>add_target_properties( ${tgt} LINK_FLAGS_MYCONFIG1 &quot;/Libpath:xxx3&quot; )<o:p></o:p></pre>
<pre>add_target_properties( ${tgt} LINK_FLAGS_MYCONFIG1 &quot;/Libpath:xxx4&quot; )<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>The latter orks fine. Thus why it's not possible to obtain the same functionaltity for compile flags?<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>SirAnn<o:p></o:p></pre>
<div>
<p class="stil1"><span class="stil5"><span style="color:#666666">protective rights.</span></span>
<o:p></o:p></p>
</div>
<p class="MsoNormal">Am 26.06.2013 00:39, schrieb Leek, Jim:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>I was just messing around with this yesterday.&nbsp; On minGW I had to pass the link flag&nbsp; -static-libgcc to my binary.&nbsp; There were two ways to do this:<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>1) To add a flag to all link lines:<o:p></o:p></pre>
<pre>Shared Libraries:<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>SET (CMAKE_SHARED_LINKER_FLAGS&nbsp; &quot;abc&quot;<o:p></o:p></pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp; CACHE STRING &quot;Flags used by the linker during the creation of dll's.&quot;)<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>module linker flags:<o:p></o:p></pre>
<pre>SET (CMAKE_MODULE_LINKER_FLAGS &quot;abc&quot;<o:p></o:p></pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp; CACHE STRING &quot;Flags used by the linker during the creation of modules.&quot;)<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>binary linker flags:<o:p></o:p></pre>
<pre>SET (CMAKE_EXE_LINKER_FLAGS &quot;abc&quot;<o:p></o:p></pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp; CACHE STRING &quot;Flags used by the linker during the creation of binaries.&quot;)<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>2) To add a flag to just a single target:<o:p></o:p></pre>
<pre>SET_TARGET_PROPERTIES( &lt;target name&gt;<o:p></o:p></pre>
<pre>&nbsp; PROPERTIES <o:p></o:p></pre>
<pre>&nbsp;&nbsp;LINK_FLAGS &quot;abc&quot;)<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>If just used if statement to decide if how the link flags should be set.&nbsp; There may be a better way to do that.&nbsp; <o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>To see how to do configuration based compile flags, see this page:<o:p></o:p></pre>
<pre><a href="http://www.cmake.org/Wiki/CMake_Useful_Variables">http://www.cmake.org/Wiki/CMake_Useful_Variables</a><o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>I added a TESTING build type, and all I had to do was define these variables:<o:p></o:p></pre>
<pre>SET(CMAKE_CXX_FLAGS_TESTING &quot;-mfpmath=sse -msse2&quot;)<o:p></o:p></pre>
<pre>SET(CMAKE_C_FLAGS_TESTING &quot;-mfpmath=sse -msse2&quot;)<o:p></o:p></pre>
<pre>SET(CMAKE_Fortran_FLAGS_TESTING &quot;-mfpmath=sse -msse2&quot;)<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>-----Original Message-----<o:p></o:p></pre>
<pre>From: <a href="mailto:cmake-bounces@cmake.org">cmake-bounces@cmake.org</a> [<a href="mailto:cmake-bounces@cmake.org">mailto:cmake-bounces@cmake.org</a>] On Behalf Of Miller Henry<o:p></o:p></pre>
<pre>Sent: Tuesday, June 25, 2013 8:41 AM<o:p></o:p></pre>
<pre>To: &quot;Sören Textor [Ditec-GmbH]&quot;; <a href="mailto:cmake@cmake.org">cmake@cmake.org</a><o:p></o:p></pre>
<pre>Subject: Re: [CMake] add_target_properties( tgt COMPILE_FLAGS_${CONF} &quot;abc&quot; )<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>TARGET_LINK_LIBRARIES(${tgt} stdc&#43;&#43;)<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Should do the trick<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>-----Original Message-----<o:p></o:p></pre>
<pre>From: <a href="mailto:cmake-bounces@cmake.org">cmake-bounces@cmake.org</a> [<a href="mailto:cmake-bounces@cmake.org">mailto:cmake-bounces@cmake.org</a>] On Behalf Of &quot;Sören Textor [Ditec-GmbH]&quot;<o:p></o:p></pre>
<pre>Sent: Tuesday, June 25, 2013 10:15 AM<o:p></o:p></pre>
<pre>To: <a href="mailto:cmake@cmake.org">cmake@cmake.org</a><o:p></o:p></pre>
<pre>Subject: [CMake] add_target_properties( tgt COMPILE_FLAGS_${CONF} &quot;abc&quot; )<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Hello<o:p></o:p></pre>
<pre>Is it meanwhile possible to add configuration specfic compiler flags analouge to link flags?<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>add_target_properties( ${tgt} COMPILE_FLAGS_${CONF} &quot;abc&quot; )<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>add_target_properties( ${tgt} LINK_FLAGS_${CONF} &quot;abc&quot; )<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Best regards<o:p></o:p></pre>
<pre>SirAnn<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>--<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Powered by <a href="http://www.kitware.com">www.kitware.com</a><o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a><o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Follow this link to subscribe/unsubscribe:<o:p></o:p></pre>
<pre><a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a><o:p></o:p></pre>
<pre>--<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Powered by <a href="http://www.kitware.com">www.kitware.com</a><o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a><o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Follow this link to subscribe/unsubscribe:<o:p></o:p></pre>
<pre><a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><br>
<br>
<br>
<br>
<o:p></o:p></p>
<pre>--<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Powered by <a href="http://www.kitware.com">www.kitware.com</a><o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a><o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Follow this link to subscribe/unsubscribe:<o:p></o:p></pre>
<pre><a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>