[CMake] Set different compilation flags for specific file

Rob Mathews Rob.Mathews at varolii.com
Tue Jun 12 13:54:04 EDT 2007


Put it in that one file like this: 

SET(CMAKE_CXX_FLAGS_RELEASE_SAVED ${CMAKE_CXX_FLAGS_RELEASE}  )
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )
.. add the library or target
SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_SAVED}  )

-----Original Message-----
From: James Bigler [mailto:bigler at cs.utah.edu] 
Sent: Tuesday, June 12, 2007 1:38 PM
To: Rob Mathews
Cc: cmake at cmake.org
Subject: Re: [CMake] Set different compilation flags for specific file

Wouldn't that set it for all the source files in the project?  I just
want to 
override 1 file amongst many others.

Rob Mathews wrote:
> Why wouldn't you simply do this:
> 
> SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Ox /Ob1 /DNDEBUG"  )
> 
> (or whatever your particular flags are)
> ? 
> 
> 
> -----Original Message-----
> From: cmake-bounces+rmathews=envoyww.com at cmake.org
> [mailto:cmake-bounces+rmathews=envoyww.com at cmake.org] On Behalf Of
James
> Bigler
> Sent: Tuesday, June 12, 2007 1:14 PM
> To: cmake at cmake.org
> Subject: [CMake] Set different compilation flags for specific file
> 
> I have a file that doesn't compile properly with certain optimization
> flags that 
> I wish to use on the rest of my system.  I poked around the wiki and
the
> help 
> file, but I can't find any information on how to do this.
> 
> According to the documentation SET_SOURCE_FILES_PROPERTIES
COMPILE_FLAGS
> only 
> appends new flags.  I want to override the values in CMAKE_CXX_FLAGS
and
> 
> CMAKE_CXX_FLAGS_RELEASE.
> 
> Thanks,
> James
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
> 
> 




More information about the CMake mailing list