CMakeLists.txt: Run cppcheck in dev scenarios when available
This commit is contained in:
parent
47ccde8bf1
commit
516f588c0f
@ -38,6 +38,13 @@ cmake_dependent_option(YAML_MSVC_SHARED_RT
|
|||||||
set(YAML_CPP_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/yaml-cpp"
|
set(YAML_CPP_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/yaml-cpp"
|
||||||
CACHE STRING "Path to install the CMake package to")
|
CACHE STRING "Path to install the CMake package to")
|
||||||
|
|
||||||
|
if (YAML_CPP_BUILD_TESTS && CMAKE_VERSION VERSION_GREATER_EQUAL "3.10")
|
||||||
|
find_program(CMAKE_CXX_CPPCHECK NAMES cppcheck)
|
||||||
|
if (CMAKE_CXX_CPPCHECK)
|
||||||
|
option(YAML_CPP_CHECK "Run cppcheck static code analysis" ON)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (YAML_CPP_FORMAT_SOURCE)
|
if (YAML_CPP_FORMAT_SOURCE)
|
||||||
find_program(YAML_CPP_CLANG_FORMAT_EXE NAMES clang-format)
|
find_program(YAML_CPP_CLANG_FORMAT_EXE NAMES clang-format)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user