From 786b42ab6c33300b9eb4df2798c14c50817460ce Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Mon, 10 Jul 2023 21:28:18 -0700 Subject: [PATCH] Use cmake extras path variables (#359) Use PROJECT_CMAKE_EXTRAS_INSTALL_DIR and PROJECT_CMAKE_EXTRAS_PATH_TO_PREFIX to improve support for arch-dependent lib folders. Signed-off-by: Steve Peters --- CMakeLists.txt | 2 +- gz-msgs-extras.cmake.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 725b69c2..42946612 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ gz_configure_project(VERSION_SUFFIX # Install cmake support files install( DIRECTORY cmake/ - DESTINATION "lib/cmake/${PROJECT_NAME}" + DESTINATION "${PROJECT_CMAKE_EXTRAS_INSTALL_DIR}" ) #============================================================================ diff --git a/gz-msgs-extras.cmake.in b/gz-msgs-extras.cmake.in index aceea59d..e3e1705e 100644 --- a/gz-msgs-extras.cmake.in +++ b/gz-msgs-extras.cmake.in @@ -22,7 +22,7 @@ include(${@PROJECT_NAME@_DIR}/gz_msgs_factory.cmake) include(${@PROJECT_NAME@_DIR}/gz_msgs_generate.cmake) include(${@PROJECT_NAME@_DIR}/target_link_messages.cmake) -set(@PROJECT_NAME@_INSTALL_PATH "${@PROJECT_NAME@_DIR}/../../..") +set(@PROJECT_NAME@_INSTALL_PATH "${@PROJECT_NAME@_DIR}/@PROJECT_CMAKE_EXTRAS_PATH_TO_PREFIX@") cmake_path(NORMAL_PATH @PROJECT_NAME@_INSTALL_PATH OUTPUT_VARIABLE @PROJECT_NAME@_INSTALL_PATH) set(PROTOC_NAME "@PROJECT_NAME@_protoc_plugin") set(PROTO_SCRIPT_NAME "@PROJECT_NAME@_generate.py") @@ -40,7 +40,7 @@ function(gz_msgs_get_installed_messages) cmake_parse_arguments(get_installed_messages "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - set(@PROJECT_NAME@_INSTALL_PATH "${@PROJECT_NAME@_DIR}/../../..") + set(@PROJECT_NAME@_INSTALL_PATH "${@PROJECT_NAME@_DIR}/@PROJECT_CMAKE_EXTRAS_PATH_TO_PREFIX@") cmake_path(NORMAL_PATH @PROJECT_NAME@_INSTALL_PATH OUTPUT_VARIABLE @PROJECT_NAME@_INSTALL_PATH) set(@PROJECT_NAME@_PROTO_PATH ${@PROJECT_NAME@_INSTALL_PATH}/share/protos)