summaryrefslogtreecommitdiff
blob: 96a0e7e7053f6c2e74acf8dd33fab2f456906ec9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
diff -purN a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt	2015-12-18 15:02:16.000000000 +0000
+++ b/CMakeLists.txt	2016-06-06 17:15:48.006020666 +0100
@@ -209,6 +209,7 @@ OCV_OPTION(WITH_OPENCLAMDFFT   "Include
 OCV_OPTION(WITH_OPENCLAMDBLAS  "Include AMD OpenCL BLAS library support"     ON   IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
 OCV_OPTION(WITH_DIRECTX        "Include DirectX support"                     ON   IF (WIN32 AND NOT WINRT) )
 OCV_OPTION(WITH_INTELPERC      "Include Intel Perceptual Computing support"  OFF  IF (WIN32 AND NOT WINRT) )
+OCV_OPTION(WITH_JAVA           "Include Java support"                        ON)
 OCV_OPTION(WITH_IPP_A          "Include Intel IPP_A support"                 OFF  IF (MSVC OR X86 OR X86_64) )
 OCV_OPTION(WITH_MATLAB         "Include Matlab support"                      ON   IF (NOT ANDROID AND NOT IOS AND NOT WINRT))
 OCV_OPTION(WITH_VA             "Include VA support"                          OFF  IF (UNIX AND NOT ANDROID) )
@@ -562,20 +563,25 @@ endif(BUILD_DOCS)
 include(cmake/OpenCVDetectPython.cmake)
 
 # --- Java Support ---
-include(cmake/OpenCVDetectApacheAnt.cmake)
-if(ANDROID)
-  include(cmake/OpenCVDetectAndroidSDK.cmake)
+If(WITH_JAVA)
+  include(cmake/OpenCVDetectApacheAnt.cmake)
+  if(ANDROID)
+    include(cmake/OpenCVDetectAndroidSDK.cmake)
 
-  if(NOT ANDROID_TOOLS_Pkg_Revision GREATER 13)
-    message(WARNING "OpenCV requires Android SDK tools revision 14 or newer. Otherwise tests and samples will no be compiled.")
+    if(NOT ANDROID_TOOLS_Pkg_Revision GREATER 13)
+      message(WARNING "OpenCV requires Android SDK tools revision 14 or newer. Otherwise tests and samples will no be compiled.")
+    endif()
+  else()
+    find_package(JNI)
   endif()
-else()
-  find_package(JNI)
-endif()
 
-if(ANDROID AND ANDROID_EXECUTABLE AND ANT_EXECUTABLE AND (ANT_VERSION VERSION_GREATER 1.7) AND (ANDROID_TOOLS_Pkg_Revision GREATER 13))
-  SET(CAN_BUILD_ANDROID_PROJECTS TRUE)
+  if(ANDROID AND ANDROID_EXECUTABLE AND ANT_EXECUTABLE AND (ANT_VERSION VERSION_GREATER 1.7) AND (ANDROID_TOOLS_Pkg_Revision GREATER 13))
+    SET(CAN_BUILD_ANDROID_PROJECTS TRUE)
+  else()
+    SET(CAN_BUILD_ANDROID_PROJECTS FALSE)
+  endif()
 else()
+  SET(ANT_EXECUTABLE "")
   SET(CAN_BUILD_ANDROID_PROJECTS FALSE)
 endif()