Fix bad add_custom_command() in distclean target

`add_custom_command()` has 2 formats: OUTPUT and TARGET. This is TARGET,
but TARGET does not permit OUTPUT.

see https://cmake.org/cmake/help/v3.31/policy/CMP0175.html
and https://cmake.org/cmake/help/v3.31/command/add_custom_command.html

Also, I converted to now-prefered lowercase (only lowercase works in my
IDE to pull up context-sensitive help for CMake). And I replaced a Make-
oriented COMMAND on `add_custom_target()` to a proper `COMMENT`.
This commit is contained in:
Dan Dennedy
2025-04-03 15:46:55 -07:00
committed by Jaromil
parent 85f6e9dba2
commit 1f8e21e27f

View File

@@ -3,9 +3,11 @@
# Jan Woetzel 04/2003
#
IF (UNIX)
ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
SET(DISTCLEANED
if(UNIX)
add_custom_target(distclean
COMMENT "cleaning for source distribution"
)
set(DISTCLEANED
cmake.depends
cmake.check_depends
CMakeCache.txt
@@ -16,13 +18,17 @@ IF (UNIX)
gmon.out
*~
)
ADD_CUSTOM_COMMAND(
DEPENDS clean
add_custom_command(
COMMENT "running target clean"
TARGET distclean
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target clean
)
add_custom_command(
POST_BUILD
COMMENT "distribution clean"
COMMAND rm
ARGS -Rf CMakeTmp ${DISTCLEANED}
TARGET distclean
)
ENDIF(UNIX)
endif(UNIX)