Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-10-25 09:49:14 +0300
committerCampbell Barton <campbell@blender.org>2022-10-25 09:51:30 +0300
commit3e292404d27dc5aaddc2fcca67ceedf7e30d2cbc (patch)
tree91a1cbd6a8ef4808be802bd6ed37f73d43ef08a4 /build_files
parent059d9631924366ba66b0cacf50cb5dad95889fe2 (diff)
Build: fix/workaround for the opencollada.diff not applying on Linux
Diffstat (limited to 'build_files')
-rw-r--r--build_files/build_environment/cmake/opencollada.cmake18
1 files changed, 17 insertions, 1 deletions
diff --git a/build_files/build_environment/cmake/opencollada.cmake b/build_files/build_environment/cmake/opencollada.cmake
index 9473aafbe88..b1a3028debd 100644
--- a/build_files/build_environment/cmake/opencollada.cmake
+++ b/build_files/build_environment/cmake/opencollada.cmake
@@ -4,6 +4,18 @@ if(UNIX)
set(OPENCOLLADA_EXTRA_ARGS
-DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
-DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2.a)
+
+ # WARNING: the patch contains mixed UNIX and DOS line endings
+ # as does the OPENCOLLADA package, if this can be corrected upstream that would be better.
+ # For now use `sed` to force UNIX line endings so the patch applies.
+ # Needed as neither ignoring white-space or applying as a binary resolve this problem.
+ set(PATCH_MAYBE_DOS2UNIX_CMD
+ sed -i "s/\\r//"
+ ${PATCH_DIR}/opencollada.diff
+ ${BUILD_DIR}/opencollada/src/external_opencollada/CMakeLists.txt
+ ${BUILD_DIR}/opencollada/src/external_opencollada/Externals/LibXML/CMakeLists.txt &&
+ )
+
else()
set(OPENCOLLADA_EXTRA_ARGS
-DCMAKE_DEBUG_POSTFIX=_d
@@ -14,6 +26,7 @@ else()
else()
list(APPEND OPENCOLLADA_EXTRA_ARGS -DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2sd.lib)
endif()
+ set(PATCH_MAYBE_DOS2UNIX_CMD)
endif()
ExternalProject_Add(external_opencollada
@@ -21,11 +34,14 @@ ExternalProject_Add(external_opencollada
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENCOLLADA_HASH_TYPE}=${OPENCOLLADA_HASH}
PREFIX ${BUILD_DIR}/opencollada
- PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/opencollada/src/external_opencollada < ${PATCH_DIR}/opencollada.diff
+ PATCH_COMMAND
+ ${PATCH_MAYBE_DOS2UNIX_CMD}
+ ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/opencollada/src/external_opencollada < ${PATCH_DIR}/opencollada.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opencollada ${DEFAULT_CMAKE_FLAGS} ${OPENCOLLADA_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/opencollada
)
+unset(PATCH_MAYBE_DOS2UNIX_CMD)
add_dependencies(
external_opencollada