TheLartians / Format.cmake

💅 Stylize your code! Automatic clang-format and cmake-format targets for CMake.
Apache License 2.0
159 stars 25 forks source link

apply cmake-format on source files and document CMAKE_FORMAT_EXCLUDE #19

Closed TheLartians closed 4 years ago

jecassis commented 4 years ago

Here are a couple of nifty additions to the .cmake-format.yaml for your projects to get the formatting right on the CPM and PackageProject commands:

parse:
  additional_commands:
    cpmaddpackage:
      pargs:
        nargs: '*'
        flags: []
      spelling: CPMAddPackage
      kwargs:
        NAME: 1
        FORCE: 1
        VERSION: 1
        GIT_TAG: 1
        DOWNLOAD_ONLY: 1
        GITHUB_REPOSITORY: 1
        GITLAB_REPOSITORY: 1
        GIT_REPOSITORY: 1
        SOURCE_DIR: 1
        DOWNLOAD_COMMAND: 1
        FIND_PACKAGE_ARGUMENTS: 1
        NO_CACHE: 1
        GIT_SHALLOW: 1
        URL: 1
        URL_HASH: 1
        OPTIONS: +
    packageproject:
      pargs:
        nargs: '*'
        flags: []
      spelling: packageProject
      kwargs:
        NAME: 1
        VERSION: 1
        INCLUDE_DIR: 1
        INCLUDE_DESTINATION: 1
        BINARY_DIR: 1
        COMPATIBILITY: 1
        VERSION_HEADER: 1
        DEPENDENCIES: +
TheLartians commented 4 years ago

That's very useful, thanks!