Hi all,

Ninja does not clean out non-empty directories.

Given this CMakeLists.txt:
======
cmake_minimum_required(VERSION 2.8)

add_custom_command(
  OUTPUT dir
  COMMAND ${CMAKE_COMMAND} -E make_directory dir
  COMMAND ${CMAKE_COMMAND} -E touch dir/file
)

add_custom_target(
  dir-target DEPENDS dir
)
======

the follow commands work fine:

$ cmake -GUnix Makefiles srcdir
...
$ make
Scanning dependencies of target dir-target
[100%] Generating dir
[100%] Built target dir-target
$ make clean
$

But with Ninja, this fails:

$ cmake -GNina srcdir
..
$ ninja
[1/1] Generating dir
$ ninja clean
[1/1] Cleaning all built files...
FAILED: /home/oever/.nix-profile/bin/ninja -t clean
ninja: error: remove(dir): Directory not empty
Cleaning... 0 files.
ninja: build stopped: subcommand failed.

I assume this is a bug. I tried creating a bug db account, but could not get 
past the captcha, so I'm writing here.

Cheers,
Jos
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to