Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix aws-c-cal-config.cmake #158

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions cmake/aws-c-cal-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ include(CMakeFindDependencyMacro)

find_dependency(aws-c-common)

if (NOT @BYO_CRYPTO@ AND NOT WIN32 AND NOT APPLE) # if NOT BYO_CRYPTO AND NOT WIN32 AND NOT APPLE
if (@USE_OPENSSL@ AND NOT ANDROID) # if USE_OPENSSL AND NOT ANDROID
# aws-c-cal has been built with a dependency on OpenSSL::Crypto,
# therefore consumers of this library have a dependency on OpenSSL and must have it found
find_dependency(OpenSSL REQUIRED)
find_dependency(Threads REQUIRED)
else()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules")
find_dependency(crypto)
endif()
endif()

macro(aws_load_targets type)
include(${CMAKE_CURRENT_LIST_DIR}/${type}/@PROJECT_NAME@-targets.cmake)
endmacro()
Expand All @@ -20,18 +32,3 @@ else()
aws_load_targets(shared)
endif()
endif()

if (NOT BYO_CRYPTO AND NOT WIN32 AND NOT APPLE)
get_target_property(AWS_C_CAL_DEPS AWS::aws-c-cal INTERFACE_LINK_LIBRARIES)
# pre-cmake 3.3 IN_LIST search approach
list (FIND AWS_C_CAL_DEPS "OpenSSL::Crypto" _index)
if (${_index} GREATER -1) # if USE_OPENSSL AND NOT ANDROID
# aws-c-cal has been built with a dependency on OpenSSL::Crypto,
# therefore consumers of this library have a dependency on OpenSSL and must have it found
find_dependency(OpenSSL REQUIRED)
find_dependency(Threads REQUIRED)
else()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules")
find_dependency(crypto)
endif()
endif()