cmake-lint
cmake-lint copied to clipboard
Fix for issue 26: Default to CMakeLists.txt in current directory
The patch looks ok. I wonder though if this is good behavior in cases a project has split the build logic into multiple smaller .cmake files. The explicit command means when a file is not checked, it's the fault of the user. If we provide logic, it would become our fault.
Did you consider this case, and consider to also scanning for .cmake
files?
@tkruse There are a couple things to consider:
- Would we want to recursively search every subdirectory of the directory
cmakelint
is invoked in for all files matchingCMakeLists.txt
and*.cmake
? - How ought we to differentiate between
.cmake
files that are generated by cmake itself, and.cmake
files that are user-defined? It would be undesirable for users to be given warnings for.cmake
files that were autogenerated by cmake.
I don't know myself. If the command is to try and guess the intention of a user who does not specify the file, we can only make reasonable assumptions and decide whether to be more bold or more conservative in including files. I don't work with cmake enough to have any strong opinion on these questions, I am fine with merging the lines as they are now, just wanted to mention this possibility.
I think this is probably a reasonable default for now.
copied to https://github.com/cmake-lint/cmake-lint/pull/2