Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to configure language in cppcheck with a global var #239

Merged
merged 10 commits into from
May 25, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ if(_source_files)
list(APPEND _all_include_dirs ${ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS})
endif()

# Language
dirk-thomas marked this conversation as resolved.
Show resolved Hide resolved
set(_language "")
if(DEFINED ament_cmake_cppcheck_ADDITIONAL_LANGUAGE)
list(APPEND _language ${ament_cmake_cppcheck_ADDITIONAL_LANGUAGE})
dirk-thomas marked this conversation as resolved.
Show resolved Hide resolved
endif()
dirk-thomas marked this conversation as resolved.
Show resolved Hide resolved

# BUILDSYSTEM_TARGETS only supported in CMake >= 3.7
if(NOT CMAKE_VERSION VERSION_LESS "3.7.0")
get_directory_property(_build_targets DIRECTORY ${PROJECT_SOURCE_DIR} BUILDSYSTEM_TARGETS)
Expand Down Expand Up @@ -64,5 +70,6 @@ if(_source_files)
endif()

message(STATUS "Configured cppcheck include dirs: ${_all_include_dirs}")
ament_cppcheck(INCLUDE_DIRS ${_all_include_dirs})
message(STATUS "Configured cppcheck language : ${_language}")
ament_cppcheck(LANGUAGE ${_language} INCLUDE_DIRS ${_all_include_dirs})
endif()