diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d6c10ef..d60402b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -183,6 +183,18 @@ if (BUILD_TESTING AND BUILDSYSTEM_TESTING) add_subdirectory(examples) endif() +# Codecheck +set(CPPCHECK_DIRS + ${CMAKE_SOURCE_DIR}/examples +) +set(CPPCHECK_INCLUDE_DIRS + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/examples +) +set(IGNITION_CMAKE_CODECHECK_DIR "${CMAKE_CURRENT_SOURCE_DIR}/codecheck") +include(IgnCodeCheck) +ign_setup_target_for_codecheck() + # Docs set(IGNITION_CMAKE_DOXYGEN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen") configure_file(${CMAKE_SOURCE_DIR}/api.md.in ${CMAKE_BINARY_DIR}/api.md) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 562f8235..7396cb5c 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -23,10 +23,6 @@ if (NOT CMAKE_GENERATOR MATCHES "Visual Studio") ) endif() -# test to see if we have programs necessary to run codecheck -include(IgnCodeCheck) -ign_setup_target_for_codecheck() - foreach(example ${example_directories}) set(run_codecheck false) if (${example} STREQUAL "ign_conf") diff --git a/examples/comp_deps/child/include/empty.hh b/examples/comp_deps/child/include/empty.hh index e69de29b..4e55a3a8 100644 --- a/examples/comp_deps/child/include/empty.hh +++ b/examples/comp_deps/child/include/empty.hh @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2018 Open Source Robotics Foundation + * + * 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. + * +*/ diff --git a/examples/comp_deps/parent/include/empty.hh b/examples/comp_deps/parent/include/empty.hh index e69de29b..4e55a3a8 100644 --- a/examples/comp_deps/parent/include/empty.hh +++ b/examples/comp_deps/parent/include/empty.hh @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2018 Open Source Robotics Foundation + * + * 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. + * +*/ diff --git a/examples/use_component_depsA/src/empty.cc b/examples/use_component_depsA/src/empty.cc index e69de29b..4e55a3a8 100644 --- a/examples/use_component_depsA/src/empty.cc +++ b/examples/use_component_depsA/src/empty.cc @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2018 Open Source Robotics Foundation + * + * 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. + * +*/ diff --git a/examples/use_component_depsB/src/empty.cc b/examples/use_component_depsB/src/empty.cc index e69de29b..4e55a3a8 100644 --- a/examples/use_component_depsB/src/empty.cc +++ b/examples/use_component_depsB/src/empty.cc @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2018 Open Source Robotics Foundation + * + * 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. + * +*/ diff --git a/examples/use_component_depsC/src/empty.cc b/examples/use_component_depsC/src/empty.cc index e69de29b..4e55a3a8 100644 --- a/examples/use_component_depsC/src/empty.cc +++ b/examples/use_component_depsC/src/empty.cc @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2018 Open Source Robotics Foundation + * + * 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. + * +*/