From ecc76148c9e11da416d436de3b34f5ec7acdbce3 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Thu, 19 Dec 2024 13:09:17 -0800 Subject: [PATCH] Install CMake modules in a more standard way. --- CMakeLists.txt | 6 +++--- cmake/aws-c-common-config.cmake | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d14b0241..bdff043cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -278,12 +278,12 @@ else() endif() install(EXPORT "${PROJECT_NAME}-targets" - DESTINATION "${LIBRARY_DIRECTORY}/${PROJECT_NAME}/cmake/${TARGET_DIR}" + DESTINATION "${LIBRARY_DIRECTORY}/cmake/${PROJECT_NAME}/${TARGET_DIR}" NAMESPACE AWS:: COMPONENT Development) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" - DESTINATION "${LIBRARY_DIRECTORY}/${PROJECT_NAME}/cmake" + DESTINATION "${LIBRARY_DIRECTORY}/cmake/${PROJECT_NAME}" COMPONENT Development) list(APPEND EXPORT_MODULES @@ -300,7 +300,7 @@ list(APPEND EXPORT_MODULES ) install(FILES ${EXPORT_MODULES} - DESTINATION "${LIBRARY_DIRECTORY}/cmake" + DESTINATION "${LIBRARY_DIRECTORY}/cmake/${PROJECT_NAME}/modules" COMPONENT Development) # This should come last, to ensure all variables defined by cmake will be available for export diff --git a/cmake/aws-c-common-config.cmake b/cmake/aws-c-common-config.cmake index 094ad116d..2964427f4 100644 --- a/cmake/aws-c-common-config.cmake +++ b/cmake/aws-c-common-config.cmake @@ -1,3 +1,6 @@ +# make installed modules (e.g. AwsCFlags.cmake) available to dependencies +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules) + set(THREADS_PREFER_PTHREAD_FLAG ON) if(WIN32 OR UNIX OR APPLE)