Skip to content

Cleaning Build dir - option for bein conservative #22

Description

@ikcalB

TL;DR: add an option for remvoing known files only, not the whole content of the build dir.

I've come to use CMake for embedded systems.
Beeing at the build dir, where all making/flashing/debugging happens, there are cases where one would like to save some FLASH content / EEPROM values / whatever downloaded from the target. (For comparison, reference,...)

It's convenient to have those things in build dir.

What about an option to remove only files, knowingly generated by CMake?
Like so (maybe include files where grepping for 'generated by CMake' or the like):

function! s:cmakeclean()
  if !s:find_build_dir()
    return
  endif

  let s:cmd_clean="rm -r '" . b:build_dir . "'/"
  echo system(s:cmd_clean . "CMakeCache.txt")
  echo system(s:cmd_clean . "CMakeFiles")
  echo system(s:cmd_clean . "cmake_install.cmake")
  echo system(s:cmd_clean . "Makefile")
  echom "Build directory has been cleaned."
endfunction

(only using CMake for Makefiles and linux, this list probably needs to be extended for different build systems)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions