see: http://code.opencv.org/issues/2897
The order of the 2 conditions is really important, as every MATCHES
operator sets ${CMAKE_MATCH_1}, which is needed inside the condition
block. Ideally, this should be done using a single regex with a
negative forward lookahead, but CMake doesn't seem to support this
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.(cherry picked from commit a423afddc1)
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.
find_package(OpenCV) should not include_directories by default, that is not standard afaik. Plus that creates problems when creating the ROS package :)
* fix path to libraries in Android SDK
* allow to link to opencv_java.so as Android.mk does
To link to opencv_java.so you can either change your cmake to find OpenCV as
find_package(OpenCV opencv_java)
or pass -DOpenCV_FIND_COMPONENTS=opencv_java to your cmake command