#1558 Headercheck in cmake
Metadata
Property | Value |
---|---|
Reported by | Tobias Malkmus (tomalk@mathematik.uni-freiburg.de) |
Reported at | Jan 30, 2015 11:48 |
Type | Feature Request |
Version | 2.3 |
Operating System | Unspecified / All |
Description
Hi 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:
- type
make headercheck
in 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 ) orcmake -P build-dir/headercheck.cmake
( for all headerfiles, the same asmake headercheck
) - on UNIX systems a convenience bash script
build-dir/headercheck.sh
is 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.