My CMmake build script includes an "external native makefile". Target-all has a dependency with an "external make". This dependency is made by CMake.
CMakeLists.txt
|____( add_custom_target )_____ GNU make file
But Target-clean doesn't have a dependency with an "external make clean". I can't make dependency clean - external make clean. I can make a new custom-target (for example, newClean), and it has a dependency with "clean" and "external make clean". But "clean" and "newClean" exist. It may be the confusion.
How do I resolve this problem?
There are three possible solutions I can think of:
Make sure all output files from custom commands are listed in the OUTPUT line. They will then be removed as part of clean (this behaviour is mentioned with the CLEAN_NO_CUSTOM
property).
Add extra files to the ADDITIONAL_MAKE_CLEAN_FILES
directory property.
Create a new custom command which calls the normal clean target and your other make file. Example:
add_custom_target(really-clean
COMMAND "$(CMAKE)" --build "${CMAKE_BINARY_DIR}" clean
COMMAND cd "${CMAKE_BINARY_DIR}/otherproject" && make clean
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With