Skip to content

Commit

Permalink
Added support for shared/static lib builds in the same build closure. (
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanHenson authored Sep 14, 2019
1 parent 25d7947 commit 343a0b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,14 @@ endif()
install(FILES ${AWS_CHECKSUMS_HEADERS} DESTINATION "include/aws/checksums")
aws_prepare_shared_lib_exports(${CMAKE_PROJECT_NAME})

if (BUILD_SHARED_LIBS)
set (TARGET_DIR "shared")
else()
set (TARGET_DIR "static")
endif()

install(EXPORT "${CMAKE_PROJECT_NAME}-targets"
DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake/"
DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake/${TARGET_DIR}/"
NAMESPACE AWS::)

configure_file("cmake/${CMAKE_PROJECT_NAME}-config.cmake"
Expand Down
6 changes: 5 additions & 1 deletion cmake/aws-checksums-config.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
include(${CMAKE_CURRENT_LIST_DIR}/@CMAKE_PROJECT_NAME@-targets.cmake)
if (BUILD_SHARED_LIBS)
include(${CMAKE_CURRENT_LIST_DIR}/shared/@CMAKE_PROJECT_NAME@-targets.cmake)
else()
include(${CMAKE_CURRENT_LIST_DIR}/static/@CMAKE_PROJECT_NAME@-targets.cmake)
endif()

0 comments on commit 343a0b0

Please sign in to comment.