From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
Date: Tue, 10 May 2022 00:30:00 +0200
Subject: Fix Multi-Arch install location

Forwarded: not-needed
---
 CMakeLists.txt | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a6afc4c..796f31f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -76,8 +76,11 @@ if(BUILD_TESTING)
   add_subdirectory(test)
 endif()
 
+include(GNUInstallDirs)
+
 if(ament_cmake_FOUND)
   ament_package(
+    CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
     CONFIG_EXTRAS "class_loader-extras.cmake"
   )
 else()
@@ -97,11 +100,11 @@ else()
 endif()
 
 install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}
-  ARCHIVE DESTINATION lib
-  LIBRARY DESTINATION lib
-  RUNTIME DESTINATION bin)
+  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
 
-install(DIRECTORY cmake
-  DESTINATION share/${PROJECT_NAME})
+install(FILES cmake/class_loader_hide_library_symbols.cmake
+  DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
 
-install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME})
+install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
