cheshirekow / cmake_format

Source code formatter for cmake listfiles.
GNU General Public License v3.0
949 stars 104 forks source link

cmake-lint generates false positive E1122 for multiple entries of PATTERN #260

Open KineticTheory opened 3 years ago

KineticTheory commented 3 years ago

One of my projects has a couple of instances of this cmake command.

install(
  DIRECTORY ${f90dir_BINARY_DIR}
  DESTINATION "include"
  FILES_MATCHING
  PATTERN "*.mod"
  PATTERN CMakeFiles EXCLUDE)

This command generates cmake-lint warning [E1122] Duplicate keyword argument PATTERN even though this is the required syntax for this command. That is, I want to install all of the files matching regex *.mod while excluding any matches found in the CMakeFiles subdirectory.

This is just an annoyance, but I wanted to report it to make the issue searchable. It can easily be suppressed with # cmake-lint: disable=E1122. If there is a better way to write this instruction, please let me know.