tags:

views:

51

answers:

1

In CMake, I want to create a directory if it doesn't already exist. How can I do this?

+2  A: 

When do you want to create the directory?

To create a directory while CMake is configuring your build environment,

file(MAKE_DIRECTORY ${directory})

To create a directory at build time,

execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${directory})
Jim Huang