From 9e87f693d152ef4939ce593cf1a8dcaad3b17e35 Mon Sep 17 00:00:00 2001 From: Jan Ole Vollmer Date: Tue, 30 May 2017 01:24:20 +0200 Subject: [PATCH] Extend cppcheck find script with default installation paths on Windows --- cmake/Findcppcheck.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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)