mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 09:25:45 +08:00
cmake: update Python linters handling
- exclude from getBuildInformation() - fix pylint version
This commit is contained in:
parent
f821530eb0
commit
625d4fc884
@ -1000,6 +1000,12 @@ if(COMMAND ocv_pylint_finalize)
|
||||
ocv_pylint_add_directory_recurse(${CMAKE_CURRENT_LIST_DIR}/samples/python/tutorial_code)
|
||||
ocv_pylint_finalize()
|
||||
endif()
|
||||
if(TARGET check_pylint)
|
||||
message(STATUS "Registered 'check_pylint' target: using ${PYLINT_EXECUTABLE} (ver: ${PYLINT_VERSION}), checks: ${PYLINT_TOTAL_TARGETS}")
|
||||
endif()
|
||||
if(TARGET check_flake8)
|
||||
message(STATUS "Registered 'check_flake8' target: using ${FLAKE8_EXECUTABLE} (ver: ${FLAKE8_VERSION})")
|
||||
endif()
|
||||
|
||||
if(OPENCV_GENERATE_SETUPVARS)
|
||||
include(cmake/OpenCVGenSetupVars.cmake)
|
||||
@ -1633,12 +1639,6 @@ endif()
|
||||
|
||||
status("")
|
||||
status(" Python (for build):" PYTHON_DEFAULT_AVAILABLE THEN "${PYTHON_DEFAULT_EXECUTABLE}" ELSE NO)
|
||||
if(PYLINT_FOUND AND PYLINT_EXECUTABLE)
|
||||
status(" Pylint:" PYLINT_FOUND THEN "${PYLINT_EXECUTABLE} (ver: ${PYLINT_VERSION}, checks: ${PYLINT_TOTAL_TARGETS})" ELSE NO)
|
||||
endif()
|
||||
if(FLAKE8_FOUND AND FLAKE8_EXECUTABLE)
|
||||
status(" Flake8:" FLAKE8_FOUND THEN "${FLAKE8_EXECUTABLE} (ver: ${FLAKE8_VERSION})" ELSE NO)
|
||||
endif()
|
||||
|
||||
# ========================== java ==========================
|
||||
if(BUILD_JAVA)
|
||||
|
@ -16,7 +16,7 @@ if(PYLINT_EXECUTABLE AND NOT DEFINED PYLINT_VERSION)
|
||||
execute_process(COMMAND ${PYLINT_EXECUTABLE} --version RESULT_VARIABLE _result OUTPUT_VARIABLE PYLINT_VERSION_RAW)
|
||||
if(NOT _result EQUAL 0)
|
||||
ocv_clear_vars(PYLINT_EXECUTABLE PYLINT_VERSION)
|
||||
elseif(PYLINT_VERSION_RAW MATCHES "pylint([^,]*) ([0-9\\.]+[0-9])")
|
||||
elseif(PYLINT_VERSION_RAW MATCHES "pylint([^,\n]*) ([0-9\\.]+[0-9])")
|
||||
set(PYLINT_VERSION "${CMAKE_MATCH_2}")
|
||||
else()
|
||||
set(PYLINT_VERSION "unknown")
|
||||
|
@ -122,7 +122,6 @@ function(ocv_pylint_finalize)
|
||||
|
||||
list(LENGTH PYLINT_TARGET_ID __total)
|
||||
set(PYLINT_TOTAL_TARGETS "${__total}" CACHE INTERNAL "")
|
||||
message(STATUS "Pylint: registered ${__total} targets. Build 'check_pylint' target to run checks (\"cmake --build . --target check_pylint\" or \"make check_pylint\")")
|
||||
configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/pylint.cmake.in" "${CMAKE_BINARY_DIR}/pylint.cmake" @ONLY)
|
||||
|
||||
add_custom_target(check_pylint
|
||||
|
Loading…
Reference in New Issue
Block a user