Skip to content

Commit

Permalink
Use cmake extras path variables (#359)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
scpeters authored Jul 11, 2023
1 parent 16de9ef commit 786b42a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)

#============================================================================
Expand Down
4 changes: 2 additions & 2 deletions gz-msgs-extras.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
Expand Down

0 comments on commit 786b42a

Please sign in to comment.