mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 20:03:47 +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:
14
deps/CMakeLists.txt
vendored
14
deps/CMakeLists.txt
vendored
@@ -340,6 +340,20 @@ if(NOT FREETYPE_FOUND)
|
||||
set(FREETYPE_PKG "dep_FREETYPE")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree
|
||||
RESULT_VARIABLE REV_PARSE_RESULT
|
||||
OUTPUT_VARIABLE REV_PARSE_OUTPUT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# Will output "true" and have a 0 return code if within a git repo
|
||||
if((REV_PARSE_RESULT EQUAL 0) AND (REV_PARSE_OUTPUT STREQUAL "true"))
|
||||
set(IN_GIT_REPO TRUE)
|
||||
# Find relative path from root to source used for adjusting patch command
|
||||
file(RELATIVE_PATH BINARY_DIR_REL ${CMAKE_SOURCE_DIR}/.. ${CMAKE_BINARY_DIR})
|
||||
endif ()
|
||||
|
||||
include(OCCT/OCCT.cmake)
|
||||
include(OpenCV/OpenCV.cmake)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user