Skip to content

Commit

Permalink
Revert python to optional dependency (#132)
Browse files Browse the repository at this point in the history
Prior to #117, python was an optional dependency; this restores
that behavior.

* IgnPython: find PythonInterp with QUIET instead of REQUIRED
* IgnCodeCheck: skip cpplint if python is not found

Signed-off-by: Steve Peters <[email protected]>
  • Loading branch information
scpeters authored Dec 10, 2020
1 parent ee8bad6 commit 3aec72e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions cmake/IgnCodeCheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@ function(ign_setup_target_for_codecheck)
COMMAND ${CPPCHECK_PATH} ${CPPCHECK_BASE} --enable=missingInclude `${CPPCHECK_FIND}`
)

add_custom_target(cpplint
# cpplint cppcheck
COMMAND ${PYTHON_EXECUTABLE} ${IGNITION_CMAKE_CODECHECK_DIR}/cpplint.py --extensions=cc,hh --quiet `${CPPCHECK_FIND}`
)

add_custom_target(codecheck
DEPENDS cpplint cppcheck
DEPENDS cppcheck
)

if(PYTHONINTERP_FOUND)
add_custom_target(cpplint
COMMAND ${PYTHON_EXECUTABLE} ${IGNITION_CMAKE_CODECHECK_DIR}/cpplint.py --extensions=cc,hh --quiet `${CPPCHECK_FIND}`
)

add_dependencies(codecheck cpplint)
endif()
endfunction()
2 changes: 1 addition & 1 deletion cmake/IgnPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ if(NOT PYTHON_VERSION)
set(PYTHON_VERSION "3")
endif()

find_package(PythonInterp ${PYTHON_VERSION} REQUIRED)
find_package(PythonInterp ${PYTHON_VERSION} QUIET)

0 comments on commit 3aec72e

Please sign in to comment.