[CMake] Creating a directory during cmake run

Noah Roberts roberts.noah at gmail.com
Fri Aug 17 20:37:48 EDT 2012


I have set up a cmake structure that runs unit tests under valgrind
and by themselves using ctest and generating xml reports for CI
systems like Jenkins.

One drawback though, the directories to store the resulting reports
must exist before make test or make ExperimentalMemCheck are run.

How would I go about running a mkdir command when, and only when cmake
itself is run or is tying to a target the only way to go about it?

I've tried to add a custom command and this doesn't seem to work:

add_custom_command(OUTPUT reports COMMAND mkdir -p reports)

-- 
http://crazycpp.wordpress.com
http://crazyeddiesbrain.wordpress.com


More information about the CMake mailing list