diff --git a/cmake/Findcppcheck.cmake b/cmake/Findcppcheck.cmake index b833859..c90e7cd 100644 --- a/cmake/Findcppcheck.cmake +++ b/cmake/Findcppcheck.cmake @@ -5,11 +5,17 @@ include(FindPackageHandleStandardArgs) +# work around CMP0053, see http://public.kitware.com/pipermail/cmake/2014-November/059117.html +set(PROGRAMFILES_x86_ENV "PROGRAMFILES(x86)") + find_program(cppcheck_EXECUTABLE NAMES cppcheck PATHS "${CPPCHECK_DIR}" + "$ENV{CPPCHECK_DIR}" + "$ENV{PROGRAMFILES}/Cppcheck" + "$ENV{${PROGRAMFILES_x86_ENV}}/Cppcheck" ) find_package_handle_standard_args(cppcheck @@ -19,4 +25,4 @@ find_package_handle_standard_args(cppcheck cppcheck_EXECUTABLE ) -mark_as_advanced(cppcheck_EXECUTABLE) \ No newline at end of file +mark_as_advanced(cppcheck_EXECUTABLE)