[Cmake] file/project specific compile flags

Phil Pritchett p.pritchett at 2d3.com
Fri Oct 26 09:34:44 EDT 2001


> -----Original Message-----
> From: William A. Hoffman [mailto:bill.hoffman at kitware.com]
> Sent: Friday, October 26, 2001 2:03 PM
> To: Phil Pritchett
> Cc: Cmake Mailing List (E-mail); VXL Mailing List (E-mail)
> Subject: Re: [Cmake] file/project specific compile flags
> 

> 
> Right now you can not add flags per file, however, you can 
> add flags per 
> directory.
> You can use the SET command to override a cache value
> Put this in the list file for the one that needs O1:
> SET(CMAKE_CXX_FLAGS -O1)

This won't work for me as it is setting the optimisation for that project to
O1 in all build types whereas I need it set for a specific build type (which
won't have a corresponding CMAKE_CXX_FLAG_MYBUILD). I guess one solution
would be to create a new set of project files and alter the cache to get the
build options I need 
IF(MYWEIRDBUILD)
SET(CMAKE_CXX_FLAGS -01)
ENDIF(MYWEIRDBUILD)
where MYWEIRDBUILD gets defined (or not) in the cache.
I'd much rather use the build type to do this sort of thing though. 

Phil

This e-mail, and any attachment, is confidential. If you have received it in
error, please delete it from your system, do not use or disclose the
information in any way, and notify me immediately.



More information about the CMake mailing list