mirror of
https://github.com/opencv/opencv.git
synced 2025-06-12 20:42:53 +08:00
cmake world: allow to build python bindings
This commit is contained in:
parent
36b34465a4
commit
a5d16f09e6
@ -233,7 +233,7 @@ macro(ocv_add_module _name)
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
# excludes module from current configuration
|
# excludes module from current configuration
|
||||||
macro(ocv_module_disable module)
|
macro(ocv_module_disable_ module)
|
||||||
set(__modname ${module})
|
set(__modname ${module})
|
||||||
if(NOT __modname MATCHES "^opencv_")
|
if(NOT __modname MATCHES "^opencv_")
|
||||||
set(__modname opencv_${module})
|
set(__modname opencv_${module})
|
||||||
@ -246,9 +246,12 @@ macro(ocv_module_disable module)
|
|||||||
# touch variable controlling build of the module to suppress "unused variable" CMake warning
|
# touch variable controlling build of the module to suppress "unused variable" CMake warning
|
||||||
endif()
|
endif()
|
||||||
unset(__modname)
|
unset(__modname)
|
||||||
return() # leave the current folder
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
macro(ocv_module_disable module)
|
||||||
|
ocv_module_disable_(${module})
|
||||||
|
return() # leave the current folder
|
||||||
|
endmacro()
|
||||||
|
|
||||||
# collect modules from specified directories
|
# collect modules from specified directories
|
||||||
# NB: must be called only once!
|
# NB: must be called only once!
|
||||||
|
@ -2,16 +2,26 @@
|
|||||||
# CMake file for python support
|
# CMake file for python support
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
if((WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(ANDROID OR APPLE_FRAMEWORK OR WINRT)
|
||||||
OR BUILD_opencv_world
|
set(__disable_python2 ON)
|
||||||
)
|
set(__disable_python3 ON)
|
||||||
ocv_module_disable(python2)
|
elseif(BUILD_opencv_world OR (WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug"))
|
||||||
ocv_module_disable(python3)
|
if(NOT DEFINED BUILD_opencv_python2)
|
||||||
|
set(__disable_python2 ON)
|
||||||
|
endif()
|
||||||
|
if(NOT DEFINED BUILD_opencv_python3)
|
||||||
|
set(__disable_python3 ON)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID OR APPLE_FRAMEWORK OR WINRT)
|
if(__disable_python2)
|
||||||
ocv_module_disable(python2)
|
ocv_module_disable_(python2)
|
||||||
ocv_module_disable(python3)
|
endif()
|
||||||
|
if(__disable_python3)
|
||||||
|
ocv_module_disable_(python3)
|
||||||
|
endif()
|
||||||
|
if(__disable_python2 AND __disable_python3)
|
||||||
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(python2)
|
add_subdirectory(python2)
|
||||||
|
Loading…
Reference in New Issue
Block a user