[CMake] How to compile as release with /MT /GS in cmake?

2010-10-12 Thread Mr Shore
I'm using cl.exe if that matters,thanks in advance!
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] How to compile as release with /MT /GS in cmake?

2010-10-12 Thread John Drescher
On Tue, Oct 12, 2010 at 8:06 AM, Mr Shore shore.cl...@gmail.com wrote:
 I'm using cl.exe if that matters,thanks in advance!


CMAKE_CXX_FLAGS_RELEASE is the variable you want.

I believe this will do what you want:

SET(CMAKE_CXX_FLAGS_RELEASE /MT /GS )

John
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How to compile as release with /MT /GS in cmake?

2010-10-12 Thread John Drescher
On Tue, Oct 12, 2010 at 8:58 AM, Mr Shore shore.cl...@gmail.com wrote:
 Hi John

 Can I restrict the scope so that this setting is only for one specific
 target?


If the targets are in their own subdirectory yes. Just set the
variable in the CMakeLists.txt file in that target after all
add_subdirectory lines so it does not pick up other projects.

If the targets are all in 1 CMakeLists.txt I am not sure how to do
that. I am not saying its not possible I just never had to look into
that since every project I create is in its own folder /
CMakeLists.txt file.

John
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How to compile as release with /MT /GS in cmake?

2010-10-12 Thread Daniel Franke
On Tuesday, October 12, 2010, John Drescher wrote:
 On Tue, Oct 12, 2010 at 8:58 AM, Mr Shore shore.cl...@gmail.com wrote:
  Can I restrict the scope so that this setting is only for one specific
  target?
 
 If the targets are all in 1 CMakeLists.txt I am not sure how to do
 that. I am not saying its not possible I just never had to look into
 that since every project I create is in its own folder /
 CMakeLists.txt file.

Try:
set_target_properties (target PROPERTIES
   COMPILE_FLAGS ... LINK_FLAGS ...)

where target is the name of your target, of course.

Cheers

Daniel
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake