Очистка каталога проекта от сгенерированных файлов

This commit is contained in:
Andrei Astafev 2019-02-14 21:48:47 +03:00
parent 959a730ec6
commit 4164852959

View File

@ -12,3 +12,18 @@ if(${_source_realpath} STREQUAL ${_binary_realpath})
message(FATAL_ERROR "In-source builds are not allowed.")
endif()
# Очистка от сгенерированных файлов
file(GLOB_RECURSE _cmakelists_files RELATIVE ${_source_realpath} CMakeLists.txt)
foreach(_it ${_cmakelists_files})
get_filename_component(_file ${_it} REALPATH)
get_filename_component(_dir ${_file} DIRECTORY)
file(REMOVE_RECURSE
${_dir}/CMakeFiles
${_dir}/CMakeCache.txt
${_dir}/cmake_install.cmake
${_dir}/Makefile
${_dir}/build.ninja
${_dir}/rules.ninja
)
endforeach()