diff --git a/CMakeLists.txt b/CMakeLists.txt index edbf248..2992a05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -400,7 +400,7 @@ endif() set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) if (SEARCH_LIBCRYPTO) - find_package(LibCrypto REQUIRED) + find_package(OpenSSL COMPONENTS Crypto REQUIRED) else() if (TARGET crypto) message(STATUS "S2N found target: crypto") @@ -465,7 +465,7 @@ if (S2N_INTERN_LIBCRYPTO) ) endif() else() - target_link_libraries(${PROJECT_NAME} PUBLIC crypto) + target_link_libraries(${PROJECT_NAME} PUBLIC OpenSSL::Crypto) endif() target_link_libraries(${PROJECT_NAME} PUBLIC ${OS_LIBS} m) @@ -473,7 +473,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC ${OS_LIBS} m) target_include_directories(${PROJECT_NAME} PUBLIC $) target_include_directories(${PROJECT_NAME} PUBLIC $ $) -target_include_directories(${PROJECT_NAME} PRIVATE $) +target_include_directories(${PROJECT_NAME} PRIVATE $) if (BUILD_TESTING) enable_testing() @@ -485,7 +485,7 @@ if (BUILD_TESTING) target_include_directories(testss2n PUBLIC tests) target_compile_options(testss2n PRIVATE -std=gnu99) target_link_libraries(testss2n PUBLIC ${PROJECT_NAME}) - target_include_directories(testss2n PUBLIC $) + target_include_directories(testss2n PUBLIC $) if (S2N_INTERN_LIBCRYPTO) # if libcrypto was interned, rewrite libcrypto symbols so use of internal functions will link correctly @@ -536,13 +536,13 @@ if (BUILD_TESTING) add_executable(s2nc "bin/s2nc.c" "bin/echo.c" "bin/https.c" "bin/common.c") target_link_libraries(s2nc ${PROJECT_NAME}) - target_include_directories(s2nc PRIVATE $) + target_include_directories(s2nc PRIVATE $) target_include_directories(s2nc PRIVATE api) target_compile_options(s2nc PRIVATE -std=gnu99 -D_POSIX_C_SOURCE=200112L) add_executable(s2nd "bin/s2nd.c" "bin/echo.c" "bin/https.c" "bin/common.c") target_link_libraries(s2nd ${PROJECT_NAME}) - target_include_directories(s2nd PRIVATE $) + target_include_directories(s2nd PRIVATE $) target_include_directories(s2nd PRIVATE api) target_compile_options(s2nd PRIVATE -std=gnu99 -D_POSIX_C_SOURCE=200112L) diff --git a/cmake/s2n-config.cmake b/cmake/s2n-config.cmake index 4e76ed6..f714df0 100644 --- a/cmake/s2n-config.cmake +++ b/cmake/s2n-config.cmake @@ -5,8 +5,7 @@ if (NOT MSVC) find_package(Threads REQUIRED) endif() -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules") -find_dependency(LibCrypto) +find_dependency(OpenSSL COMPONENTS Crypto) include(${CMAKE_CURRENT_LIST_DIR}/@CMAKE_PROJECT_NAME@-targets.cmake)