From 0f00766aab387b299e0a3c5115ab5d3cda7e1af8 Mon Sep 17 00:00:00 2001 From: Patrick Kappl Date: Tue, 16 Jan 2024 09:38:03 +0100 Subject: [PATCH] Add missing include directories to installation target I only copied the header files but did not set the exported target's include directories. --- cmake/install-rules.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/install-rules.cmake b/cmake/install-rules.cmake index 9c49d34..ee6fa6e 100644 --- a/cmake/install-rules.cmake +++ b/cmake/install-rules.cmake @@ -10,11 +10,15 @@ set(livox_sdk_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/${package}") # Set the install directory for the *config.cmake files to the path where vcpkg looks by default set(livox_sdk_INSTALL_CMAKEDIR "share/${package}") -# Install target types to the given destinations and create an export. +# Install target types to the given destinations and create an export. Also, set the exported +# target's include directories to CMAKE_INSTALL_INCLUDEDIR so that the headers must be prefixed with +# the package name. Example: #include , instead of just #include +# . install(TARGETS ${SDK_LIBRARY} EXPORT livox-sdkTargets ARCHIVE DESTINATION "${livox_sdk_INSTALL_LIBDIR}" LIBRARY DESTINATION "${livox_sdk_INSTALL_LIBDIR}" - PUBLIC_HEADER DESTINATION "${livox_sdk_INSTALL_INCLUDEDIR}") + PUBLIC_HEADER DESTINATION "${livox_sdk_INSTALL_INCLUDEDIR}" + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") # Copy the package config file to the install location and give it the correct name install(FILES ../cmake/install-config.cmake