Handle absolute OPENCV_INCLUDE_INSTALL_PATH correctly#14925
Handle absolute OPENCV_INCLUDE_INSTALL_PATH correctly#14925opencv-pushbot merged 1 commit intoopencv:3.4from
Conversation
In case OPENCV_INCLUDE_INSTALL_PATH is absolute (i.e. starts with a "/"), the path ends up with a double "/". While this is mostly equivalent to a single slash, it may have a nasty side effect when: - OpenCV_INSTALL_PATH is empty - OPENCV_INCLUDE_INSTALL_PATH is "/usr/include" - the calling build script uses "-isystem" to specify the path to the headers of dependencies (to avoid warnings) Specifying "-isystem /usr/include" breaks the path ordering, and GCC can no longer find its "stdlib.h", thus CMake filters such statements. Unfortunately it fails to do so when using "//usr/include".
It should not (by CMake guidelines). Otherwise you break staging installations with |
|
No, thats not correct, see and CMAKE_INSTALL_FULL_ i.e. CMAKE_INSTALL_* is definitely allowed to be an absolute dir. |
|
We are about different things. All
How it can be empty?
Finally I believe it should be resolved in a different way.
Probably OpenCVConfig.cmake should filter out entries which intersects with |
|
At least NixOS and openSUSE use absolute paths for CMAKE_INSTALL_<dir>, so these break. To give you another data point:
From the generated file: |
|
Please try this fix with your configurations: alalek@pr14925_fix P.S. |
alalek
left a comment
There was a problem hiding this comment.
Lets put it in - it should not break anything.
In case OPENCV_INCLUDE_INSTALL_PATH is absolute (i.e. starts with a "/"),
the path ends up with a double "/".
While this is mostly equivalent to a single slash, it may have a nasty
side effect when:
headers of dependencies (to avoid warnings)
Specifying "-isystem /usr/include" breaks the path ordering, and GCC can
no longer find its "stdlib.h", thus CMake filters such statements.
Unfortunately it fails to do so when using "//usr/include".