[CMake] CMake consistency checker utility

Campbell Barton ideasman42 at gmail.com
Wed Jun 22 02:34:54 EDT 2011


Writing to the list since some of you may find a script useful that I
have been developing for a while now.
I'm using this script to help maintain source files for inkscape
~2000 files, and blender3d ~4000 files.

With large, portable projects is its hard to keep track of all files
on an active code-base where branches are merged and files move about,
generally as long as its building missing files pass unnoticed.
The problem with _not_ including some files is that an IDE will miss
headers when searching source files this gives trouble for refactoring
code and generally a nuisance.

So I wrote a script which checks all source files are accounted for,
it uses a weak kind of parsing but it has the advantage that source
files from all configurations are included.

It works by assuming that variables with suffix "_SRC" and "_INC" are
are source variables, and recognizes set(), and list(APPEND ...)
commands.

The script builds a list of all source files CMake knows about,
compares with all source files on disk, and warns on any mismatch,
files which are intentionally left out need to be added to an ignore
list.


The main script:
 https://svn.blender.org/svnroot/bf-blender/trunk/blender/build_files/cmake/cmake_consistency_check.py

Project Specific Configuration:
 https://svn.blender.org/svnroot/bf-blender/trunk/blender/build_files/cmake/cmake_consistency_check_config.py

-- 
- Campbell


More information about the CMake mailing list