Lots of CMake errors about absolute and relative destinations when generating OpenCV 2.4.6 (and some)

After downloading the latest OpenCV source code from github on October 26, 2013, I ran CMake (cmake-gui 2.8. 12) first "Configure" and then "Build" projects. Generating the build directory throws a lot of errors starting with Error in generation process, project files may be invalid

:

error screenshot

The first group, which I find it safe for me to ignore, looks like this:

CMake warning (dev) in Applications /haartraining/CMakeLists.txt:
Policy CMP0022 not set: INTERFACE_LINK_LIBRARIES defines the communication interface. Run "cmake --help-policy CMP0022" for policy information. Use the cmake_policy command to set the policy and suppress this warning.

The target of the static library "opencv_haartraining_engine" has the INTERFACE_LINK_LIBRARIES property. It should be preferred as the source of the communication interface for this library. Ignoring ownership and using the reference implementation like instead. This is a warning for project developers. using -Wno-dev to suppress it.

But the last list of errors worries me more. What is it? Should I act on them? How do I fix them?

CMake error: Install (EXPORT "OpenCVModules") with absolute DESTINATION "/ lib", but export refers to setting target "opencv_core" which has relative DESTINATION "lib".

CMake error: Install (EXPORT "OpenCVModules") assuming absolute DESTINATION "/ lib", but the export refers to setting the target "opencv_core" which has a relative DESINATION "bin".

CMake error: set (EXPORT "OpenCVModules") given the absolute DESTINATION "/ lib", but the export refers to setting the target "opencv_flann" which has a relative DESTINATION "lib".

CMake error: Install (EXPORT "OpenCVModules") with absolute DESTINATION "/ lib", but the export refers to setting the target "opencv_flann" which has a relative "bin" DESTINATION.

[...]

CMake error: Install (EXPORT "OpenCVModules") with absolute DESTINATION "/ lib", but export refers to setting target "opencv_videostab" which has relative DESTINATION "lib".

CMake error: Set (EXPORT "OpenCVModules") assuming absolute DESTINATION "/ lib", but the export refers to setting the target "opencv_videostab" which has a relative "bin" DESTINATION.

cmake-gui screenshot of errors

========== EDIT ===========

Interestingly, the problem is that the CMake value CMAKE_USE_RELATIVE_PATHS

that is present when running CMake in the code for 2.4.6 is missing when running CMake on the latest code. If so, what's the fix?

+1


source to share


1 answer


I used the same situation width, cmake 2.8.12, OpenCV 2.4.6, what I chose for "specify a generator for this project" was VS10 (I used VC10) and selected "default compilers used by default" under him. but I finally got it.



0


source







All Articles