<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">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 "/GA" )<br>
set_target_properties( ${tgt} COMPILE_FLAGS_RELEASE "/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 "/Libpath:xxx1"
)<br>
set_target_properties( ${tgt} LINK_FLAGS_RELEASE "/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ören Textor [Ditec-GmbH]":<br>
</div>
<blockquote cite="mid:51CA9340.4040104@ditec-gmbh.de" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix"><font color="#666666">okay, it seems
that there's a missunderstanding.<br>
<br>
The thing I want to do is this:</font><br>
<pre wrap="">add_target_properties( ${tgt} COMPILE_FLAGS_DEBUG "/GA" )
add_target_properties( ${tgt} COMPILE_FLAGS_RELEASE "/GB" )
add_target_properties( ${tgt} COMPILE_FLAGS_MYCONFIG1 "/GC" )
add_target_properties( ${tgt} COMPILE_FLAGS_MYCONFIG1 "/GD" )
like I do already:
add_target_properties( ${tgt} LINK_FLAGS_DEBUG "/Libpath:xxx1" )
add_target_properties( ${tgt} LINK_FLAGS_RELEASE "/Libpath:xxx2" )
add_target_properties( ${tgt} LINK_FLAGS_MYCONFIG1 "/Libpath:xxx3" )
add_target_properties( ${tgt} LINK_FLAGS_MYCONFIG1 "/Libpath:xxx4" )
The latter orks fine. Thus why it's not possible to obtain the same functionaltity for compile flags?
SirAnn
</pre>
<div class="moz-signature">
<p class="Stil1"><span class="Stil5"><font color="#666666">
protective rights.</font></span> </p>
</div>
Am 26.06.2013 00:39, schrieb Leek, Jim:<br>
</div>
<blockquote
cite="mid:6B554E87D42BA74AB76EC1D40C57A0DA4CE7220B@PRDEXMBX-04.the-lab.llnl.gov"
type="cite">
<pre wrap="">I was just messing around with this yesterday. On minGW I had to pass the link flag -static-libgcc to my binary. There were two ways to do this:
1) To add a flag to all link lines:
Shared Libraries:
SET (CMAKE_SHARED_LINKER_FLAGS "abc"
CACHE STRING "Flags used by the linker during the creation of dll's.")
module linker flags:
SET (CMAKE_MODULE_LINKER_FLAGS "abc"
CACHE STRING "Flags used by the linker during the creation of modules.")
binary linker flags:
SET (CMAKE_EXE_LINKER_FLAGS "abc"
CACHE STRING "Flags used by the linker during the creation of binaries.")
2) To add a flag to just a single target:
SET_TARGET_PROPERTIES( <target name>
PROPERTIES
LINK_FLAGS "abc")
If just used if statement to decide if how the link flags should be set. There may be a better way to do that.
To see how to do configuration based compile flags, see this page:
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.cmake.org/Wiki/CMake_Useful_Variables">http://www.cmake.org/Wiki/CMake_Useful_Variables</a>
I added a TESTING build type, and all I had to do was define these variables:
SET(CMAKE_CXX_FLAGS_TESTING "-mfpmath=sse -msse2")
SET(CMAKE_C_FLAGS_TESTING "-mfpmath=sse -msse2")
SET(CMAKE_Fortran_FLAGS_TESTING "-mfpmath=sse -msse2")
-----Original Message-----
From: <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:cmake-bounces@cmake.org">cmake-bounces@cmake.org</a> [<a moz-do-not-send="true" class="moz-txt-link-freetext" href="mailto:cmake-bounces@cmake.org">mailto:cmake-bounces@cmake.org</a>] On Behalf Of Miller Henry
Sent: Tuesday, June 25, 2013 8:41 AM
To: "Sören Textor [Ditec-GmbH]"; <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:cmake@cmake.org">cmake@cmake.org</a>
Subject: Re: [CMake] add_target_properties( tgt COMPILE_FLAGS_${CONF} "abc" )
TARGET_LINK_LIBRARIES(${tgt} stdc++)
Should do the trick
-----Original Message-----
From: <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:cmake-bounces@cmake.org">cmake-bounces@cmake.org</a> [<a moz-do-not-send="true" class="moz-txt-link-freetext" href="mailto:cmake-bounces@cmake.org">mailto:cmake-bounces@cmake.org</a>] On Behalf Of "Sören Textor [Ditec-GmbH]"
Sent: Tuesday, June 25, 2013 10:15 AM
To: <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:cmake@cmake.org">cmake@cmake.org</a>
Subject: [CMake] add_target_properties( tgt COMPILE_FLAGS_${CONF} "abc" )
Hello
Is it meanwhile possible to add configuration specfic compiler flags analouge to link flags?
add_target_properties( ${tgt} COMPILE_FLAGS_${CONF} "abc" )
add_target_properties( ${tgt} LINK_FLAGS_${CONF} "abc" )
Best regards
SirAnn
--
Powered by <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the CMake FAQ at: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a>
--
Powered by <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the CMake FAQ at: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a>
</pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">--
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the CMake FAQ at: <a class="moz-txt-link-freetext" href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a></pre>
</blockquote>
<br>
</body>
</html>