[Cmake] RE: suppressing warnings on bcc

Andy Cedilnik andy.cedilnik at kitware.com
Tue, 24 Feb 2004 11:25:30 -0500


Hi Fred,

Changing compiler flags is dangerous and platform dependent anyway. The
CMAKE_C_FLAGS and CMAKE_CXX_FLAGS are user defined. They may have
default values, but user should be able to overwrite. To play it safe,
you could always do something like:

SET(myflags -foo ${CMAKE_C_FLAGS} -bar)
STRING(REGEX REPLACE "-Wall" "-Wroof" myflags ${myflags})
SET_SOURCE_FILES_PROPERTIES(${files} 
  PROPERTIES COMPILE_FLAGS_OVERWRITE ${myflags})

			Andy

On Tue, 2004-02-24 at 11:15, Wheeler, Frederick W (Research) wrote:
> It seems to me that something like COMPILE_POST_FLAGS would work nicely in
> this situation.  If that were implemented, COMPILE_FLAGS could become a
> synonym for COMPILE_PRE_FLAGS.
> 
> COMPILE_FLAGS_OVERWRITE seems dangerous to me.  Personally I would avoid it
> because it seems that CMake adds a lot of options that are required and that
> I would not want to mess with.