Here is my final code, this seems to work for both DLL and EXE targets:<div><br></div><div><div>string( REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}" )</div>
<div>string( REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}" )</div><div>string( REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}" )</div>
<div><br></div><div>Thanks for the super quick help David!</div><br><div class="gmail_quote">On Wed, Jun 27, 2012 at 2:38 PM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yeah certainly, especially since multicore is pretty much everywhere now and most applications are designed with parallelization in mind.<div>
<br></div><div>Like every other compiler and linker flag out there, have the user manually set that up if they want it. CMake doesn't automatically add any other compiler flags for me, so /STACK shouldn't be any different IMHO.</div>
<div><br></div><div>Thanks for your help, I will try using those new global variables.<div><div class="h5"><br><br><div class="gmail_quote">On Wed, Jun 27, 2012 at 2:35 PM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ah. I just read through Windows-cl.cmake again to refresh my memory....<br>
<br>
Also do the same thing with these two variables:<br>
CMAKE_SHARED_LINKER_FLAGS for SHARED dll targets, and<br>
CMAKE_MODULE_LINKER_FLAGS for MODULE dll targets. That should take<br>
care of it.<br>
<br>
Whew. Maybe we should just remove it from CMake one of these days.<br>
Seems like a bit of an excessive stack size to have by default,<br>
doesn't it? :-)<br>
<span><font color="#888888"><br>
<br>
David<br>
</font></span><div><div><br>
<br>
On Wed, Jun 27, 2012 at 3:27 PM, Robert Dailey <<a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@gmail.com</a>> wrote:<br>
> I just tried your code and unfortunately /STACK still shows up for DLL<br>
> targets, although for EXE targets it seems to be gone.<br>
><br>
><br>
> On Wed, Jun 27, 2012 at 2:24 PM, David Cole <<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>> wrote:<br>
>><br>
>> Try my code, and tell us if it removes the generated /STACK from all<br>
>> your linker calls or not...<br>
>><br>
>> Thx,<br>
>> David<br>
>><br>
>> On Wed, Jun 27, 2012 at 3:22 PM, Robert Dailey <<a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@gmail.com</a>><br>
>> wrote:<br>
>> > Apparently this won't work... /STACK doesn't show up in any of the<br>
>> > compile<br>
>> > flags retrieved this way. However, CMAKE_EXE_COMPILER_FLAGS doesn't<br>
>> > apply to<br>
>> > library targets, right?<br>
>> ><br>
>> ><br>
>> > On Wed, Jun 27, 2012 at 2:19 PM, Robert Dailey<br>
>> > <<a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> This flag is appended to DLL targets too, so I created this (i haven't<br>
>> >> tested it yet though):<br>
>> >><br>
>> >> function( _remove_stack_flag target_name )<br>
>> >> get_property( flags TARGET ${target_name} PROPERTY COMPILE_FLAGS )<br>
>> >> string( REGEX REPLACE "/STACK:[0-9]+" "" flags ${flags} )<br>
>> >> set_property( TARGET ${target_name} PROPERTY COMPILE_FLAGS ${flags} )<br>
>> >> endfunction()<br>
>> >><br>
>> >> I call this once for each target I define.<br>
>> >><br>
>> >><br>
>> >> On Wed, Jun 27, 2012 at 2:17 PM, David Cole <<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>><br>
>> >> wrote:<br>
>> >>><br>
>> >>> You could do:<br>
>> >>><br>
>> >>> string(REPLACE "/STACK:10000000 " "" CMAKE_EXE_LINKER_FLAGS<br>
>> >>> "${CMAKE_EXE_LINKER_FLAGS}")<br>
>> >>><br>
>> >>> after the first project command in the top level CMakeLists file. (Or<br>
>> >>> "/STACK:some other number" to change it, instead of the empty string<br>
>> >>> to just remove it...)<br>
>> >>><br>
>> >>> The /STACK string only appears in the two files:<br>
>> >>><br>
>> >>> Modules/Platform/Windows-Intel.cmake<br>
>> >>> Modules/Platform/Windows-cl.cmake<br>
>> >>><br>
>> >>><br>
>> >>> HTH,<br>
>> >>> David<br>
>> >>><br>
>> >>><br>
>> >>> On Wed, Jun 27, 2012 at 3:11 PM, Robert Dailey<br>
>> >>> <<a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@gmail.com</a>><br>
>> >>> wrote:<br>
>> >>> > This is added to every generated visual studio project from version<br>
>> >>> > 7.1<br>
>> >>> > to<br>
>> >>> > 9. How can I tell CMake not to modify the stack size?<br>
>> >>> > --<br>
>> >>> ><br>
>> >>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> >>> ><br>
>> >>> > Visit other Kitware open-source projects at<br>
>> >>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> >>> ><br>
>> >>> > Please keep messages on-topic and check the CMake FAQ at:<br>
>> >>> > <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>> >>> ><br>
>> >>> > Follow this link to subscribe/unsubscribe:<br>
>> >>> > <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
>> >><br>
>> >><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>