diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/opencv2/0002-fix-paths-containing-symbols.patch | |
Diffstat (limited to 'vcpkg/ports/opencv2/0002-fix-paths-containing-symbols.patch')
| -rw-r--r-- | vcpkg/ports/opencv2/0002-fix-paths-containing-symbols.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/vcpkg/ports/opencv2/0002-fix-paths-containing-symbols.patch b/vcpkg/ports/opencv2/0002-fix-paths-containing-symbols.patch new file mode 100644 index 0000000..c24b5eb --- /dev/null +++ b/vcpkg/ports/opencv2/0002-fix-paths-containing-symbols.patch @@ -0,0 +1,47 @@ +--- a/cmake/OpenCVUtils.cmake ++++ b/cmake/OpenCVUtils.cmake +@@ -82,12 +82,42 @@ macro(ocv_check_environment_variables) + endforeach() + endmacro() + ++# check if "sub" (file or dir) is below "dir" ++function(is_subdir res dir sub ) ++ get_filename_component(dir "${dir}" ABSOLUTE) ++ get_filename_component(sub "${sub}" ABSOLUTE) ++ file(TO_CMAKE_PATH "${dir}" dir) ++ file(TO_CMAKE_PATH "${sub}" sub) ++ set(dir "${dir}/") ++ string(LENGTH "${dir}" len) ++ string(LENGTH "${sub}" len_sub) ++ if(NOT len GREATER len_sub) ++ string(SUBSTRING "${sub}" 0 ${len} prefix) ++ endif() ++ if(prefix AND prefix STREQUAL dir) ++ set(${res} TRUE PARENT_SCOPE) ++ else() ++ set(${res} FALSE PARENT_SCOPE) ++ endif() ++endfunction() ++ ++function(ocv_is_opencv_directory result_var dir) ++ set(result FALSE) ++ foreach(parent ${OpenCV_SOURCE_DIR} ${OpenCV_BINARY_DIR} ${OPENCV_EXTRA_MODULES_PATH}) ++ is_subdir(result "${parent}" "${dir}") ++ if(result) ++ break() ++ endif() ++ endforeach() ++ set(${result_var} ${result} PARENT_SCOPE) ++endfunction() ++ + # adds include directories in such a way that directories from the OpenCV source tree go first + function(ocv_include_directories) + set(__add_before "") + foreach(dir ${ARGN}) +- get_filename_component(__abs_dir "${dir}" ABSOLUTE) +- if("${__abs_dir}" MATCHES "^${OpenCV_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${OpenCV_BINARY_DIR}") ++ ocv_is_opencv_directory(__is_opencv_dir "${dir}") ++ if(__is_opencv_dir) + list(APPEND __add_before "${dir}") + elseif(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND + dir MATCHES "/usr/include$") |