[CMake] Q: How do I _portably_ create a directory in the binary directory

kent williams nkwmailinglists at gmail.com
Fri Sep 19 11:26:45 EDT 2008


I am CMake-izing a non-CMake project -- or rather we have CMake-ized
it, and are doing some clean up.

We have a testing shell script that I'm converting to CTest tests.
The first thing it does is create a directory where it drops all the
testing output.

I'd like to do the same thing -- create a directory as a child of
${CMAKE_BINARY_DIR} to drop files created via testing.

How do I do that in CMake?  I've done some googling and reading
through the documentation without seeing any clues.

I know that CMake itself uses portable routines (from kwsys) to make
directories, but that isn't exposed anywhere.

Do I need to write a CMake Macro for this, so that Unix and OSX do

mkdir -p "${PATH_TO_MAKE}"

and Windows does

cmd.exe /e:on /c mkdir "${PATH_TO_MAKE}"

?


More information about the CMake mailing list