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:
Diffstat (limited to 'build_files/build_environment/cmake/opencollada.cmake')
-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