Skip to content

Commit

Permalink
Made the LibCrypto finder be specific to the package installing it so…
Browse files Browse the repository at this point in the history
… certain package managers wouldn't freak out when S2N and aws-c-cal install identical artifacts to cmake module path.
  • Loading branch information
JonathanHenson committed Sep 17, 2019
1 parent 556f4fc commit 2fe50f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ else ()
file(GLOB AWS_CAL_OS_SRC
"source/opensslcrypto/*.c"
)
find_package(LibCrypto REQUIRED)
find_package(LibCryptoCAL REQUIRED)
set(PLATFORM_LIBS LibCrypto::Crypto dl)
endif()
endif()
Expand Down Expand Up @@ -149,7 +149,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}-config.cmake"
COMPONENT Development)

list(APPEND EXPORT_MODULES
"cmake/modules/FindLibCrypto.cmake"
"cmake/modules/FindLibCryptoCAL.cmake"
)

install(FILES ${EXPORT_MODULES}
Expand Down
2 changes: 1 addition & 1 deletion cmake/aws-c-cal-config.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include(CMakeFindDependencyMacro)

if (NOT BYO_CRYPTO AND NOT WIN32 AND NOT APPLE)
find_dependency(LibCrypto)
find_dependency(LibCryptoCAL)
endif()

if (BUILD_SHARED_LIBS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ mark_as_advanced(
if(LibCrypto_FOUND OR LIBCRYPTO_FOUND)
set(LibCrypto_FOUND true)
set(LIBCRYPTO_FOUND true)
set(LibCryptoCAL_FOUND true)
set(LIBCRYPTOCAL_FOUND true)

message(STATUS "LibCrypto Include Dir: ${LibCrypto_INCLUDE_DIR}")
message(STATUS "LibCrypto Shared Lib: ${LibCrypto_SHARED_LIBRARY}")
message(STATUS "LibCrypto Static Lib: ${LibCrypto_STATIC_LIBRARY}")
Expand Down

0 comments on commit 2fe50f2

Please sign in to comment.