[CMake] check directory existence in add_custom_command

Yifei Li yifli at mtu.edu
Tue Sep 6 20:48:16 EDT 2011


Hi all,

I'm developing on Mac using Xcode, and I need to create a directory in 'Debug':  add_custom_command(TARGET target POST_BUILD ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/MyDir)

How do I test the existence of 'MyDir' before creating it? Can I put 'if (exists MyDir)' before make_directory?

Thanks

Yifei


More information about the CMake mailing list