opencv/cmake/vars/EnableModeVars.cmake
Francesco Petrogalli b928ebdd53
Merge pull request #19985 from fpetrogalli:disable_threads
* [build][option] Introduce `OPENCV_DISABLE_THREAD_SUPPORT` option.

The option forces the library to build without thread support.

* update handling of OPENCV_DISABLE_THREAD_SUPPORT

- reduce amount of #if conditions

* [to squash] cmake: apply mode vars in toolchains too

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-07-08 20:21:21 +00:00

19 lines
569 B
CMake

set(__OCV_MODE_VARS_DIR "${CMAKE_CURRENT_LIST_DIR}")
macro(ocv_change_mode_var)
set(__var "${ARGV0}")
set(__mode "${ARGV1}")
set(__value "${ARGV2}")
if(__mode STREQUAL "MODIFIED_ACCESS" AND __value)
if(NOT __applied_mode_${__var})
include("${__OCV_MODE_VARS_DIR}/${__var}.cmake")
set(__applied_mode_${__var} 1)
else()
#message("Mode is already applied: ${__var}")
endif()
endif()
endmacro()
variable_watch(OPENCV_DISABLE_THREAD_SUPPORT ocv_change_mode_var)
set(OPENCV_DISABLE_THREAD_SUPPORT "${OPENCV_DISABLE_THREAD_SUPPORT}")