Skip to content

Commit

Permalink
Gracefully exit if pclint not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Pablo Samper committed May 1, 2018
1 parent 5e5e6b1 commit e293644
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ament_cmake_pclint/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.9)

project(ament_cmake_pclint NONE)

Expand Down
10 changes: 9 additions & 1 deletion ament_cmake_pclint/cmake/ament_pclint.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ function(ament_pclint)

find_program(ament_pclint_BIN NAMES "ament_pclint")
if(NOT ament_pclint_BIN)
message(FATAL_ERROR "ament_pclint() could not find program 'ament_pclint'")
message(WARNING "ament_pclint() could not find program 'ament_pclint', skipping.")
set(_ament_pclint_BIN_FOUND "FALSE" PARENT_SCOPE)
return()
endif()

set(cmd "${ament_pclint_BIN}" ${ARG_UNPARSED_ARGUMENTS})
Expand Down Expand Up @@ -109,4 +111,10 @@ function(ament_pclint)
PROPERTIES
LABELS "pclint;linter"
)
if(NOT _ament_pclint_BIN_FOUND)
set_test_properties(
"${ARG_TESTNAME}"
PROPERTIES
DISABLED "TRUE"
endif()
endfunction()

0 comments on commit e293644

Please sign in to comment.