Exclude header from ITKHeaderTest

In a external module I have a header that is used conditionally bases on available libraries. But the ITKHeaderTest always includes the header. So the build of the header test can fail, when the option is not enabled.

Is there any way to exclude a specific header from the test? Or should I look into putting the header into a sub-directory of the include directory so that could be conditionally included with some CMake magic. I don’t see any example of this in the ITK source code, I’m kind of surprised.

There is a hard coded list of headers to ignore, but this could be extended to source a configuration file in the module.

Ahh, you are proposing something similar to what is done with the KWStyle test:

That seems like a good idea.

1 Like