Skip to content

Commit

Permalink
Install CMake modules in a more standard way.
Browse files Browse the repository at this point in the history
  • Loading branch information
graebm committed Dec 19, 2024
1 parent 7a6f5df commit ecc7614
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions cmake/aws-c-common-config.cmake
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit ecc7614

Please sign in to comment.