Skip to content

Commit fe95d5a

Browse files
committed
Merge pull request opencv#10200 from alalek:cmake_fix_dependencies
2 parents 0105518 + 22c0bb7 commit fe95d5a

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

CMakeLists.txt

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ OCV_OPTION(WITH_CUDA "Include NVidia Cuda Runtime support"
197197
OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) library support" ON IF (NOT IOS AND NOT WINRT) )
198198
OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" ON IF (NOT IOS AND NOT WINRT) )
199199
OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" ON IF (NOT IOS AND NOT APPLE) )
200-
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON IF (NOT WINRT) )
200+
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON IF (NOT WINRT AND NOT CMAKE_CROSSCOMPILING) )
201201
OCV_OPTION(WITH_VFW "Include Video for Windows support" ON IF WIN32 )
202202
OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
203203
OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
@@ -257,7 +257,7 @@ OCV_OPTION(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead o
257257
OCV_OPTION(BUILD_opencv_apps "Build utility applications (used for example to train classifiers)" (NOT ANDROID AND NOT WINRT) IF (NOT APPLE_FRAMEWORK) )
258258
OCV_OPTION(BUILD_opencv_js "Build JavaScript bindings by Emscripten" OFF )
259259
OCV_OPTION(BUILD_ANDROID_EXAMPLES "Build examples for Android platform" ON IF ANDROID )
260-
OCV_OPTION(BUILD_DOCS "Create build rules for OpenCV Documentation" ON IF (NOT WINRT OR APPLE_FRAMEWORK))
260+
OCV_OPTION(BUILD_DOCS "Create build rules for OpenCV Documentation" ON IF (NOT WINRT AND NOT APPLE_FRAMEWORK))
261261
OCV_OPTION(BUILD_EXAMPLES "Build all examples" OFF )
262262
OCV_OPTION(BUILD_PACKAGE "Enables 'make package_source' command" ON IF NOT WINRT)
263263
OCV_OPTION(BUILD_PERF_TESTS "Build performance tests" ON IF (NOT APPLE_FRAMEWORK) )
@@ -268,6 +268,8 @@ OCV_OPTION(BUILD_WITH_DYNAMIC_IPP "Enables dynamic linking of IPP (only for st
268268
OCV_OPTION(BUILD_FAT_JAVA_LIB "Create fat java wrapper containing the whole OpenCV library" ON IF NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX )
269269
OCV_OPTION(BUILD_ANDROID_SERVICE "Build OpenCV Manager for Google Play" OFF IF ANDROID )
270270
OCV_OPTION(BUILD_CUDA_STUBS "Build CUDA modules stubs when no CUDA SDK" OFF IF (NOT APPLE_FRAMEWORK) )
271+
OCV_OPTION(BUILD_JAVA "Enable Java support" (ANDROID OR NOT CMAKE_CROSSCOMPILING) IF (ANDROID OR (NOT APPLE_FRAMEWORK AND NOT WINRT)) )
272+
271273

272274
# 3rd party libs
273275
OCV_OPTION(BUILD_ZLIB "Build zlib from source" WIN32 OR APPLE )
@@ -314,7 +316,7 @@ OCV_OPTION(CV_ENABLE_INTRINSICS "Use intrinsic-based optimized code" ON )
314316
OCV_OPTION(CV_DISABLE_OPTIMIZATION "Disable explicit optimized code (dispatched code/intrinsics/loop unrolling/etc)" OFF )
315317
OCV_OPTION(CV_TRACE "Enable OpenCV code trace" ON)
316318

317-
OCV_OPTION(ENABLE_PYLINT "Add target with Pylint checks" (${BUILD_DOCS} OR ${BUILD_EXAMPLES}) )
319+
OCV_OPTION(ENABLE_PYLINT "Add target with Pylint checks" (${BUILD_DOCS} OR ${BUILD_EXAMPLES}) IF (NOT CMAKE_CROSSCOMPILING AND NOT APPLE_FRAMEWORK) )
318320

319321
if(ENABLE_IMPL_COLLECTION)
320322
add_definitions(-DCV_COLLECT_IMPL_DATA)
@@ -514,7 +516,9 @@ if(CMAKE_GENERATOR MATCHES "Makefiles|Ninja" AND "${CMAKE_BUILD_TYPE}" STREQUAL
514516
endif()
515517

516518
# --- Python Support ---
517-
include(cmake/OpenCVDetectPython.cmake)
519+
if(NOT IOS)
520+
include(cmake/OpenCVDetectPython.cmake)
521+
endif()
518522

519523
include(cmake/OpenCVCompilerOptions.cmake)
520524

@@ -608,15 +612,17 @@ else()
608612
endif()
609613

610614
# --- Java Support ---
611-
include(cmake/OpenCVDetectApacheAnt.cmake)
612-
if(ANDROID)
613-
include(cmake/OpenCVDetectAndroidSDK.cmake)
615+
if(BUILD_JAVA)
616+
include(cmake/OpenCVDetectApacheAnt.cmake)
617+
if(ANDROID)
618+
include(cmake/OpenCVDetectAndroidSDK.cmake)
614619

615-
if(NOT ANDROID_TOOLS_Pkg_Revision GREATER 13)
616-
message(WARNING "OpenCV requires Android SDK tools revision 14 or newer. Otherwise tests and samples will no be compiled.")
620+
if(NOT ANDROID_TOOLS_Pkg_Revision GREATER 13)
621+
message(WARNING "OpenCV requires Android SDK tools revision 14 or newer. Otherwise tests and samples will no be compiled.")
622+
endif()
623+
else()
624+
find_package(JNI)
617625
endif()
618-
else()
619-
find_package(JNI)
620626
endif()
621627

622628
if(ENABLE_PYLINT)
@@ -650,7 +656,9 @@ if(WITH_MATLAB)
650656
include(cmake/OpenCVFindMatlab.cmake)
651657
endif()
652658

653-
include(cmake/OpenCVDetectVTK.cmake)
659+
if(WITH_VTK)
660+
include(cmake/OpenCVDetectVTK.cmake)
661+
endif()
654662

655663
if(WITH_OPENVX)
656664
include(cmake/FindOpenVX.cmake)
@@ -1384,7 +1392,7 @@ if(PYLINT_FOUND AND PYLINT_EXECUTABLE)
13841392
endif()
13851393

13861394
# ========================== java ==========================
1387-
if(BUILD_opencv_java)
1395+
if(BUILD_JAVA OR BUILD_opencv_java)
13881396
status("")
13891397
status(" Java:")
13901398
status(" ant:" ANT_EXECUTABLE THEN "${ANT_EXECUTABLE} (ver ${ANT_VERSION})" ELSE NO)

cmake/OpenCVDetectVTK.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
if(NOT WITH_VTK)
2-
return()
3-
endif()
4-
51
# VTK 6.x components
62
find_package(VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
73
IF(VTK_FOUND)

modules/viz/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if(NOT WITH_VTK OR NOT DEFINED HAVE_VTK OR NOT HAVE_VTK)
1+
if(NOT HAVE_VTK)
22
ocv_module_disable(viz)
33
endif()
44

0 commit comments

Comments
 (0)