Commit debb77a6 authored by Martyn Gigg's avatar Martyn Gigg
Browse files

Generate cppcheck suppressions based on ENABLE_MANTIDPLOT

If the flag is off then some suppressions don't get matched
and then cppcheck warns of unmatched suppressions
parent c791b96b
......@@ -5,7 +5,11 @@ if ( CPPCHECK_EXECUTABLE )
# We must export the compile commands for cppcheck to be able to check
# everything correctly
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(ENABLE_MANTIDPLOT)
set(MANTIDPLOT_CPPCHECK_SUPPRESSIONS "*:${CMAKE_SOURCE_DIR}/MantidPlot/src/zlib123/*
*:${CMAKE_SOURCE_DIR}/MantidPlot/src/origin/tree.hh
*:${CMAKE_SOURCE_DIR}/MantidPlot/src/nrutil.cpp")
endif()
configure_file(${CMAKE_SOURCE_DIR}/buildconfig/CMake/CppCheck_Suppressions.txt.in ${CMAKE_BINARY_DIR}/CppCheck_Suppressions.txt)
# setup the standard arguments
......@@ -34,7 +38,7 @@ if ( CPPCHECK_EXECUTABLE )
list( APPEND _cppcheck_xml_args ${_cppcheck_source_dirs} )
endif (CPPCHECK_GENERATE_XML)
# generate the target
if (NOT TARGET cppcheck)
......
......@@ -45,8 +45,6 @@ syntaxError:${CMAKE_SOURCE_DIR}/Framework/API/src/MatrixWorkspace.cpp
// Mantid Plot specific ones we probably won't fix before removal
*:${CMAKE_SOURCE_DIR}/MantidPlot/src/origin/tree.hh
*:${CMAKE_SOURCE_DIR}/MantidPlot/src/nrutil.cpp
pureVirtualCall:${CMAKE_SOURCE_DIR}/qt/scientific_interfaces/Indirect/IndirectBayesTab.cpp
pureVirtualCall:${CMAKE_SOURCE_DIR}/qt/scientific_interfaces/Indirect/IndirectBayesTab.h
......@@ -95,4 +93,4 @@ noCopyConstructor:${CMAKE_SOURCE_DIR}/Framework/Geometry/inc/MantidGeometry/Rend
*:${CMAKE_SOURCE_DIR}/Framework/ICat/src/GSoap/*
*:${CMAKE_SOURCE_DIR}/Framework/ICat/src/ICat3/GSoapGenerated/*
*:${CMAKE_SOURCE_DIR}/Framework/ICat/src/ICat4/GSoapGenerated/*
*:${CMAKE_SOURCE_DIR}/MantidPlot/src/zlib123/*
${MANTIDPLOT_CPPCHECK_SUPPRESSIONS}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment