<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">problem is that config specific
      propierties like<br>
      <br>
      COMPILE_FLAGS_DEBUG<br>
      <br>
      still seems not to be evaluated.<br>
      <br>
      Instead of specific link propierties!<br>
      <br>
      Am 26.06.2013 13:41, schrieb Leek, Jim:<br>
    </div>
    <blockquote
cite="mid:6B554E87D42BA74AB76EC1D40C57A0DA4CE72A11@PRDEXMBX-04.the-lab.llnl.gov"
      type="cite">
      <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]-->
      <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; "/GA" )<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">
                <a class="moz-txt-link-abbreviated" href="mailto:cmake-bounces@cmake.org">cmake-bounces@cmake.org</a> [<a class="moz-txt-link-freetext" href="mailto:cmake-bounces@cmake.org">mailto:cmake-bounces@cmake.org</a>]
                <b>On Behalf Of </b>"S&ouml;ren Textor [Ditec-GmbH]"<br>
                <b>Sent:</b> Wednesday, June 26, 2013 12:28 AM<br>
                <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:cmake@cmake.org">cmake@cmake.org</a><br>
                <b>Subject:</b> Re: [CMake] add_target_properties( tgt
                COMPILE_FLAGS_${CONF} "abc" )<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; "/GA"
            )<br>
            set_target_properties( ${tgt} COMPILE_FLAGS_RELEASE&nbsp;&nbsp; "/GB"
            )<br>
            set_target_properties( ${tgt} COMPILE_FLAGS_MYCONFIG1 "/GC"
            )<br>
            set_target_properties( ${tgt} COMPILE_FLAGS_MYCONFIG1 "/GD"
            )<br>
            <br>
            And this is what already works:<br>
            set_target_properties( ${tgt} LINK_FLAGS_DEBUG&nbsp;&nbsp;&nbsp;&nbsp;
            "/Libpath:xxx1" )<br>
            set_target_properties( ${tgt} LINK_FLAGS_RELEASE&nbsp;&nbsp;
            "/Libpath:xxx2" )<br>
            set_target_properties( ${tgt} LINK_FLAGS_MYCONFIG1
            "/Libpath:xxx3" )<br>
            set_target_properties( ${tgt} LINK_FLAGS_MYCONFIG1
            "/Libpath:xxx4" )<br>
            <br>
            <br>
            <br>
            <br>
            <br>
            Am 26.06.2013 09:07, schrieb "S&ouml;ren Textor [Ditec-GmbH]":<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; "/GA" )<o:p></o:p></pre>
            <pre>add_target_properties( ${tgt} COMPILE_FLAGS_RELEASE&nbsp;&nbsp; "/GB" )<o:p></o:p></pre>
            <pre>add_target_properties( ${tgt} COMPILE_FLAGS_MYCONFIG1 "/GC" )<o:p></o:p></pre>
            <pre>add_target_properties( ${tgt} COMPILE_FLAGS_MYCONFIG1 "/GD" )<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; "/Libpath:xxx1" )<o:p></o:p></pre>
            <pre>add_target_properties( ${tgt} LINK_FLAGS_RELEASE&nbsp;&nbsp; "/Libpath:xxx2" )<o:p></o:p></pre>
            <pre>add_target_properties( ${tgt} LINK_FLAGS_MYCONFIG1 "/Libpath:xxx3" )<o:p></o:p></pre>
            <pre>add_target_properties( ${tgt} LINK_FLAGS_MYCONFIG1 "/Libpath:xxx4" )<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; "abc"<o:p></o:p></pre>
            <pre>&nbsp;&nbsp;&nbsp;&nbsp; CACHE STRING "Flags used by the linker during the creation of dll's.")<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 "abc"<o:p></o:p></pre>
            <pre>&nbsp;&nbsp;&nbsp;&nbsp; CACHE STRING "Flags used by the linker during the creation of modules.")<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 "abc"<o:p></o:p></pre>
            <pre>&nbsp;&nbsp;&nbsp;&nbsp; CACHE STRING "Flags used by the linker during the creation of binaries.")<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 "abc")<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 moz-do-not-send="true" 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 "-mfpmath=sse -msse2")<o:p></o:p></pre>
            <pre>SET(CMAKE_C_FLAGS_TESTING "-mfpmath=sse -msse2")<o:p></o:p></pre>
            <pre>SET(CMAKE_Fortran_FLAGS_TESTING "-mfpmath=sse -msse2")<o:p></o:p></pre>
            <pre><o:p>&nbsp;</o:p></pre>
            <pre>-----Original Message-----<o:p></o:p></pre>
            <pre>From: <a moz-do-not-send="true" href="mailto:cmake-bounces@cmake.org">cmake-bounces@cmake.org</a> [<a moz-do-not-send="true" 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: "S&ouml;ren Textor [Ditec-GmbH]"; <a moz-do-not-send="true" 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} "abc" )<o:p></o:p></pre>
            <pre><o:p>&nbsp;</o:p></pre>
            <pre>TARGET_LINK_LIBRARIES(${tgt} stdc++)<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 moz-do-not-send="true" href="mailto:cmake-bounces@cmake.org">cmake-bounces@cmake.org</a> [<a moz-do-not-send="true" href="mailto:cmake-bounces@cmake.org">mailto:cmake-bounces@cmake.org</a>] On Behalf Of "S&ouml;ren Textor [Ditec-GmbH]"<o:p></o:p></pre>
            <pre>Sent: Tuesday, June 25, 2013 10:15 AM<o:p></o:p></pre>
            <pre>To: <a moz-do-not-send="true" href="mailto:cmake@cmake.org">cmake@cmake.org</a><o:p></o:p></pre>
            <pre>Subject: [CMake] add_target_properties( tgt COMPILE_FLAGS_${CONF} "abc" )<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} "abc" )<o:p></o:p></pre>
            <pre><o:p>&nbsp;</o:p></pre>
            <pre>add_target_properties( ${tgt} LINK_FLAGS_${CONF} "abc" )<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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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>
    </blockquote>
    <br>
  </body>
</html>