Change installation rules to match defaults of vcpkg (#14)
This commit is contained in:
@@ -1 +1 @@
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/livox_sdkTargets.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/livox-sdkTargets.cmake")
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
include(GNUInstallDirs)
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
# Name of the package to use when calling find_package(<package>) in consumer code
|
||||
set(package livox_sdk)
|
||||
# Name of the package to use when calling find_package(<package>) in consumer code. We use
|
||||
# kebap-case because vcpkg uses that for its port names.
|
||||
set(package livox-sdk)
|
||||
|
||||
set(livox_sdk_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${package}")
|
||||
set(livox_sdk_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/${package}")
|
||||
set(livox_sdk_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/${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(TARGETS ${SDK_LIBRARY} EXPORT livox_sdkTargets
|
||||
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}")
|
||||
@@ -28,6 +30,6 @@ install(FILES "${PROJECT_BINARY_DIR}/${package}ConfigVersion.cmake"
|
||||
DESTINATION ${livox_sdk_INSTALL_CMAKEDIR})
|
||||
|
||||
# Generate and install a CMake file with code for installing targets from the given export
|
||||
install(EXPORT livox_sdkTargets
|
||||
install(EXPORT livox-sdkTargets
|
||||
NAMESPACE livox_sdk::
|
||||
DESTINATION ${livox_sdk_INSTALL_CMAKEDIR})
|
||||
|
||||
Reference in New Issue
Block a user