gpt4 book ai didi

ubuntu - 尝试在 Ubuntu 上构建 OpenCV 3 世界模块时出现 CMake 不存在目标错误

转载 作者:行者123 更新时间:2023-12-04 18:34:21 32 4
gpt4 key购买 nike

我目前正在尝试在 Ubuntu 上构建 OpenCV 3。如果我只是使用默认设置运行 CMake,一切正常(配置 + 生成)并且生成的 makefile 也可以毫无问题地编译。但是,我还想构建 opencv_world 模块。因此我在 CMake ( BUILD_opencv_world ) 中启用了相应的选项。不幸的是,这样我得到了很多错误,比如 get_target_property() called with non-existent target "opencv_shape". ... CMakeLists.txt:765 (ocv_get_all_libs)当我点击配置按钮时:

...
Processing WORLD modules...
module opencv_hal...
module opencv_core...
module opencv_flann...
module opencv_imgproc...
module opencv_ml...
module opencv_photo...
module opencv_video...
module opencv_imgcodecs...
module opencv_shape...
module opencv_videoio...
videoio: Removing WinRT API headers by default
module opencv_highgui...
module opencv_objdetect...
module opencv_superres...
module opencv_features2d...
module opencv_calib3d...
module opencv_stitching...
module opencv_videostab...
Processing WORLD modules... DONE
Processing module opencv_ts...
CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_calib3d".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_core".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_features2d".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_flann".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_hal".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_highgui".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_imgcodecs".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_imgproc".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_ml".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_objdetect".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_photo".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_shape".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_stitching".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_superres".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_video".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_videoio".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_videostab".
Call Stack (most recent call first):
cmake/OpenCVGenPkgconfig.cmake:38 (ocv_get_all_libs)
CMakeLists.txt:648 (include)
This warning is for project developers. Use -Wno-dev to suppress it.


General configuration for OpenCV 3.0.0 =====================================
Version control: unknown

Platform:
Host: Linux 3.19.0-15-generic x86_64
CMake: 3.0.2
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: Release

C/C++:
Built as dynamic libs?: YES
C++ Compiler: /usr/bin/c++ (ver 4.9.2)
C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: /usr/bin/cc
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release):
Linker flags (Debug):
Precompiled headers: YES
CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_calib3d".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_core".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_features2d".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_flann".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_hal".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_highgui".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_imgcodecs".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_imgproc".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_ml".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_objdetect".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_photo".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_shape".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_stitching".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_superres".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_video".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_videoio".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/OpenCVUtils.cmake:798 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

get_target_property() called with non-existent target "opencv_videostab".
Call Stack (most recent call first):
CMakeLists.txt:765 (ocv_get_all_libs)
This warning is for project developers. Use -Wno-dev to suppress it.

Extra dependencies: dl m pthread rt
3rdparty dependencies: zlib libjpeg libwebp libpng libtiff libjasper IlmImf ippicv

OpenCV modules:
To be built: hal core flann imgproc ml photo video imgcodecs shape videoio highgui objdetect superres ts features2d calib3d stitching videostab world
Disabled: -
Disabled by dependency: -
Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 viz
...

有没有人知道这里可能是什么问题?

最佳答案

不确定这是否是您的问题的原因,但我遇到了类似的错误,而我的原因是 CMake 配置文件中的目标名称与系统中已安装依赖项的名称不同 .
我可以通过查看在 /usr/lib/x86_64-linux-gnu/cmake/<that target's name> 中声明目标的依赖项的“目标导入文件”来检查这一点。 ,并将其与依赖项目的 CMake 配置文件进行比较。

关于ubuntu - 尝试在 Ubuntu 上构建 OpenCV 3 世界模块时出现 CMake 不存在目标错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31346696/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com