Skip to content

Commit

Permalink
improve 'clean_all' target (still not perfect but should be good enough)
Browse files Browse the repository at this point in the history
  • Loading branch information
DDvO committed Jan 9, 2025
1 parent b7e0d84 commit aaee01e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,12 @@ set_property(

if(NOT TARGET clean_all)
add_custom_target(clean_all
# useful only after 'cmake ."
# cowardly not doing rm -r ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_BUILD_TOOL} clean
COMMAND find . -name "*.o" -o -name "*.d" -o -regex "./libgencmp-.*" | xargs rm
COMMAND find . -name build -type dir | xargs rm -r
COMMAND find . -name "*.o" -o -name "*.d" -o -regex "./libgencmp-.*" | xargs rm || true
COMMAND find . -path ./libsecutils/Makefile | xargs -I % ${CMAKE_BUILD_TOOL} -C libsecutils clean_all || true
COMMAND find . -path ./cmpossl/Makefile | xargs -I % ${CMAKE_BUILD_TOOL} -C cmpossl clean_all || true
COMMAND find . -path ./cmpossl/Makefile | xargs -I % ${CMAKE_BUILD_TOOL} -C cmpossl clean_all || true
COMMAND rm CMakeCache.txt
# after the following, cannot call this target again:
COMMAND find . ( -name "*.cmake" -o -name Makefile )
Expand All @@ -291,6 +292,7 @@ if(NOT TARGET clean_all)
COMMAND find . -name CMakeFiles
-not -path ./libsecutils/* -not -path ./cmpossl/*
| xargs rm -r
COMMAND find . -name build -type dir | xargs rm -r || true
VERBATIM
)
endif()
Expand Down

0 comments on commit aaee01e

Please sign in to comment.