2012-02-03 12:26:49 +01:00
|
|
|
file(TO_CMAKE_PATH "$ENV{ANT_DIR}" ANT_DIR_ENV_PATH)
|
|
|
|
file(TO_CMAKE_PATH "$ENV{ProgramFiles}" ProgramFiles_ENV_PATH)
|
|
|
|
|
2012-04-12 17:29:50 +02:00
|
|
|
if(CMAKE_HOST_WIN32)
|
2012-04-10 13:59:00 +02:00
|
|
|
set(ANT_NAME ant.bat)
|
|
|
|
else()
|
|
|
|
set(ANT_NAME ant)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_host_program(ANT_EXECUTABLE NAMES ${ANT_NAME}
|
|
|
|
PATHS "${ANT_DIR_ENV_PATH}/bin" "${ProgramFiles_ENV_PATH}/apache-ant/bin"
|
|
|
|
NO_DEFAULT_PATH
|
2012-02-03 12:26:49 +01:00
|
|
|
)
|
|
|
|
|
2012-04-10 13:59:00 +02:00
|
|
|
find_host_program(ANT_EXECUTABLE NAMES ${ANT_NAME})
|
|
|
|
|
2012-02-03 12:26:49 +01:00
|
|
|
if(ANT_EXECUTABLE)
|
|
|
|
execute_process(COMMAND ${ANT_EXECUTABLE} -version
|
|
|
|
OUTPUT_VARIABLE ANT_VERSION_FULL
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" ANT_VERSION "${ANT_VERSION_FULL}")
|
2012-03-16 10:16:31 +01:00
|
|
|
set(ANT_VERSION "${ANT_VERSION}" CACHE INTERNAL "Detected ant vesion")
|
2012-02-03 12:26:49 +01:00
|
|
|
|
2012-04-16 09:24:15 +02:00
|
|
|
message(STATUS "Found apache ant ${ANT_VERSION}: ${ANT_EXECUTABLE}")
|
2012-02-03 12:26:49 +01:00
|
|
|
endif()
|