From 977cc3f3e8a7bdbe3a4a196b8d0041a69a9af69b Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Fri, 20 Dec 2024 17:48:04 -0800 Subject: [PATCH] Just use CMAKE_INSTALL_LIBDIR etc, instead of our own custom variables --- CMakeLists.txt | 15 ++++++++------- bin/elastipubsub/CMakeLists.txt | 2 +- bin/elastipubsub5/CMakeLists.txt | 2 +- bin/elastishadow/CMakeLists.txt | 2 +- bin/mqtt5canary/CMakeLists.txt | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4175ea3..56a98381 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ include(AwsSharedLibSetup) include(AwsSanitizers) include(CheckCCompilerFlag) include(AwsFindPackage) +include(GNUInstallDirs) file(GLOB AWS_MQTT_HEADERS "include/aws/mqtt/*.h" @@ -78,11 +79,11 @@ aws_use_package(aws-c-http) target_link_libraries(${PROJECT_NAME} PUBLIC ${DEP_AWS_LIBS}) aws_prepare_shared_lib_exports(${PROJECT_NAME}) -install(FILES ${AWS_MQTT_HEADERS} DESTINATION "${INCLUDE_DIRECTORY}/aws/mqtt" COMPONENT Development) -install(FILES ${AWS_MQTT5_HEADERS} DESTINATION "${INCLUDE_DIRECTORY}/aws/mqtt/v5" COMPONENT Development) -install(FILES ${AWS_MQTT_RR_HEADERS} DESTINATION "${INCLUDE_DIRECTORY}/aws/mqtt/request-response" COMPONENT Development) -install(FILES ${AWS_MQTT_TESTING_HEADERS} DESTINATION "${INCLUDE_DIRECTORY}/aws/testing/mqtt" COMPONENT Development) -install(FILES ${AWS_MQTT_PRIV_EXPOSED_HEADERS} DESTINATION "${INCLUDE_DIRECTORY}/aws/mqtt/private" COMPONENT Development) +install(FILES ${AWS_MQTT_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/aws/mqtt" COMPONENT Development) +install(FILES ${AWS_MQTT5_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/aws/mqtt/v5" COMPONENT Development) +install(FILES ${AWS_MQTT_RR_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/aws/mqtt/request-response" COMPONENT Development) +install(FILES ${AWS_MQTT_TESTING_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/aws/testing/mqtt" COMPONENT Development) +install(FILES ${AWS_MQTT_PRIV_EXPOSED_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/aws/mqtt/private" COMPONENT Development) if (BUILD_SHARED_LIBS) set (TARGET_DIR "shared") @@ -91,7 +92,7 @@ else() endif() install(EXPORT "${PROJECT_NAME}-targets" - DESTINATION "${LIBRARY_DIRECTORY}/cmake/${PROJECT_NAME}/${TARGET_DIR}" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/${TARGET_DIR}" NAMESPACE AWS:: COMPONENT Development) @@ -100,7 +101,7 @@ configure_file("cmake/${PROJECT_NAME}-config.cmake" @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" - DESTINATION "${LIBRARY_DIRECTORY}/cmake/${PROJECT_NAME}/" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/" COMPONENT Development) include(CTest) diff --git a/bin/elastipubsub/CMakeLists.txt b/bin/elastipubsub/CMakeLists.txt index ad2475cb..ac75095d 100644 --- a/bin/elastipubsub/CMakeLists.txt +++ b/bin/elastipubsub/CMakeLists.txt @@ -23,5 +23,5 @@ install(TARGETS ${ELASTIPUBSUB_PROJECT_NAME} EXPORT ${ELASTIPUBSUB_PROJECT_NAME}-targets COMPONENT Runtime RUNTIME - DESTINATION ${RUNTIME_DIRECTORY} + DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime) diff --git a/bin/elastipubsub5/CMakeLists.txt b/bin/elastipubsub5/CMakeLists.txt index 12121b05..ae22f1ed 100644 --- a/bin/elastipubsub5/CMakeLists.txt +++ b/bin/elastipubsub5/CMakeLists.txt @@ -23,5 +23,5 @@ install(TARGETS ${ELASTIPUBSUB_MQTT5_PROJECT_NAME} EXPORT ${ELASTIPUBSUB_MQTT5_PROJECT_NAME}-targets COMPONENT Runtime RUNTIME - DESTINATION ${RUNTIME_DIRECTORY} + DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime) diff --git a/bin/elastishadow/CMakeLists.txt b/bin/elastishadow/CMakeLists.txt index 356451e5..9bc83257 100644 --- a/bin/elastishadow/CMakeLists.txt +++ b/bin/elastishadow/CMakeLists.txt @@ -23,5 +23,5 @@ install(TARGETS ${ELASTISHADOW_PROJECT_NAME} EXPORT ${ELASTISHADOW_PROJECT_NAME}-targets COMPONENT Runtime RUNTIME - DESTINATION ${RUNTIME_DIRECTORY} + DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime) diff --git a/bin/mqtt5canary/CMakeLists.txt b/bin/mqtt5canary/CMakeLists.txt index 818f7a0f..026e510d 100644 --- a/bin/mqtt5canary/CMakeLists.txt +++ b/bin/mqtt5canary/CMakeLists.txt @@ -23,5 +23,5 @@ install(TARGETS ${MQTT5CANARY_PROJECT_NAME} EXPORT ${MQTT5CANARY_PROJECT_NAME}-targets COMPONENT Runtime RUNTIME - DESTINATION ${RUNTIME_DIRECTORY} + DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime)