ros-industrial / ros_industrial_cmake_boilerplate

Other
16 stars 15 forks source link

Improve target_clang_tidy to support individual options over single argument list #46

Closed Levi-Armstrong closed 3 years ago

Levi-Armstrong commented 3 years ago

The previous version of target_clang_tidy only provided ENABLE and ARGUMENTS where the user must provide the full argument list to be provided. This made it not possible to easily reuse individual clang-tidy arguments. This exposes additions single argument keywords for --header-filter, --line-filter, --checks, --warnings-as-errors, and --config along with creating a new variable DEFAULT_CLANG_TIDY_CHECKS making it easier to reuse this argument and provided custom filters. This does not break existing code as the multi-argument keywords ARGUMENTS still is available and can be used.

target_clang_tidy(${PROJECT_NAME}_utest
  ENABLE ${DESCARTES_ENABLE_CLANG_TIDY}
  WARNINGS_AS_ERRORS ${DESCARTES_ENABLE_TESTING}
  LINE_FILTER ${DESCARTES_CLANG_TIDY_LINE_FILTER}
  CHECKS ${DEFAULT_CLANG_TIDY_CHECKS})