1 file(TO_CMAKE_PATH "$ENV{ANT_DIR}" ANT_DIR_ENV_PATH)
2 file(TO_CMAKE_PATH "$ENV{ProgramFiles}" ProgramFiles_ENV_PATH)
10 find_host_program(ANT_EXECUTABLE NAMES ${ANT_NAME}
11 PATHS "${ANT_DIR_ENV_PATH}/bin" "${ProgramFiles_ENV_PATH}/apache-ant/bin"
15 find_host_program(ANT_EXECUTABLE NAMES ${ANT_NAME})
18 execute_process(COMMAND ${ANT_EXECUTABLE} -version
19 RESULT_VARIABLE ANT_ERROR_LEVEL
20 OUTPUT_VARIABLE ANT_VERSION_FULL
21 OUTPUT_STRIP_TRAILING_WHITESPACE)
24 unset(ANT_EXECUTABLE CACHE)
26 string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" ANT_VERSION "${ANT_VERSION_FULL}")
27 set(ANT_VERSION "${ANT_VERSION}" CACHE INTERNAL "Detected ant vesion")
29 message(STATUS "Found apache ant ${ANT_VERSION}: ${ANT_EXECUTABLE}")