[CMake] Recent changes to CMake

Ken Martin ken.martin at kitware.com
Fri Jun 3 09:40:20 EDT 2005


Hi Folks,

I figured I should share some recent changes to CMake.  The new Unix
Makefile Generator (a derivative of Brad's last version) I have been working
on is now the default Makefile generator. I am still doing some minor
cleanup and performance tuning but I am hoping that the major changes are
done. I have added a help target and it now has object file rules in the
local directories. Once nice benefit of the new generator is that targets in
a parent directory can now depend on targets in the subdir and they will be
built correctly. There is no longer any need for the PREORDER option to the
SUBDIR command. This was the big holdup for creating CMake 2.2. Andy is
working on some more CTest improvements and better support for Dart2. We
hope to have a CMake 2.2 out in a few (3-6) weeks. There are a bunch of cool
changes in CMake 2.2 like XCode support etc. Some other recent changes worth
mentioning are:

1)  I am removing four old commands that have been deprecated since CMake
1.4 (CMake 1.2 was the last version they were officially in). They are
SOURCE_FILES, SOURCE_FILES_REMOVE, WRAP_EXCLUDE, and ABSTRACT_FILES.

2)  I have changed VARIABLE_REQUIRES to happen immediately instead of at the
end of the configure sstep. So the requirements will be analyzed right where
the VARIABLE_REQUIRES command is and the resuting variable will be set then
as well.

3) I have added an ADD_SUBDIRECTORY command that should be used instead of
SUBDIRS (SUBDIRS is still there and not deprecated). ADD_SUBDIRECTORY
happens immediately and the subdirectory is processed right there. This
allows you to process a subdirectory and then continue doing things in the
parent directory (possibly using cache values or configured files from the
subdir) To achieve the same behavior as SUBDIRS just put your
ADD_SUBDIRECTORY commands at the end of your CMakeLists.txt file. This
command also supports subdirectories that are full paths and not in the
source directory. In the binary tree it will show up as a subdirectory. This
should help projects leverage other source code libraries that are not in
the same source tree.

4) Change CONFIGURE_FILE to be immediate.  In CMake 2.0 and earlier
CONFIGURE_FILE defaulted to configuring in the final pass (when all the
initial processing has been completed). It had an IMMEDIATE option that
could be used to make it configure the file immediately. In CMake 2.2 I'd
like to make CONFIGURE_FILE always be IMMEDIATE. If you set
CMAKE_BACKWARDS_COMPATIBILITY to 2.0 or earlier it will still work the old
way. The motivation for this is that people expect CONFIGURE_FILE (and most
all commands) to happen immediately. For example, people expect the
following code to work:

FOREACH (FOO 1 2 3)
  CONFIGURE_FILE (Test${FOO})
ENDFOREACH(FOO)

But because of CONFIGURE_FILE's delayed behavior it actually will only
configure the last file Test3. Because that is the value that FOO is at when
processing the CMakeLists file is complete. Any opinions on this change?

5) There has been some great work by Jorgen Bodde on a new wxWindows based
GUI for CMake that looks really good. Maybe he'll post an update or a
picture.

Thanks
Ken





More information about the CMake mailing list