CMakeLists.txt 1021 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # ----------------------------------------------------------------------------
  2. # CMake file for python support
  3. # ----------------------------------------------------------------------------
  4. if(DEFINED OPENCV_INITIAL_PASS) # OpenCV build
  5. if(ANDROID OR APPLE_FRAMEWORK OR WINRT)
  6. ocv_module_disable_(python2)
  7. ocv_module_disable_(python3)
  8. return()
  9. elseif(BUILD_opencv_world OR (WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug"))
  10. if(NOT DEFINED BUILD_opencv_python2)
  11. set(__disable_python2 ON)
  12. endif()
  13. if(NOT DEFINED BUILD_opencv_python3)
  14. set(__disable_python3 ON)
  15. endif()
  16. endif()
  17. add_subdirectory(bindings)
  18. add_subdirectory(test)
  19. if(__disable_python2)
  20. ocv_module_disable_(python2)
  21. endif()
  22. if(__disable_python3)
  23. ocv_module_disable_(python3)
  24. endif()
  25. if(__disable_python2 AND __disable_python3)
  26. return()
  27. endif()
  28. add_subdirectory(python2)
  29. add_subdirectory(python3)
  30. else() # standalone build
  31. cmake_minimum_required(VERSION 2.8.12)
  32. project(OpenCVPython CXX C)
  33. include("./standalone.cmake")
  34. endif()