[Cmake] RE: suppressing warnings on bcc

Wheeler, Frederick W (Research) wheeler at crd.ge.com
Tue, 24 Feb 2004 10:44:33 -0500


Andy,

Thanks for the answer, but we are currently using
SET_SOURCE_FILES_PROPERTIES just as you suggest and having this problem with
the option order on the compile command line.  

I should not have even mentioned these following 3 lines.  They are a red
herring and make my last e-mail unclear.  All I was saying is that this
technique works fine elsewhere in VXL - it gets the option order right, but
it adds the option for all files.

> >   IF (BORLAND)
> >     SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-8004")
> >   ENDIF (BORLAND)

When Ian does the following, which is what you are suggesting (right?), the
warnings are not suppressed because of the compile command line option order
issue shown in my previous e-mail. (in the Makefile stanza part)

> IF (BORLAND)
>   IF (HAS_DCMTK)
>     # avoid warnings in dcmtk include files about variables that are
>     # assigned a value, but never used. We don't want to 
> maintain dcmtk
>     SET_SOURCE_FILES_PROPERTIES(file_formats/vil_dicom.cxx PROPERTIES
> COMPILE_FLAGS -w-8004)
>   ENDIF (HAS_DCMTK)
> ENDIF (BORLAND)

-Fred

> -----Original Message-----
> From: Andy Cedilnik [mailto:andy.cedilnik at kitware.com]
> Sent: Tuesday, February 24, 2004 10:37 AM
> To: Wheeler, Frederick W (Research)
> Cc: CMake List (E-mail); 'Ian Scott'
> Subject: Re: [Cmake] RE: suppressing warnings on bcc
> 
> 
> 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?
> 
>