[CMake] ADD_COMPILE_TEST macro

Bill Hoffman bill.hoffman at kitware.com
Tue Feb 12 08:10:54 EST 2008


Mathieu Malaterre wrote:

> 
> This is a test... I need to run it just like a normal test. I know
> this sound weird to check for something that do not compile. The
> simpliest case is when I need to trigger a static assert. Another
> example could be for ITK to check that their itkConceptChecking are
> actually working: Luis are you doing that ?
> 
> Or maybe I misunderstood you suggestion, and I could run the test, by
> simply sending the stored result from CMakeCache.txt (thus the test
> would be run at build time), is this correct ?
> 

So, use a cmake --build-and-test test like the ones we use in CMake. 
You create a complete project and run cmake, and the build tool on it. 
There are many examples in the CMake test tree.

-Bill


More information about the CMake mailing list