mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
Merge pull request #24252 from opencv-pushbot:gitee/alalek/refactor_24218
cmake: revise OPENCV_DNN_BACKEND_DEFAULT integration
This commit is contained in:
commit
62c0556c58
@ -1672,7 +1672,7 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(BUILD_opencv_dnn)
|
||||
if(BUILD_opencv_dnn AND OPENCV_DNN_BACKEND_DEFAULT)
|
||||
status(" Default DNN backend:" ${OPENCV_DNN_BACKEND_DEFAULT})
|
||||
endif()
|
||||
|
||||
|
@ -227,9 +227,10 @@ if(TARGET ocv.3rdparty.openvino AND OPENCV_DNN_OPENVINO)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(OPENCV_DNN_BACKEND_DEFAULT "DNN_BACKEND_OPENCV" CACHE STRING "Default backend used by the DNN module")
|
||||
ocv_append_source_file_compile_definitions("${CMAKE_CURRENT_LIST_DIR}/src/dnn_params.cpp" "OPENCV_DNN_BACKEND_DEFAULT=${OPENCV_DNN_BACKEND_DEFAULT}")
|
||||
|
||||
set(OPENCV_DNN_BACKEND_DEFAULT "" CACHE STRING "Default backend used by the DNN module (DNN_BACKEND_OPENCV if empty)")
|
||||
if(OPENCV_DNN_BACKEND_DEFAULT)
|
||||
ocv_append_source_file_compile_definitions("${CMAKE_CURRENT_LIST_DIR}/src/dnn_params.cpp" "OPENCV_DNN_BACKEND_DEFAULT=${OPENCV_DNN_BACKEND_DEFAULT}")
|
||||
endif()
|
||||
|
||||
ocv_install_used_external_targets(${libs} ${dnn_runtime_libs})
|
||||
|
||||
|
@ -36,7 +36,11 @@ bool getParam_DNN_OPENCL_ALLOW_ALL_DEVICES()
|
||||
int getParam_DNN_BACKEND_DEFAULT()
|
||||
{
|
||||
static int PARAM_DNN_BACKEND_DEFAULT = (int)utils::getConfigurationParameterSizeT("OPENCV_DNN_BACKEND_DEFAULT",
|
||||
#ifdef OPENCV_DNN_BACKEND_DEFAULT
|
||||
(size_t)OPENCV_DNN_BACKEND_DEFAULT
|
||||
#else
|
||||
(size_t)DNN_BACKEND_OPENCV
|
||||
#endif
|
||||
);
|
||||
return PARAM_DNN_BACKEND_DEFAULT;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user