diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 196843f9c..8d5dde1d4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -319,6 +319,6 @@ if((${CYGWIN} EQUAL "1") OR (NOT (${CMAKE_SYSTEM_NAME} MATCHES "Windows"))) endif() add_custom_target(clean-olean - WORKING_DIRECTORY ${LEAN_SOURCE_DIR}/../library - COMMAND find . -type f -name '*.olean' -delete && find . -type f -name '*.d' -delete && find . -type f -name '*.clean' -delete && find . -type f -name '*.ilean' -delete && find . -type f -name 'TAGS' -delete - ) + WORKING_DIRECTORY ${LEAN_SOURCE_DIR}/../library + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_MODULE_PATH}CleanOlean.cmake + ) diff --git a/src/cmake/Modules/CleanOlean.cmake b/src/cmake/Modules/CleanOlean.cmake new file mode 100644 index 000000000..d99f13920 --- /dev/null +++ b/src/cmake/Modules/CleanOlean.cmake @@ -0,0 +1,25 @@ +FILE(GLOB_RECURSE OLEAN_FILES ${CMAKE_CURRENT_SOURCE_DIR} *.olean) +FILE(GLOB_RECURSE D_FILES ${CMAKE_CURRENT_SOURCE_DIR} *.d) +FILE(GLOB_RECURSE CLEAN_FILES ${CMAKE_CURRENT_SOURCE_DIR} *.clean) +FILE(GLOB_RECURSE ILEAN_FILES ${CMAKE_CURRENT_SOURCE_DIR} *.ilean) +FILE(GLOB_RECURSE TAGS_FILES ${CMAKE_CURRENT_SOURCE_DIR} TAGS) + +IF(OLEAN_FILES) + FILE(REMOVE ${OLEAN_FILES}) +ENDIF() + +IF(D_FILES) + FILE(REMOVE ${D_FILES}) +ENDIF() + +IF(CLEAN_FILES) + FILE(REMOVE ${CLEAN_FILES}) +ENDIF() + +IF(ILEAN_FILES) + FILE(REMOVE ${ILEAN_FILES}) +ENDIF() + +IF(TAGS_FILES) + FILE(REMOVE ${TAGS_FILES}) +ENDIF()