Remove unnecessary cppcheck include-path
[alexxy/gromacs.git] / tests / CppCheck.cmake
index 98a3ca4e3a653de8802fe0376f188eeedf4dd72f..2b3e93386c63a4751ce8cbd4034f7923583e5c75 100644 (file)
@@ -1,10 +1,10 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2013, by the GROMACS development team, led by
-# David van der Spoel, Berk Hess, Erik Lindahl, and including many
-# others, as listed in the AUTHORS file in the top-level source
-# directory and at http://www.gromacs.org.
+# Copyright (c) 2013,2014, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
 #
 # GROMACS is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public License
@@ -31,7 +31,6 @@
 #
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
-#
 
 find_program(CPPCHECK_EXECUTABLE
     NAMES cppcheck
@@ -54,7 +53,13 @@ if (CPPCHECK_EXECUTABLE AND UNIX)
         ${CMAKE_SOURCE_DIR}/src/gromacs/linearalgebra/gmx_lapack/*.c
         ${CMAKE_SOURCE_DIR}/src/contrib/*.c
         ${CMAKE_SOURCE_DIR}/src/contrib/*.cpp
-        ${CMAKE_SOURCE_DIR}/src/contrib/*.cu)
+        ${CMAKE_SOURCE_DIR}/src/contrib/*.cu
+        ${CMAKE_SOURCE_DIR}/src/external/*.c
+        ${CMAKE_SOURCE_DIR}/src/external/*.cpp
+        ${CMAKE_SOURCE_DIR}/src/external/*.cu
+        ${CMAKE_SOURCE_DIR}/src/gromacs/selection/scanner.cpp
+        ${CMAKE_SOURCE_DIR}/src/gromacs/selection/parser.cpp
+        )
     list(REMOVE_ITEM _inputfiles ${_files_to_ignore})
 
     # Set flags for cppcheck
@@ -65,27 +70,39 @@ if (CPPCHECK_EXECUTABLE AND UNIX)
         set(_outputopt --xml)
     endif()
     set(_common_flags
-        --enable=style
-        -DSIZEOF_LONG_LONG_INT=8 -DSIZEOF_INT=4 -DLINUX
-        -I src/gromacs/legacyheaders -I src
-        -I ${CMAKE_BINARY_DIR}/src -I ${CMAKE_BINARY_DIR}/src/gromacs/utility
+        --enable=style -DLINUX -DHAVE_UNISTD_H
+        -I src
+        -I src/external/thread_mpi/include
+        -I src/external/tng_io/include
+        -I ${CMAKE_BINARY_DIR}/src
         --quiet
+        --inline-suppr
         ${_outputopt})
     set(_c_flags
-        -I src/gromacs/gmxpreprocess
-        -I src/programs/mdrun
         --suppress=variableScope
+        --suppress=unnecessaryForwardDeclaration
         --suppress=unusedVariable
         --suppress=unreadVariable
         --suppress=unusedStructMember
         --suppress=invalidscanf
         --suppress=sizeofCalculation
         --suppress=missingInclude:src/programs/mdrun/gmx_gpu_utils/gmx_gpu_utils.cu
-        --inline-suppr)
+        --suppress=*:src/external/Random123-1.08/include/Random123/features/compilerfeatures.h
+        --suppress=assignIfError:src/gromacs/mdlib/nbnxn_atomdata.c #Ticket 5695
+        --suppress=invalidPointerCast:src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh
+        --suppress=passedByValue:src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh
+        --suppress=passedByValue:src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_utils.cuh
+        ) 
     set(_cxx_flags
+        -D__cplusplus
         --suppress=variableScope
         --suppress=unnecessaryForwardDeclaration
-        --suppress=*:src/gromacs/selection/scanner.cpp)
+        --suppress=invalidscanf:src/gromacs/fileio/matio.cpp
+        --suppress=invalidscanf:src/gromacs/fileio/xvgr.cpp
+        --suppress=invalidscanf:src/gromacs/topology/index.cpp
+        --suppress=invalidscanf:src/gromacs/gmxpreprocess/pdb2top.cpp
+        --suppress=passedByValue:src/gromacs/simd/tests/*
+        )
 
     # This list will hold the list of all files with cppcheck errors
     # (one per input file)