Fix ant/Java detection in cmake scripts
authorMisty De Meo <mistydemeo@gmail.com>
Fri, 22 Mar 2013 16:18:42 +0000 (11:18 -0500)
committerMisty De Meo <mistydemeo@gmail.com>
Fri, 22 Mar 2013 16:18:42 +0000 (11:18 -0500)
commita423afddc143f4b10e09e7b253a420b29f877b6c
tree347b73eb135932b9fdb0219002b935dcd4ec9696
parentec15d6f383e0aae4441153d69129003132afb184
Fix ant/Java detection in cmake scripts

Mac OS X 10.7 and newer don't come with Java installed. They do
include some stub binaries, which ask the user if they want to
install Java when run.

OpenCV's cmake script just checks for the existence of an ant
binary and assumes that Java's available if ant is. As a result,
cmake will configure the build to use Java and it will fail once
it tries to compile the Java bindings.

This fixes the issue by checking for the exit status of
`ant -version` - it exits 0 if Java is installed, or 1
otherwise.
cmake/OpenCVDetectApacheAnt.cmake