@@ -20,8 +20,9 @@ set(CMAKE_CXX_EXTENSIONS OFF)
20
20
# Add project_options v0.13.1
21
21
# https://github.com/cpp-best-practices/project_options
22
22
include (FetchContent)
23
- FetchContent_Declare(_project_options
24
- URL https://github.com/cpp-best-practices/project_options/archive/refs/heads/main.zip)
23
+ FetchContent_Declare(
24
+ _project_options
25
+ URL https://github.com/lefticus/project_options/archive/refs/heads/make_cppcheck_flags_configurable.zip)
25
26
# URL https://github.com/cpp-best-practices/project_options/archive/refs/tags/v0.13.1.zip)
26
27
FetchContent_MakeAvailable(_project_options)
27
28
include (${_project_options_SOURCE_DIR} /Index.cmake)
@@ -30,8 +31,14 @@ include(${_project_options_SOURCE_DIR}/Index.cmake)
30
31
# # Setup vcpkg - should be called before defining project()
31
32
# run_vcpkg()
32
33
33
- set (GIT_SHA "Unknown" CACHE STRING "SHA this build was generated from" )
34
- string (SUBSTRING "${GIT_SHA} " 0 8 GIT_SHORT_SHA)
34
+ set (GIT_SHA
35
+ "Unknown"
36
+ CACHE STRING "SHA this build was generated from" )
37
+ string (
38
+ SUBSTRING "${GIT_SHA} "
39
+ 0
40
+ 8
41
+ GIT_SHORT_SHA)
35
42
36
43
# Set the project name and language
37
44
project (
@@ -77,7 +84,15 @@ dynamic_project_options(
77
84
# MSVC_WARNINGS # Override the defaults for the MSVC warnings
78
85
# CLANG_WARNINGS # Override the defaults for the CLANG warnings
79
86
# GCC_WARNINGS # Override the defaults for the GCC warnings
80
- )
87
+ CPPCHECK_OPTIONS
88
+ --enable=style,performance,warning,portability
89
+ --inline-suppr
90
+ # We cannot act on a bug/missing feature of cppcheck
91
+ --suppress=internalAstError
92
+ # if a file does not have an internalAstError, we get an unmatchedSuppression error
93
+ --suppress=unmatchedSuppression
94
+ --suppress=passedByValue
95
+ --inconclusive)
81
96
82
97
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9" )
83
98
target_link_libraries (project_options INTERFACE stdc++fs)
@@ -116,8 +131,7 @@ endif()
116
131
set_property (DIRECTORY PROPERTY VS_STARTUP_PROJECT json2cpp)
117
132
118
133
set (CPACK_PACKAGE_FILE_NAME
119
- "${CMAKE_PROJECT_NAME} -${CMAKE_PROJECT_VERSION} -${GIT_SHORT_SHA} -${CMAKE_SYSTEM_NAME} -${CMAKE_BUILD_TYPE} -${CMAKE_CXX_COMPILER_ID} -${CMAKE_CXX_COMPILER_VERSION} " )
134
+ "${CMAKE_PROJECT_NAME} -${CMAKE_PROJECT_VERSION} -${GIT_SHORT_SHA} -${CMAKE_SYSTEM_NAME} -${CMAKE_BUILD_TYPE} -${CMAKE_CXX_COMPILER_ID} -${CMAKE_CXX_COMPILER_VERSION} "
135
+ )
120
136
121
137
include (CPack)
122
-
123
-
0 commit comments