Superbuild Patch applied once but fails to apply on subsequent superbuild run
I have written a custom patch for liblas, it is successfully applied once, but on a subsequent compilation run, the superbuild fails because "patch does not apply". The expected behavior should be to ignore it silently ?
Is there a special format the patch should follow ? (mine doesnt have a comment, plain git diff -r
output)
Are there special git diff
options to use ?
Is this an EOF newlines / CRLF related issue ?
@ben.boeckel have you encountered this before ?
Error output:
[43/62] Enable outside boost options
FAILED: lidarview-superbuild/common-superbuild/liblas/stamp/liblas-liblas-patch-enable-outside-boost-options /home/arnaud/DEV/ouster/build/lidarview-superbuild/common-superbuild/liblas/stamp/liblas-liblas-patch-enable-outside-boost-options
cd /home/arnaud/DEV/ouster/build/lidarview-superbuild/common-superbuild/liblas/src && /usr/bin/git apply --whitespace=fix -p1 /home/arnaud/DEV/ouster/src/Superbuild/lidarview-superbuild/Projects/patches/liblas-enable-outside-boost-options.patch && /home/arnaud/bin/cmake-3.21.2/bin/cmake -E touch /home/arnaud/DEV/ouster/build/lidarview-superbuild/common-superbuild/liblas/stamp/liblas-liblas-patch-enable-outside-boost-options
error: patch failed: CMakeLists.txt:171
error: CMakeLists.txt: patch does not apply
Same behavior when applying the command manually:
git apply --whitespace=fix -p1 /home/arnaud/DEV/ouster/src/Superbuild/lidarview-superbuild/Projects/patches/liblas-enable-outside-boost-options.patch
error: patch failed: CMakeLists.txt:171
error: CMakeLists.txt: patch does not apply
We do have another custom patch that does the same (for PCL), but another one that works fine (Eigen).
Context: In order to fix some LidarView issues, we use liblas master branch from community maintained Github repo, instead of the v1.8.1 zip hosted at Kitware.
Naturally I had to rewrite some patches since line numbers slightly changed, but they are no different from the original ones , e.g :
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4df28710..b1ad62db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -171,8 +171,12 @@ message(STATUS "Searching for Boost 1.38+ - done")
# on windows in the compilation documentation.
if(WIN32)
if (MSVC)
- set(Boost_USE_STATIC_LIBS ON)
- set(Boost_USE_MULTITHREADED ON)
+ if(NOT DEFINED Boost_USE_STATIC_LIBS)
+ set(Boost_USE_STATIC_LIBS ON)
+ endif()
+ if(NOT DEFINED Boost_USE_STATIC_LIBS)
+ set(Boost_USE_MULTITHREADED ON)
+ endif()
endif(MSVC)
endif(WIN32)