Skip to content

Commit

Permalink
Just use CMAKE_INSTALL_LIBDIR etc, instead of our own custom variables
Browse files Browse the repository at this point in the history
  • Loading branch information
graebm committed Dec 21, 2024
1 parent 2cbd0a5 commit 977cc3f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
15 changes: 8 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ include(AwsSharedLibSetup)
include(AwsSanitizers)
include(CheckCCompilerFlag)
include(AwsFindPackage)
include(GNUInstallDirs)

file(GLOB AWS_MQTT_HEADERS
"include/aws/mqtt/*.h"
Expand Down Expand Up @@ -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")
Expand All @@ -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)

Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion bin/elastipubsub/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion bin/elastipubsub5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion bin/elastishadow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion bin/mqtt5canary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 977cc3f

Please sign in to comment.