[Cmake] RE: suppressing warnings on bcc

Andy Cedilnik andy.cedilnik at kitware.com
Tue, 24 Feb 2004 10:36:31 -0500


Hi Fred,

cmake --help SET_SOURCE_FILES_PROPERTIES

  SET_SOURCE_FILES_PROPERTIES
       Source files can have properties that affect how they are built.

         SET_SOURCE_FILES_PROPERTIES(file1 file2 ...
                                     PROPERTIES prop1 value1
                                     prop2 value2 ...)

       Set properties on a file.  The syntax for the command is to list
all
       the files you want to change, and then provide the values you
want to
       set next.  You can make up your own properties as well.  The
following
       are used by CMake.  The ABSTRACT flag (boolean) appears to have
some
       effect on the VTK wrapper commands.  If WRAP_EXCLUDE (boolean) is
true
       then the wrapping commands (FLTKWrapUI, QTWrapCC, QTWrapUI,
       VTKMakeInstantiator, VTKWrapJava, VTKWrapPython, and VTKWrapTcl)
will
       ignore this file.  If GENERATED (boolean) is true then it is not
an
       error if this source file does not exist when it is added to a
target.
       Obviously, it must be created (presumably by a custom command)
before
       the target is built.  If the HEADER_FILE_ONLY (boolean) property
is
       true then dependency information is not created for that file
(this is
       set automatically, based on the file's name's extension and is
       probably only used by Makefiles).  OBJECT_DEPENDS (string) adds
       dependencies to the object file.  COMPILE_FLAGS (string) is
passed to
       the compiler as additional command line arguments when the source
file
       is compiled.


so,

SET_SOURCE_FILES_PROPERTIES(${some_files} 
  PROPERTIES
  COMPILE_FLAGS -w-8004)

Sounds good?

				Andy


On Tue, 2004-02-24 at 10:29, Wheeler, Frederick W (Research) wrote:
> CMake List:
> 
> In VXL we're having a small problem turning off certain Borland warnings for
> a certain file.  You can see below how Ian added the -w-8004 option for the
> file file_formats/vil_dicom.cxx.  This had no effect.  The reason seems to
> be the command line option order.
> 
> The CMake generated Makefile stanza for this file is below.  You'll see the
> -w-8004 option twice --- I added in the 2nd one by hand.  When I add in the
> 2nd one, right after the -waus option that was already present, the warnings
> are suppressed as desired.
> 
> There are other places in VXL where we suppress Borland warnings using this
> mechanism, which works fine:
>   IF (BORLAND)
>     SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-8004")
>   ENDIF (BORLAND)
> 
> Any suggestions?  Is there a way to get SET_SOURCE_FILES_PROPERTIES to add a
> compiler option more toward the end of the command line?