From 61c159c2ac2f7e857bfe59da83c538f4a3d02951 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Thu, 9 Jun 2022 18:22:42 -0700 Subject: [PATCH] Use CMAKE_STAGING_PREFIX for staging OGRE installation (#861) To maintain build/install phasing correctly, this vendor package is installing the external project to a staging location, which is then recursively copied to the final location during the vendor package's installation phase. The mechanism by which we're currently telling the external project where to install to gives it the impression that that will be the final destination, and it embeds such paths in places like pkgconfig files. The CMAKE_STAGING_PREFIX can be used to override all of the `install()` operations' targets while still telling the project where it will eventually end up, which is pretty much exactly what we're trying to do. Signed-off-by: Scott K Logan (cherry picked from commit 47e91ee0de52dc4d5b0119120cacbef2595d8e6d) --- rviz_ogre_vendor/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rviz_ogre_vendor/CMakeLists.txt b/rviz_ogre_vendor/CMakeLists.txt index 5bf00960c..faf744d8c 100644 --- a/rviz_ogre_vendor/CMakeLists.txt +++ b/rviz_ogre_vendor/CMakeLists.txt @@ -174,7 +174,8 @@ macro(build_ogre) -DOGRE_CONFIG_THREADS:STRING=0 -DOGRE_RESOURCEMANAGER_STRICT:STRING=2 -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON - -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/ogre_install + -DCMAKE_STAGING_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/ogre_install + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/opt/rviz_ogre_vendor -DOGRE_BUILD_LIBS_AS_FRAMEWORKS:BOOL=OFF -DOGRE_BUILD_COMPONENT_PYTHON:BOOL=FALSE -DOGRE_BUILD_COMPONENT_JAVA:BOOL=FALSE @@ -201,7 +202,7 @@ macro(build_ogre) DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ogre_install/ DESTINATION - ${CMAKE_INSTALL_PREFIX}/opt/rviz_ogre_vendor + opt/rviz_ogre_vendor USE_SOURCE_PERMISSIONS ) endmacro()