On 12/09/2016 08:18 AM, Dan Liew wrote:
> CMake has special commands for doing `install` so I'd expect something
> analogous for managing how `clean is performed`.

CMake has full control over the generation of the install rules.
For "clean" this is only true for the Makefile generator.

>> think something like `ADDITIONAL_MAKE_CLEAN_COMMAND` or perhaps
>> `ADDITIONAL_MAKE_CLEAN_TARGET`
> I suppose that would do the job. I do use Ninja as a generator a lot
> too. Would Ninja support it too?

No, because ninja has its own model for a "clean" operation.

Getting custom "clean" behavior in general would require adding
a custom target that looks like a normal target to build systems
but inside is full of commands to clean.  For this I don't think
any special support is needed from CMake:

add_custom_target(myclean
  COMMAND ${whatever_command_user_wants}
  COMMAND ${CMAKE_COMMAND} --build . --target clean --config $<CONFIG>
  )

-Brad

-- 

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