mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
Fix OCCT and OpenCV patching during build (#8465)
* Fix OCCT and OpenCV patching during build The inclusion of the `--directory` flag here isn't necessary because of how `PATCH_COMMAND` applies patches. In fact this causes issues when trying to build from an archive, `--directory` seems to imply `--index` and thus this patch only succeeds if you're inside an initialized git repo. If you simply use the archive without a git repo the build fails at the patch step. * Alter patch command based on git repo status `git apply` has different behavior when inside a git repo vs not. If we're in a git repo we need to fully quality the path for these patches, otherwise we can omit the directory flag. --------- Co-authored-by: Joe Palazzolo <joe@joepalazzolo.net>
This commit is contained in:
6
deps/OpenCV/OpenCV.cmake
vendored
6
deps/OpenCV/OpenCV.cmake
vendored
@@ -4,10 +4,14 @@ else ()
|
||||
set(_use_IPP "-DWITH_IPP=OFF")
|
||||
endif ()
|
||||
|
||||
if (IN_GIT_REPO)
|
||||
set(OpenCV_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_OpenCV-prefix/src/dep_OpenCV)
|
||||
endif ()
|
||||
|
||||
orcaslicer_add_cmake_project(OpenCV
|
||||
URL https://github.com/opencv/opencv/archive/refs/tags/4.6.0.tar.gz
|
||||
URL_HASH SHA256=1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
|
||||
PATCH_COMMAND git apply --directory ${BINARY_DIR_REL}/dep_OpenCV-prefix/src/dep_OpenCV --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-vs2022.patch
|
||||
PATCH_COMMAND git apply ${OpenCV_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-vs2022.patch
|
||||
CMAKE_ARGS
|
||||
-DBUILD_SHARED_LIBS=0
|
||||
-DBUILD_PERE_TESTS=OFF
|
||||
|
||||
Reference in New Issue
Block a user