[CMake] check directory existence in add_custom_command
David Cole
david.cole at kitware.com
Tue Sep 6 21:29:51 EDT 2011
On Tue, Sep 6, 2011 at 8:48 PM, Yifei Li <yifli at mtu.edu> wrote:
>
> 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?
>
Why do you need to check its existence first? Calling make_directory
is a no-op if the directory already exists...
> Thanks
>
> Yifei
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
More information about the CMake
mailing list