Skip to content

Commit 6687eec

Browse files
author
Stefan Buschmann
authored
Merge pull request #65 from j-o/cppcheck_windows
Extend cppcheck find script with default installation paths on Windows
2 parents 6a6f30b + 9e87f69 commit 6687eec

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cmake/Findcppcheck.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@
55

66
include(FindPackageHandleStandardArgs)
77

8+
# work around CMP0053, see http://public.kitware.com/pipermail/cmake/2014-November/059117.html
9+
set(PROGRAMFILES_x86_ENV "PROGRAMFILES(x86)")
10+
811
find_program(cppcheck_EXECUTABLE
912
NAMES
1013
cppcheck
1114
PATHS
1215
"${CPPCHECK_DIR}"
16+
"$ENV{CPPCHECK_DIR}"
17+
"$ENV{PROGRAMFILES}/Cppcheck"
18+
"$ENV{${PROGRAMFILES_x86_ENV}}/Cppcheck"
1319
)
1420

1521
find_package_handle_standard_args(cppcheck
@@ -19,4 +25,4 @@ find_package_handle_standard_args(cppcheck
1925
cppcheck_EXECUTABLE
2026
)
2127

22-
mark_as_advanced(cppcheck_EXECUTABLE)
28+
mark_as_advanced(cppcheck_EXECUTABLE)

0 commit comments

Comments
 (0)