Files
mlpack/CMake/TargetDistclean.cmake
T
Alexander Leinoff 3f3d018ea4 Converts CMake commands to lower case
CMake commands are sometimes given in upper and lower case.
Previously uppercase commands had been required but now commands are
case-insensitive and lowercase commands are preferred. Conversion to lowercase
commands have been implemented in other open source projects such as ITK vxl
and BRAINSTools, and is the preferred style for KDE. Consistent style
practices help to improve readability and maintainability of code.

This was implemented with the shell script:
NOTE: MUST USE GNU compliant version of sed
    cmake --help-command-list \
    | grep -v "cmake version" \
    | while read c; do
        echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
      done >convert.sed \
    && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' \
       | xargs -0 gsed -i -f convert.sed \
    && rm convert.sed

This is a reimplementation of ITK commit
896f6b9220255bed1b3a1409af5257146b54e261
STYLE: Convert CMake-language commands lower case

Fixes #538
2016-03-21 13:44:09 -05:00

23 lines
862 B
CMake

# add custom target distclean
# cleans and removes cmake generated files etc.
# Jan Woetzel 04/2003
#
# taken from http://cmake.org/pipermail/cmake/2003-June/003953.html
# hate at http://itk.org/Bug/view.php?id=6647
# yacked and brought out of 2003 by rcurtin
if (UNIX)
# since it's unix-specific we will use bash
add_custom_target (distclean @echo cleaning ${FASTLIB_SOURCE_DIR} for source distribution)
add_custom_command(TARGET distclean
COMMAND make ARGS clean
COMMAND find ARGS ${FASTLIB_SOURCE_DIR} -iname CMakeCache.txt -delete
COMMAND find ARGS ${FASTLIB_SOURCE_DIR} -iname cmake_install.cmake -delete
COMMAND find ARGS ${FASTLIB_SOURCE_DIR} -iname Makefile -delete
COMMAND find ARGS ${FASTLIB_SOURCE_DIR} -depth -type d -iname CMakeFiles -exec rm -rf {} \;
COMMAND rm ARGS -rf bin lib include
VERBATIM )
endif(UNIX)