sigoden / projclean

Project dependencies & build artifacts cleanup tool.
Apache License 2.0
130 stars 6 forks source link

feat: Cleanup Make/CMake generated files #31

Closed oSumAtrIX closed 10 months ago

oSumAtrIX commented 10 months ago

I'd say Make/CMake generated files can be quite big, so they'd be a good candidate for https://github.com/sigoden/projclean.

sigoden commented 10 months ago

I'm not familiar with cmake, Is this rule build@CMakeLists.txt generic? @oSumAtrIX

oSumAtrIX commented 10 months ago

CMakeCache.txt,CMakeFiles@CMakeLists.txt should be sufficient for CMake

sigoden commented 10 months ago

I disagree with you, I just checked out today's c++ trending projects, there are several projects that uses the build dir:

@oSumAtrIX

oSumAtrIX commented 10 months ago

You can run cmake everywhere including in the top root directory. Include build as well

sigoden commented 10 months ago

If the rule is CMakeCache.txt,CMakeFiles@CMakeLists.txt, projclean only searches CMakeCache.txt/CMakeFiles in the directory that contains CMakeLists.txt, not recursively.

For example, projclean CMakeCache.txt,CMakeFiles@CMakeLists.txt won't clean up anything below

├── build
│   ├── CMakeCache.txt
│   └── CMakeFiles
└── CMakeLists.txt

But projclean build@CMakeLists.txt will clean up the build directory.

oSumAtrIX commented 10 months ago

I meant that CMake can be run in the top root directory but also commonly in a build folder to not poison the project folder. Projclean should ideally handle both scenarios

sigoden commented 10 months ago

cmake generates a lot of files, not only CMakeCache.txt and CMakeFiles. It makes no sense at all to just clean up part of it.

oSumAtrIX commented 10 months ago

That's the most common files generated and if done in the root of the project, just cleaning build wouldn't cut it, like previously said, ideally you consider both cases

sigoden commented 10 months ago

I've always believed that if you can only clean up parts of a project, you might as well not clean it up at all. I will add the rule build@CMakeLists.txt. If users want to clean CMakeFiles or CMakeCache.txt then they can use custom rules