vcpkg/ports/opencv2/0002-fix-paths-containing-symbols.patch
Stefano Sinigardi acb370dd6d
[OpenCV] update to v4.6.0 (#25431)
* [OpenCV] update to v3.4.18 and v4.6.0
enable python2 in vcpkg-get-python-package

* fix references

* remove python2 from testing

* restore python2 tests only on windows&x64

* fix references

* [OpenCV2] add jasper patch

* fix references

* update handling multiple versions

* add usage files

* [dbow] fix build

* [dbow] fix version

* fix references

* remove ipp from vcpkg-ci-opencv for opencv3

* [OpenCV2] fix CRT linking with static libs

* fix references

* [dbow3] add support clause now that is CI tested
[cctag] enable opencv4, fix build on osx

* fix references

* [OpenCV2] fix patch

* fix references

* [libharu] bump version

* fix references

* [rtabmap] fix for opencv 4.6

* [rtabmap] fix manifest

* fix references

* remove llvm dependency to ease CI load

* version

* overwrite version

* fixes for mingw

* add mingw patch

* fix references

* [OpenCV2] fix generated config on win32

* fix references

* update version

* update version

* overwrite baseline

* cleanup after merge

* fix references

* [openmvs] trying to diagnose the problem - DO NOT MERGE

* fix references

* restore port version

* fix references

* Revert "[openmvs] trying to diagnose the problem - DO NOT MERGE"

This reverts commit 8bfd0ff4f9.

* Revert "fix references"

This reverts commit 0e915f6eef.

* skip opencv2 and opencv3

* remove again opencv2/3 from vcpkg-ci-opencv

* apply fixes from review

* fix references

* wrong checksum (tested on windows)

* Github-actions fixes (#2)

* Update opencv4.json

* fix github-actions issues

* formating vcpkg.json

* update git-trees

* fix rtabmap license

* fix references

* fix also dbow3 license

* fix references

* [cctag] remove unnecessary patch section

* fix references

Co-authored-by: Frank <65999885+FrankXie05@users.noreply.github.com>
Co-authored-by: FrankXie <v-frankxie@microsoft.com>
Co-authored-by: Matthieu Penant <matthieu.penant@seika.ca>
Co-authored-by: Matthieu Penant <thieum22@hotmail.com>
2022-08-04 17:21:59 -07:00

48 lines
1.6 KiB
Diff

--- 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$")