[CMake] When Ninja byproduct is a directory causes `clean` target to fail.

Dan Liew dan at su-root.co.uk
Thu May 4 07:35:43 EDT 2017


Hi,

I recently added support to a project to build its API documentation [1].

The documentation is generated by doxygen.
I used `add_custom_command()` to run doxygen and I use `BYPRODUCTS` to
specify the output directory that will be generated by doxygen in the
hope that this would tell ninja to remove it when the `clean` target
is run.

However this doesn't work because ninja complains that the directory
isn't empty.
Is `BYPRODUCTS` not supposed to be used with directories, or is this a bug?


[1] https://github.com/Z3Prover/z3/blob/a9d6ef68f02d636d9628a52a257d968a13321752/contrib/cmake/doc/CMakeLists.txt#L59

Thanks,
Dan.


More information about the CMake mailing list