2 # Find the Flake8 executable and extract the version number
7 # True if the flake8 package was found
9 # The flake8 executable location
11 # A string denoting the version of flake8 that has been found
13 find_host_program(FLAKE8_EXECUTABLE flake8 PATHS /usr/bin)
16 execute_process(COMMAND ${FLAKE8_EXECUTABLE} --version OUTPUT_VARIABLE FLAKE8_VERSION_RAW ERROR_QUIET)
17 if(FLAKE8_VERSION_RAW MATCHES "^([0-9\\.]+[0-9])")
18 set(FLAKE8_VERSION "${CMAKE_MATCH_1}")
20 set(FLAKE8_VERSION "unknown")
24 include(FindPackageHandleStandardArgs)
25 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Flake8 DEFAULT_MSG FLAKE8_EXECUTABLE)
27 mark_as_advanced(FLAKE8_EXECUTABLE FLAKE8_VERSION)