asmlib-opencv icon indicating copy to clipboard operation
asmlib-opencv copied to clipboard

Cannot configure with Cmake on Ubuntu Linux

Open GoogleCodeExporter opened this issue 10 years ago • 2 comments

What steps will reproduce the problem?
1.already done everything on muct.
2.cmake
3.

What is the expected output? What do you see instead?
according to the guide, nothing should be modified to configure with cmake. 
However I saw this.
CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:16 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_core" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:19 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_flann" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:22 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_imgproc" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:25 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_highgui" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:28 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_features2d" because
  another target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:31 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_calib3d" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:34 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_ml" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:37 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_video" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:40 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_legacy" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:43 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_objdetect" because
  another target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:46 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_photo" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:49 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_gpu" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:52 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_ocl" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:55 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_nonfree" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:58 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_contrib" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:61 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_stitching" because
  another target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:64 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_superres" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:67 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_ts" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:70 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_videostab" because
  another target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  annotation/CMakeLists.txt:4 (FIND_PACKAGE)


Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:16 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_core" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:19 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_flann" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:22 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_imgproc" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:25 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_highgui" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:28 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_features2d" because
  another target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:31 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_calib3d" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:34 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_ml" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:37 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_video" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:40 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_legacy" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:43 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_objdetect" because
  another target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:46 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_photo" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:49 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_gpu" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:52 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_ocl" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:55 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_nonfree" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:58 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_contrib" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:61 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_stitching" because
  another target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:64 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_superres" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:67 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_ts" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:70 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_videostab" because
  another target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  demo/CMakeLists.txt:2 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:16 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_core" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:19 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_flann" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:22 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_imgproc" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:25 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_highgui" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:28 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_features2d" because
  another target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:31 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_calib3d" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:34 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_ml" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:37 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_video" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:40 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_legacy" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:43 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_objdetect" because
  another target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:46 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_photo" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:49 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_gpu" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:52 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_ocl" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:55 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_nonfree" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:58 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_contrib" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:61 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_stitching" because
  another target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:64 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_superres" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:67 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_ts" because another
  target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)


CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:70 (ADD_LIBRARY):
  add_library cannot create imported target "opencv_videostab" because
  another target with the same name already exists.
Call Stack (most recent call first):
  /usr/local/share/OpenCV/OpenCVConfig.cmake:44 (include)
  lib/CMakeLists.txt:3 (FIND_PACKAGE)

What version of the product are you using? On what operating system?
The latest version. Ubuntu 12.04 64-bit.

Please provide any additional information below.
I think this is because I have already installed opencv but what should I do?

Original issue reported on code.google.com by [email protected] on 21 Jan 2014 at 2:57

GoogleCodeExporter avatar Mar 14 '15 20:03 GoogleCodeExporter

so how to solve this problem?

phoebe0803 avatar May 14 '18 06:05 phoebe0803

When I encountered this issue it was because I was going back to recompile some extras and opencv was already compiled and installed (from the same source)... I have not found a solution as of yet.

manbehindthemadness avatar Nov 08 '22 20:11 manbehindthemadness