|
|
@ -12,9 +12,11 @@ |
|
|
|
|
|
|
|
|
|
|
|
find_host_program(PYLINT_EXECUTABLE pylint PATHS /usr/bin) |
|
|
|
find_host_program(PYLINT_EXECUTABLE pylint PATHS /usr/bin) |
|
|
|
|
|
|
|
|
|
|
|
if(PYLINT_EXECUTABLE) |
|
|
|
if(PYLINT_EXECUTABLE AND NOT DEFINED PYLINT_VERSION) |
|
|
|
execute_process(COMMAND ${PYLINT_EXECUTABLE} --version OUTPUT_VARIABLE PYLINT_VERSION_RAW ERROR_QUIET) |
|
|
|
execute_process(COMMAND ${PYLINT_EXECUTABLE} --version RESULT_VARIABLE _result OUTPUT_VARIABLE PYLINT_VERSION_RAW) |
|
|
|
if(PYLINT_VERSION_RAW MATCHES "pylint([^,]*) ([0-9\\.]+[0-9])") |
|
|
|
if(NOT _result EQUAL 0) |
|
|
|
|
|
|
|
ocv_clear_vars(PYLINT_EXECUTABLE PYLINT_VERSION) |
|
|
|
|
|
|
|
elseif(PYLINT_VERSION_RAW MATCHES "pylint([^,]*) ([0-9\\.]+[0-9])") |
|
|
|
set(PYLINT_VERSION "${CMAKE_MATCH_2}") |
|
|
|
set(PYLINT_VERSION "${CMAKE_MATCH_2}") |
|
|
|
else() |
|
|
|
else() |
|
|
|
set(PYLINT_VERSION "unknown") |
|
|
|
set(PYLINT_VERSION "unknown") |
|
|
@ -22,6 +24,9 @@ if(PYLINT_EXECUTABLE) |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs) |
|
|
|
include(FindPackageHandleStandardArgs) |
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Pylint DEFAULT_MSG PYLINT_EXECUTABLE) |
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Pylint |
|
|
|
|
|
|
|
REQUIRED_VARS PYLINT_EXECUTABLE |
|
|
|
|
|
|
|
VERSION_VAR PYLINT_VERSION |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
mark_as_advanced(PYLINT_EXECUTABLE PYLINT_VERSION) |
|
|
|
mark_as_advanced(PYLINT_EXECUTABLE PYLINT_VERSION) |
|
|
|