Skip to content

Testing CMake scripts

Mayeul d'Avezac edited this page Apr 11, 2014 · 1 revision

The file TestCMake.cmake contains a function to test cmake scripts. It converts an input cmake file into a project which is then configured, built, and run using ctest. Unless an optional "SOURCE" is provided as argument, the test program is an empty main function returning 0. If the keyword is provided, then a main.cc or main.c file should provided the cmake script.

For examples, look at the tests in this package.