summaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2011-12-06 16:03:05 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2011-12-06 16:03:05 +0000
commitbfe8b81d187aa49662f3700575c9c433f0c667df (patch)
treeafd43dfda75f4ad73f617e1e43ab5bb5436e85d5 /CMake
parentec71c19be7c8af4c2a4db0f7b39d0cc658d06435 (diff)
Add new mechanism for cppcheck
Diffstat (limited to 'CMake')
-rw-r--r--CMake/CTestCustom.cmake.in26
-rw-r--r--CMake/FindCPPCHECK.cmake16
2 files changed, 29 insertions, 13 deletions
diff --git a/CMake/CTestCustom.cmake.in b/CMake/CTestCustom.cmake.in
index a85b0510..60e63528 100644
--- a/CMake/CTestCustom.cmake.in
+++ b/CMake/CTestCustom.cmake.in
@@ -1,14 +1,3 @@
-#
-# Note that the ITK/CMakeLists.txt file configures this file
-#
-# CMake/CTestCustom.cmake.in
-#
-# to this file
-#
-# ${ITK_BINARY_DIR}/CTestCustom.cmake
-#
-#----------------------------------------------------------------------
-#
# For further details regarding this file,
# see http://www.cmake.org/Wiki/CMake_Testing_With_CTest#Customizing_CTest
#
@@ -18,8 +7,8 @@
#----------------------------------------------------------------------
SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1000000)
-SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50)
-SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 2000)
+SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 50)
+SET(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 2000)
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
@@ -37,3 +26,14 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
# Suppress warning caused by intentional messages about deprecation
".*warning,.* is deprecated"
)
+
+
+# Custom mechanism to catch cppcheck reports:
+#set(CTEST_CUSTOM_ERROR_MATCH
+# "error"
+#)
+
+# don't ask
+SET(CTEST_CUSTOM_WARNING_MATCH
+ "error"
+)
diff --git a/CMake/FindCPPCHECK.cmake b/CMake/FindCPPCHECK.cmake
new file mode 100644
index 00000000..0db297db
--- /dev/null
+++ b/CMake/FindCPPCHECK.cmake
@@ -0,0 +1,16 @@
+# cppcheck
+#
+# Copyright (c) 2011 Mathieu Malaterre <mathieu.malaterre@gmail.com>
+#
+# Redistribution and use is allowed according to the terms of the New
+# BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+FIND_PROGRAM(CPPCHECK_EXECUTABLE
+ cppcheck
+ )
+
+MARK_AS_ADVANCED(
+ CPPCHECK_EXECUTABLE
+ )