# Is BUILD\_opencv\_world now automatically ON?

**URL:** <https://forum.opencv.org/t/is-build-opencv-world-now-automatically-on/13590>\
**Category:** Uncategorized\
**Tags:** build\
**Created:** [June 19, 2023, 8:26am UTC](https://forum.opencv.org/t/is-build-opencv-world-now-automatically-on/13590 "2023-06-19T08:26:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiapei100](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/jiapei100/32/2661_2.png) [@jiapei100](https://forum.opencv.org/u/jiapei100)\
**Post date:** [June 19, 2023, 8:26am UTC](https://forum.opencv.org/t/is-build-opencv-world-now-automatically-on/13590/1 "2023-06-19T08:26:49Z")

</div>

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 **ERROR** s are as in the [pastebin](https://pastebin.com/EvxsiKph). And I searched **ALL** occurrences of **BUILD\_opencv\_world** :

```console
➜ opencv-4.7.0 grep -rwn "BUILD_opencv_world"
build/CMakeCache.txt:2339:BUILD_opencv_world:INTERNAL=ON
build/CMakeVars.txt:118:BUILD_opencv_world=ON
CMakeLists.txt:605:if((INSTALL_CREATE_DISTRIB AND BUILD_SHARED_LIBS AND NOT DEFINED BUILD_opencv_world) OR APPLE_FRAMEWORK)
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_package.py:356: BUILD_opencv_world='OFF',
➜ opencv-4.7.0 

```

So, how can I successfully build **OpenCV-4.7.0**?

Cheers

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [June 19, 2023, 8:46am UTC](https://forum.opencv.org/t/is-build-opencv-world-now-automatically-on/13590/2 "2023-06-19T08:46:17Z")

</div>

> [@jiapei100](#):
>
> which seem to tell: **BUILD\_opencv\_world** is now **ON by default**

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

> -DBUILD\_opencv\_world=ON

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.

---

<div class="post-metadata">

**Author:** ![jiapei100](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/jiapei100/32/2661_2.png) [@jiapei100](https://forum.opencv.org/u/jiapei100)\
**Post date:** [June 19, 2023, 4:42pm UTC](https://forum.opencv.org/t/is-build-opencv-world-now-automatically-on/13590/3 "2023-06-19T16:42:36Z")

</div>

I found some tricky staff:

It looks it has something to do with

- WITH\_IPP
- WITH\_ITT

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`.

---

<div class="post-metadata">

**Author:** ![jiapei100](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/jiapei100/32/2661_2.png) [@jiapei100](https://forum.opencv.org/u/jiapei100)\
**Post date:** [June 20, 2023, 2:23am UTC](https://forum.opencv.org/t/is-build-opencv-world-now-automatically-on/13590/4 "2023-06-20T02:23:12Z")

</div>

Finally, successfully built **OpenCV-4.7.0** with

```console
WITH_IPP ON
WITH_ITT ON

```

Thank you man…

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [June 20, 2023, 4:30am UTC](https://forum.opencv.org/t/is-build-opencv-world-now-automatically-on/13590/5 "2023-06-20T04:30:49Z")

</div>

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

I think you can close this issue

> <https://github.com/opencv/opencv/issues/23826>
>
> \### System Information
> 
> \- OpenCV version: 4.7.0
> \- Operating System / Platform…: Ubuntu 22.04
> \- Compiler & compiler version: gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
> \- Python version: Python 3.10.6
> 
> \### Detailed description
> 
> Just trying to build OpenCV git of today: June 18, 2023. (4.7.0), but failed to configure:
> 
> \`\`\`console
> CMake Error at /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:1767 (file):
> Error evaluating generator expression:
> 
> $\<TARGET\_PROPERTY:QT\_TESTCASE\_BUILDDIR\>
> 
> $\<TARGET\_PROPERTY:prop\> may only be used with binary targets. It may not
> be used with add\_custom\_command or add\_custom\_target. Specify the target
> to read a property from using the $\<TARGET\_PROPERTY:tgt,prop\> signature
> instead.
> Call Stack (most recent call first):
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:2085 (CUDA\_WRAP\_SRCS)
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:2098 (cuda\_compile\_base)
> cmake/OpenCVDetectCUDA.cmake:451 (CUDA\_COMPILE)
> cmake/OpenCVUtils.cmake:1556 (ocv\_cuda\_compile)
> cmake/OpenCVModule.cmake:989 (ocv\_add\_library)
> cmake/OpenCVModule.cmake:905 (\_ocv\_create\_module)
> modules/world/CMakeLists.txt:60 (ocv\_create\_module)
> 
> CMake Error at /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:1767 (file):
> Error evaluating generator expression:
> 
> $\<TARGET\_PROPERTY:QT\_TESTCASE\_BUILDDIR\>
> 
> $\<TARGET\_PROPERTY:prop\> may only be used with binary targets. It may not
> be used with add\_custom\_command or add\_custom\_target. Specify the target
> to read a property from using the $\<TARGET\_PROPERTY:tgt,prop\> signature
> instead.
> Call Stack (most recent call first):
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:2085 (CUDA\_WRAP\_SRCS)
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:2098 (cuda\_compile\_base)
> cmake/OpenCVDetectCUDA.cmake:451 (CUDA\_COMPILE)
> cmake/OpenCVUtils.cmake:1556 (ocv\_cuda\_compile)
> cmake/OpenCVModule.cmake:989 (ocv\_add\_library)
> cmake/OpenCVModule.cmake:905 (\_ocv\_create\_module)
> modules/world/CMakeLists.txt:60 (ocv\_create\_module)
> 
> CMake Error at /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:1767 (file):
> Error evaluating generator expression:
> 
> $\<TARGET\_PROPERTY:QT\_TESTCASE\_BUILDDIR\>
> 
> $\<TARGET\_PROPERTY:prop\> may only be used with binary targets. It may not
> be used with add\_custom\_command or add\_custom\_target. Specify the target
> to read a property from using the $\<TARGET\_PROPERTY:tgt,prop\> signature
> instead.
> Call Stack (most recent call first):
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:2085 (CUDA\_WRAP\_SRCS)
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:2098 (cuda\_compile\_base)
> cmake/OpenCVDetectCUDA.cmake:451 (CUDA\_COMPILE)
> cmake/OpenCVUtils.cmake:1556 (ocv\_cuda\_compile)
> cmake/OpenCVModule.cmake:989 (ocv\_add\_library)
> cmake/OpenCVModule.cmake:905 (\_ocv\_create\_module)
> modules/world/CMakeLists.txt:60 (ocv\_create\_module)
> 
> CMake Error at /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:1767 (file):
> Error evaluating generator expression:
> 
> $\<TARGET\_PROPERTY:QT\_TESTCASE\_BUILDDIR\>
> 
> $\<TARGET\_PROPERTY:prop\> may only be used with binary targets. It may not
> be used with add\_custom\_command or add\_custom\_target. Specify the target
> to read a property from using the $\<TARGET\_PROPERTY:tgt,prop\> signature
> instead.
> Call Stack (most recent call first):
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:2085 (CUDA\_WRAP\_SRCS)
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:2098 (cuda\_compile\_base)
> cmake/OpenCVDetectCUDA.cmake:451 (CUDA\_COMPILE)
> 
> ......
> 
> CMake Error at /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:1767 (file):
> Error evaluating generator expression:
> 
> $\<TARGET\_PROPERTY:QT\_TESTCASE\_BUILDDIR\>
> 
> $\<TARGET\_PROPERTY:prop\> may only be used with binary targets. It may not
> be used with add\_custom\_command or add\_custom\_target. Specify the target
> to read a property from using the $\<TARGET\_PROPERTY:tgt,prop\> signature
> instead.
> Call Stack (most recent call first):
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:2085 (CUDA\_WRAP\_SRCS)
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:2098 (cuda\_compile\_base)
> cmake/OpenCVDetectCUDA.cmake:451 (CUDA\_COMPILE)
> cmake/OpenCVUtils.cmake:1556 (ocv\_cuda\_compile)
> cmake/OpenCVModule.cmake:989 (ocv\_add\_library)
> cmake/OpenCVModule.cmake:905 (\_ocv\_create\_module)
> modules/world/CMakeLists.txt:60 (ocv\_create\_module)
> 
> CMake Error at /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:1767 (file):
> Error evaluating generator expression:
> 
> $\<TARGET\_PROPERTY:QT\_TESTCASE\_BUILDDIR\>
> 
> $\<TARGET\_PROPERTY:prop\> may only be used with binary targets. It may not
> be used with add\_custom\_command or add\_custom\_target. Specify the target
> to read a property from using the $\<TARGET\_PROPERTY:tgt,prop\> signature
> instead.
> Call Stack (most recent call first):
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:2085 (CUDA\_WRAP\_SRCS)
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:2098 (cuda\_compile\_base)
> cmake/OpenCVDetectCUDA.cmake:451 (CUDA\_COMPILE)
> cmake/OpenCVUtils.cmake:1556 (ocv\_cuda\_compile)
> cmake/OpenCVModule.cmake:989 (ocv\_add\_library)
> cmake/OpenCVModule.cmake:905 (\_ocv\_create\_module)
> modules/world/CMakeLists.txt:60 (ocv\_create\_module)
> 
> CMake Error at /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:1767 (file):
> Error evaluating generator expression:
> 
> $\<TARGET\_PROPERTY:QT\_TESTCASE\_BUILDDIR\>
> 
> $\<TARGET\_PROPERTY:prop\> may only be used with binary targets. It may not
> be used with add\_custom\_command or add\_custom\_target. Specify the target
> to read a property from using the $\<TARGET\_PROPERTY:tgt,prop\> signature
> instead.
> Call Stack (most recent call first):
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:2085 (CUDA\_WRAP\_SRCS)
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:2098 (cuda\_compile\_base)
> cmake/OpenCVDetectCUDA.cmake:451 (CUDA\_COMPILE)
> cmake/OpenCVUtils.cmake:1556 (ocv\_cuda\_compile)
> cmake/OpenCVModule.cmake:989 (ocv\_add\_library)
> cmake/OpenCVModule.cmake:905 (\_ocv\_create\_module)
> modules/world/CMakeLists.txt:60 (ocv\_create\_module)
> 
> CMake Error at /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:1767 (file):
> Error evaluating generator expression:
> 
> $\<TARGET\_PROPERTY:QT\_TESTCASE\_BUILDDIR\>
> 
> $\<TARGET\_PROPERTY:prop\> may only be used with binary targets. It may not
> be used with add\_custom\_command or add\_custom\_target. Specify the target
> to read a property from using the $\<TARGET\_PROPERTY:tgt,prop\> signature
> instead.
> Call Stack (most recent call first):
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:2085 (CUDA\_WRAP\_SRCS)
> /usr/local/share/cmake-3.26/Modules/FindCUDA.cmake:20
> \`\`\`
> 
> 
> 
> \### Steps to reproduce
> 
> Just trying the cmake configuration.
> 
> \### Issue submission checklist
> 
> \- \[X\] I report the issue, it's not a question
> \- \[X\] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
> \- \[X\] I updated to the latest OpenCV version and the issue is still there
> \- \[X\] There is reproducer code and related data files (videos, images, onnx, etc)

now if it is related.
