-#
-# 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
#
#----------------------------------------------------------------------
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}
# 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"
+)
--- /dev/null
+# 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
+ )
INSTALL(
FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man3/libopenjpeg.3
DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man3)
+
+# Experimental option; let's how cppcheck performs
+# Implementation details:
+# I could not figure out how to easily upload a file to CDash. Instead simply
+# pretend cppcheck is part of the Build step. Technically cppcheck can even
+# output gcc formatted error/warning report
+# Another implementation detail: I could not redirect error to the error
+# catching mechanism something is busted in cmake 2.8.5, I had to use the
+# warning regex to catch them.
+if(OPENJPEG_CPPCHECK)
+ find_package(CPPCHECK REQUIRED)
+ foreach(f ${OPENJPEG_SRCS})
+ # cppcheck complains about too many configuration, pretend to be WIN32:
+ add_custom_command(TARGET ${OPENJPEG_LIBRARY_NAME}
+ COMMAND ${CPPCHECK_EXECUTABLE} -DWIN32 ${f})
+ endforeach()
+endif()