mirror of
https://github.com/opencv/opencv.git
synced 2025-08-05 22:19:14 +08:00
Handle absolute OPENCV_INCLUDE_INSTALL_PATH correctly
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".
This commit is contained in:
parent
8937e8756e
commit
0a45b8c478
@ -68,7 +68,11 @@ configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.
|
||||
# Part 2/3: ${BIN_DIR}/unix-install/OpenCVConfig.cmake -> For use *with* "make install"
|
||||
# -------------------------------------------------------------------------------------------
|
||||
file(RELATIVE_PATH OpenCV_INSTALL_PATH_RELATIVE_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/${OPENCV_CONFIG_INSTALL_PATH}/" ${CMAKE_INSTALL_PREFIX})
|
||||
set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}\" \"\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}/opencv\"")
|
||||
if (IS_ABSOLUTE ${OPENCV_INCLUDE_INSTALL_PATH})
|
||||
set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"${OPENCV_INCLUDE_INSTALL_PATH}\" \"${OPENCV_INCLUDE_INSTALL_PATH}/opencv\"")
|
||||
else()
|
||||
set(OpenCV_INCLUDE_DIRS_CONFIGCMAKE "\"\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}\" \"\${OpenCV_INSTALL_PATH}/${OPENCV_INCLUDE_INSTALL_PATH}/opencv\"")
|
||||
endif()
|
||||
|
||||
if(USE_IPPICV)
|
||||
file(RELATIVE_PATH IPPICV_INSTALL_PATH_RELATIVE_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}" "${IPPICV_INSTALL_PATH}")
|
||||
|
Loading…
Reference in New Issue
Block a user