Skip to content

Commit 3d10d09

Browse files
Fixed dll/.a hell in the same build closure. (#146)
1 parent 3d86cf6 commit 3d10d09

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

CMakeLists.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,14 @@ aws_prepare_shared_lib_exports(${CMAKE_PROJECT_NAME})
7474

7575
install(FILES ${AWS_HTTP_HEADERS} DESTINATION "include/aws/http")
7676

77+
if (BUILD_SHARED_LIBS)
78+
set (TARGET_DIR "shared")
79+
else()
80+
set (TARGET_DIR "static")
81+
endif()
82+
7783
install(EXPORT "${CMAKE_PROJECT_NAME}-targets"
78-
DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake/"
84+
DESTINATION "${LIBRARY_DIRECTORY}/${CMAKE_PROJECT_NAME}/cmake/${TARGET_DIR}/"
7985
NAMESPACE AWS::
8086
COMPONENT Development)
8187

cmake/aws-c-http-config.cmake

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@ include(CMakeFindDependencyMacro)
33
find_dependency(aws-c-io)
44
find_dependency(aws-c-compression)
55

6-
include(${CMAKE_CURRENT_LIST_DIR}/@CMAKE_PROJECT_NAME@-targets.cmake)
6+
if (BUILD_SHARED_LIBS)
7+
include(${CMAKE_CURRENT_LIST_DIR}/shared/@CMAKE_PROJECT_NAME@-targets.cmake)
8+
else()
9+
include(${CMAKE_CURRENT_LIST_DIR}/static/@CMAKE_PROJECT_NAME@-targets.cmake)
10+
endif()
11+

0 commit comments

Comments
 (0)