<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"><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 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 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>] On Behalf Of Miller Henry
Sent: Tuesday, June 25, 2013 8:41 AM
To: "Sören Textor [Ditec-GmbH]"; <a 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 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>] On Behalf Of "Sören Textor [Ditec-GmbH]"
Sent: Tuesday, June 25, 2013 10:15 AM
To: <a 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 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>
--
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>