Commit a9a3b4c6 authored by Arnaud Billon's avatar Arnaud Billon 💬
Browse files

[Patch] Fix Runtime ZLIB-SYSTEM_Qt5 conflict

parent e278d7e0
# reset boost RPATH on OSX
# Patch reset boost RPATH on OSX
# this is applied on LidarView app and tests
# for more information see comments in lidarview.osx-boost-rpath.cmake
install(SCRIPT "LVCore/CMake/scripts/lidarview.osx-boost-rpath.cmake")
# Patch ZLIB RPATH on Unix/OSX
# this is applied on LidarView app and tests
# for more information see comments in lidarview.unix-zlib-link.cmake
if(ENABLE_pcl AND UNIX AND NOT APPLE)
message(WARNING "Forcing zlib.1.2.11 NEEDED using `patchelf` in Lidarplugin to avoid PCL/QT conflicts")
install(SCRIPT "LVCore/CMake/scripts/lidarview.unix-zlib-link.cmake")
endif()
# Output CMakeCacheLog.txt
install(SCRIPT "LVCore/CMake/OutputCMakeCacheLog.cmake")
# Only needed on UNIX (not APPLE)
# Fix a conflict between the built libz V1.2.11, and the one used by a SYSTEM Qt5,
# Only occurs on a system with zlib inferior to 1.2.9 (E.g Ubuntu 16.04).
# This only applies at runtime on the machine in question (Tests), not for packages
#
# The Fix links makes libLidarPlugin.so rely explicitely on the built libz.so.1.2.11
# Requires `sudo apt-get install patchelf`
# Sanitize
if(NOT UNIX)
message(FATAL_ERROR "This patch only Applies to UNIX")
endif()
message(STATUS "Applying Zlib link fix to every test binaries path")
get_filename_component(install_location "${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
# get all app and tests on which to change boost path
file(GLOB app_list LIST_DIRECTORIES false "${install_location}/bin/*")
file(GLOB test_list LIST_DIRECTORIES false "bin/Test*")
foreach (binary_file IN LISTS app_list test_list)
get_filename_component(libboost_name "${binary_file}" NAME)
MESSAGE("Setting link for ${binary_file}")
execute_process(
COMMAND patchelf --add-needed "libz.so.1.2.11" "${binary_file}"
)
endforeach ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment