From cf10bb2b35280b8ad070e4a7d989d5c9c5406129 Mon Sep 17 00:00:00 2001 From: Juan Pablo Samper Date: Wed, 23 Nov 2022 14:13:06 -0800 Subject: [PATCH] Install zstd in an alternate directory (#1172) This prevents the compiled libzstd from being used by the host's cmake executable Signed-off-by: Juan Pablo Samper --- zstd_vendor/CMakeLists.txt | 4 ++-- zstd_vendor/zstd_vendor-extras.cmake | 1 - zstd_vendor/zstd_vendor-extras.cmake.in | 5 +++++ 3 files changed, 7 insertions(+), 3 deletions(-) delete mode 100644 zstd_vendor/zstd_vendor-extras.cmake create mode 100644 zstd_vendor/zstd_vendor-extras.cmake.in diff --git a/zstd_vendor/CMakeLists.txt b/zstd_vendor/CMakeLists.txt index fb6eeaf0ba..ddeaf6cf73 100644 --- a/zstd_vendor/CMakeLists.txt +++ b/zstd_vendor/CMakeLists.txt @@ -52,7 +52,7 @@ macro(build_zstd) install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_install/ - DESTINATION ${CMAKE_INSTALL_PREFIX} + DESTINATION ${CMAKE_INSTALL_PREFIX}/opt/zstd_vendor USE_SOURCE_PERMISSIONS) endmacro() @@ -64,4 +64,4 @@ endif() install(DIRECTORY cmake DESTINATION share/${PROJECT_NAME}) -ament_package(CONFIG_EXTRAS zstd_vendor-extras.cmake) +ament_package(CONFIG_EXTRAS zstd_vendor-extras.cmake.in) diff --git a/zstd_vendor/zstd_vendor-extras.cmake b/zstd_vendor/zstd_vendor-extras.cmake deleted file mode 100644 index 07472acad9..0000000000 --- a/zstd_vendor/zstd_vendor-extras.cmake +++ /dev/null @@ -1 +0,0 @@ -list(INSERT CMAKE_MODULE_PATH 0 "${zstd_vendor_DIR}/Modules") diff --git a/zstd_vendor/zstd_vendor-extras.cmake.in b/zstd_vendor/zstd_vendor-extras.cmake.in new file mode 100644 index 0000000000..40287d457c --- /dev/null +++ b/zstd_vendor/zstd_vendor-extras.cmake.in @@ -0,0 +1,5 @@ +if(NOT DEFINED ENV{zstd_ROOT_DIR}) + set(zstd_ROOT_DIR "${@PROJECT_NAME@_DIR}/../../../opt/zstd_vendor") +endif() + +list(INSERT CMAKE_MODULE_PATH 0 "${zstd_vendor_DIR}/Modules")