I think you're looking exactly for this: <a href="http://www.vtk.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F">http://www.vtk.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F</a><div>
It's very good use-case, but I wonder why it's called MSVC-specific.<br><br><div class="gmail_quote">On Thu, Apr 28, 2011 at 7:23 PM, Tim Gallagher <span dir="ltr"><<a href="mailto:tim.gallagher@gatech.edu">tim.gallagher@gatech.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">We do this:<br>
<br>
if(NOT CMAKE_Fortran_FLAGS_RELEASE)<br>
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -xhost" CACHE STRING "" FORCE)<br>
endif()<br>
<br>
In other words, if the flags haven't been set yet (initial start up), set them to what we want. If they have been set (either changed by the user, or specified on the cmake/ccmake line with -D), leave them alone.<br>
<font color="#888888"><br>
Tim<br>
</font><div><div></div><div class="h5"><br>
----- Original Message -----<br>
From: "Ilja Golshtein" <<a href="mailto:ilejncs@narod.ru">ilejncs@narod.ru</a>><br>
To: <a href="mailto:cmake@cmake.org">cmake@cmake.org</a><br>
Sent: Thursday, April 28, 2011 9:03:43 AM<br>
Subject: [CMake] Change variable default<br>
<br>
Hello!<br>
<br>
There are some CMAKE variables with default values. For example CMAKE_CXX_FLAGS_DEBUG default value is '-g'.<br>
How is it possible to make it '-g -Wall'?<br>
<br>
What I don't want to have: User choice overwritten.<br>
<br>
What I want to have: Modified a variable cmake-time default. It must be possible to change the variable via cmake -D or ccmake GUI.<br>
<br>
Thanks.<br>
<br>
--<br>
Best regards,<br>
Ilja Golshtein.<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 <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: <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>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <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: <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>
</div></div></blockquote></div><br></div>