Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Project_Phoenix
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
Project_Phoenix
Commits
f4aafa45
Commit
f4aafa45
authored
Oct 17, 2017
by
demiralp
Browse files
Options
Downloads
Patches
Plain Diff
Add cppcheck cmake utilities.
parent
c9d772cc
No related branches found
No related tags found
1 merge request
!52
Feature/#9 cppcheck support
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+1
-0
1 addition, 0 deletions
CMakeLists.txt
cmake/cppcheck.cmake
+55
-0
55 additions, 0 deletions
cmake/cppcheck.cmake
with
56 additions
and
0 deletions
CMakeLists.txt
+
1
−
0
View file @
f4aafa45
...
@@ -38,6 +38,7 @@ conan_or_find_package(cpplint REQUIRED)
...
@@ -38,6 +38,7 @@ conan_or_find_package(cpplint REQUIRED)
include
(
cpplint
)
include
(
cpplint
)
conan_or_find_package
(
cppcheck REQUIRED
)
conan_or_find_package
(
cppcheck REQUIRED
)
include
(
cppcheck
)
include
(
GenerateExportHeader
)
include
(
GenerateExportHeader
)
...
...
This diff is collapsed.
Click to expand it.
cmake/cppcheck.cmake
0 → 100644
+
55
−
0
View file @
f4aafa45
#-------------------------------------------------------------------------------
# Project Phoenix
#
# Copyright (c) 2017 RWTH Aachen University, Germany,
# Virtual Reality & Immersive Visualisation Group.
#-------------------------------------------------------------------------------
# License
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
if
(
TARGET CONAN_PKG::cppcheck
)
if
(
CONAN_BIN_DIRS_CPPCHECK_RELEASE
)
set
(
CPPCHECK_DIR
${
CONAN_BIN_DIRS_CPPCHECK_RELEASE
}
)
elseif
(
CONAN_BIN_DIRS_CPPCHECK
)
set
(
CPPCHECK_DIR
${
CONAN_BIN_DIRS_CPPCHECK
}
)
endif
()
# TODO: Validate that .exes are detected.
if
(
EXISTS
"
${
CPPCHECK_DIR
}
/cppcheck"
)
set
(
CPPCHECK_COMMAND
"
${
CPPCHECK_DIR
}
/cppcheck"
)
endif
()
else
()
# TODO: Validate that .exes are detected.
find_file
(
CPPCHECK_COMMAND cppcheck PATHS $ENV{PATH} $ENV{CPPCHECK_DIR}
)
endif
()
if
(
NOT CPPCHECK_COMMAND
)
message
(
SEND_ERROR
" ERROR: Could not find cppcheck.
Having cppcheck is a mandatory requirement.
CMake will not generate the project without it.
Add its location to the environments variables PATH or CPPCHECK_DIR."
)
endif
()
function
(
ADD_TEST_CPPCHECK
)
set
(
options
)
set
(
oneValueArgs NAME
)
set
(
multiValueArgs
)
cmake_parse_arguments
(
ARGS
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
add_test
(
NAME
${
ARGS_NAME
}
COMMAND
${
CPPCHECK_COMMAND
}
${
ARGS_UNPARSED_ARGUMENTS
}
)
set_tests_properties
(
${
ARGS_NAME
}
PROPERTIES TIMEOUT 10.0
)
endfunction
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment