#1558 Headercheck in cmake
|Reported by||Tobias Malkmus (firstname.lastname@example.org)|
|Reported at||Jan 30, 2015 11:48|
|Operating System||Unspecified / All|
In the last days I switched from autotools to cmake.
One feature which I used very often in the past is the headercheck
make headercheck HEADER=... to test first versions of my code.
AFAIK the current headercheck is not able to mimic this, please correct me if I'm wrong.
I wrote a small cmake script which mimics this autotool's properties, see the attached patch.
With this script you can check your headers, whether they compile or not, in 3 different ways:
make headercheckin the build directory to check all headers within the module.
- use cmake to invoke the headercheck.cmake script in the source directory via:
cmake -D HEADER=file.hh -P build-dir/headercheck.cmake( for a single file ) or
cmake -P build-dir/headercheck.cmake( for all headerfiles, the same as
- on UNIX systems a convenience bash script
build-dir/headercheck.shis created which encapsulates the call to cmake. It can be called from the source directory in both ways: checking for a single header (
./headercheck.sh file.hh) or all in one if no argument is given.
During the headercheck a temporary source file including the header 'hctest.cc' is generated within the build directory.