Build: add ARM and aarch64 target architectures
[marnav.git] / cmake / CppCheck.cmake
blob78ea6b29affbbc40fce46fd5628d28e9d8217375
1 find_program(CPPCHECK_PATH cppcheck)
2 if(CPPCHECK_PATH)
3         message(STATUS "cppcheck: ${CPPCHECK_PATH}")
4         add_custom_target(cppcheck
5                 COMMAND ${CPPCHECK_PATH}
6                         --suppressions-list=${CMAKE_CURRENT_SOURCE_DIR}/src/cppcheck-suppress.txt
7                         --std=c++11
8                         --platform=unix32
9                         -v
10                         -f
11                         --enable=all
12                         --template='{file}:{line},{severity},{id},{message}'
13                         -I ${CMAKE_CURRENT_SOURCE_DIR}/src
14                         -I ${CMAKE_CURRENT_SOURCE_DIR}/include
15                         ${CMAKE_CURRENT_SOURCE_DIR}/src
16                         ${CMAKE_CURRENT_SOURCE_DIR}/include
17                         2> ${CMAKE_CURRENT_BINARY_DIR}/doc/cppcheck.txt
18                 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
19         )
20 else()
21         message(STATUS "cppcheck: not found, target not available.")
22 endif()