2018-12-14 08:15:57 +08:00
|
|
|
set(OPENCV_JAVA_SOURCE_VERSION "" CACHE STRING "Java source version (javac Ant target)")
|
|
|
|
set(OPENCV_JAVA_TARGET_VERSION "" CACHE STRING "Java target version (javac Ant target)")
|
|
|
|
|
2012-02-03 19:26:49 +08:00
|
|
|
file(TO_CMAKE_PATH "$ENV{ANT_DIR}" ANT_DIR_ENV_PATH)
|
|
|
|
file(TO_CMAKE_PATH "$ENV{ProgramFiles}" ProgramFiles_ENV_PATH)
|
|
|
|
|
2012-04-14 05:50:59 +08:00
|
|
|
if(CMAKE_HOST_WIN32)
|
|
|
|
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 19:26:49 +08:00
|
|
|
)
|
|
|
|
|
2012-04-14 05:50:59 +08:00
|
|
|
find_host_program(ANT_EXECUTABLE NAMES ${ANT_NAME})
|
|
|
|
|
2012-02-03 19:26:49 +08:00
|
|
|
if(ANT_EXECUTABLE)
|
|
|
|
execute_process(COMMAND ${ANT_EXECUTABLE} -version
|
2013-03-23 00:18:42 +08:00
|
|
|
RESULT_VARIABLE ANT_ERROR_LEVEL
|
2012-02-03 19:26:49 +08:00
|
|
|
OUTPUT_VARIABLE ANT_VERSION_FULL
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
2013-03-23 00:18:42 +08:00
|
|
|
if (ANT_ERROR_LEVEL)
|
|
|
|
unset(ANT_EXECUTABLE)
|
|
|
|
unset(ANT_EXECUTABLE CACHE)
|
|
|
|
else()
|
|
|
|
string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" ANT_VERSION "${ANT_VERSION_FULL}")
|
2019-08-15 01:33:49 +08:00
|
|
|
set(ANT_VERSION "${ANT_VERSION}" CACHE INTERNAL "Detected ant version")
|
2012-02-03 19:26:49 +08:00
|
|
|
|
2017-11-14 22:07:04 +08:00
|
|
|
message(STATUS "Found apache ant: ${ANT_EXECUTABLE} (${ANT_VERSION})")
|
2013-03-23 00:18:42 +08:00
|
|
|
endif()
|
2012-02-03 19:26:49 +08:00
|
|
|
endif()
|