Is BUILD_opencv_world now automatically ON?

Hi, all:

I’m trying to build OpenCV-4.7.0 now, but failed with the following ERROR messages, which seem to tell: BUILD_opencv_world is now ON by default. Actually, I remember I always tried to turn it OFF half a year ago while building opencv from source …

Anyway, the ERRORs are as in the pastebin. And I searched ALL occurrences of BUILD_opencv_world:

➜  opencv-4.7.0 grep -rwn "BUILD_opencv_world"
CMakeLists.txt:606:  set(BUILD_opencv_world ON CACHE INTERNAL "")
modules/stitching/CMakeLists.txt:8:if(BUILD_SHARED_LIBS AND BUILD_opencv_world AND OPENCV_WORLD_EXCLUDE_EXTRA_MODULES)
modules/imgcodecs/CMakeLists.txt:177:if(NOT BUILD_opencv_world)
modules/python/CMakeLists.txt:10:elseif(BUILD_opencv_world OR (WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug"))
modules/highgui/CMakeLists.txt:314:if(NOT BUILD_opencv_world)
modules/java/CMakeLists.txt:8:    OR BUILD_opencv_world
doc/tutorials/introduction/windows_install/windows_install.markdown:325:    -   *BUILD_opencv_world* -\> Generate a single "opencv_world" binary (a shared or static library, depending on *BUILD_SHARED_LIBS*) including all the modules instead of a collection of separate binaries, one binary per module.
cmake/OpenCVUtils.cmake:260:  if(BUILD_opencv_world)
cmake/OpenCVUtils.cmake:1436:  if(BUILD_opencv_world AND OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD)
cmake/OpenCVUtils.cmake:1500:      if(BUILD_opencv_world)
cmake/OpenCVModule.cmake:213:    if(NOT OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD OR NOT ${BUILD_opencv_world})
cmake/OpenCVModule.cmake:311:    if(BUILD_opencv_world AND m STREQUAL "opencv_world"
cmake/OpenCVModule.cmake:312:        OR NOT BUILD_opencv_world
cmake/OpenCVModule.cmake:489:    if(BUILD_opencv_world)
cmake/OpenCVModule.cmake:585:            if(BUILD_opencv_world
cmake/OpenCVModule.cmake:637:    if(BUILD_opencv_world)
cmake/OpenCVModule.cmake:878:  if(BUILD_opencv_world AND OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD)
cmake/OpenCVModule.cmake:1204:      if(NOT BUILD_opencv_world)
cmake/OpenCVModule.cmake:1247:      if(NOT BUILD_opencv_world)
cmake/OpenCVModule.cmake:1299:      if(NOT BUILD_opencv_world)
cmake/OpenCVModule.cmake:1344:      if(NOT BUILD_opencv_world)
platforms/winpack_dldt/            BUILD_opencv_world='OFF',
➜  opencv-4.7.0 

So, how can I successfully build OpenCV-4.7.0?


Not for me, I just pulled from the tip of 4.x without setting


with the following configuration output

– Disabled: world

What are your arguments to CMake and your configuration output? Have you tried cleaning the build directory and starting from scratch?

On a seperate but related note, I have never had any issues building the world module with CUDA if that is why you want to disable it? I think there used to be some issues but they must have been resolved for a long time.

I found some tricky staff:

It looks it has something to do with


If I disable both (should be one of the above two), BUILD_opencv_world disappeared for me to turn ON. Currently, by default, BUILD_opencv_world OFF .

Hmmmm… Can’t find any relationshp between
BUILD_opencv_world and WITH_IPP or WITH_ITT.

Finally, successfully built OpenCV-4.7.0 with

WITH_IPP                         ON
WITH_ITT                         ON

Thank you man…

Not sure how I helped but I’m glad you’ve got it working.

I think you can close this issue

now if it is related.