[Cmake] Many changes (including removal of SOURCE_FILES_FLAGS command)

Bill Hoffman bill.hoffman at kitware.com
Fri Mar 29 14:40:32 EST 2002


In preparation for the next cmake release, I have made several changes.

1. I removed the command SOURCE_FILES_FLAGS.
  It has been replaced by:
  SET_SOURCE_FILES_PROPERTIES(flags file1 file2 [ABSTRACT|WRAP_EXCLUDE|GENERATED|FLAGS] [flags])

  -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.
 
  For example you could do this:
  SET_SOURCE_FILE_PROPERTIES(vtkObject.cxx COMPILE_FLAGS "-ffast -O4")

  The SOURCE_FILES_FLAGS was never in an official release of cmake, so I just removed it.
  If your project is using it, please change to SET_SOURCE_FILES_PROPERTIES.

2. I have changed the SET command so that it can create semi-colon lists.
   SET(VAR a b c d) now results in VAR=a;b;c;d

3. I have expanded semi-colon lists in all commands that take a variable number
   of arguments.   

4. I reworked the internals of cmMakefile so that it contains a single 
  vector of cmSourceFile objects.   The first time a source file is referenced it is
  created.  This allows command sequences like this to work:

  SET_SOURCE_FILES_PROPERTIES(complex COMPILE_FLAGS "-DSET_SOURCE_FILES_PROPERTIES") 
  ADD_EXECUTABLE(complex complex)


  This also means that the SOURCE_FILES command could be deprecated, and replaced by SET.
  Since many projects use the SOURCE_FILES command, I expect it will not be going away
  any time soon.  However, new projects may want to use the new syntax:


# create a ; separated cmake list in the var Common_SRCS
SET(Common_SRCS
  vtkObject.cxx
  vtkCollection.cxx
)

# for WIN32 append a new  source to the variable
IF(WIN32)
  SET(Common_SRCS ${Common_SRCS};vtkWin32OutputWindow.cxx)
ENDIF(WIN32)

# set the abstract and wrap exclude flags on vtkCollection.cxx
SET_SOURCE_FILE_PROPERTIES(vtkCollection.cxx ABSTRACT WRAP_EXCLUDE)
# set the abstract flag, and the file specific compile flag 
SET_SOURCE_FILE_PROPERTIES(vtkObject.cxx ABSTRACT FLAGS "-g -bogo" )


ADD_EXECUTABLE(CommonTest ${Common_SRCS})


-Bill




More information about the CMake mailing list