Skip to content

Commit

Permalink
Merge pull request input-leap#1845 from sithlord48/cmakeOpenSSL
Browse files Browse the repository at this point in the history
cmake: Use find_package to find openSSL 1.1.1+
  • Loading branch information
p12tic authored Feb 11, 2024
2 parents 3a79689 + f45d1e3 commit 587c039
Show file tree
Hide file tree
Showing 198 changed files with 13 additions and 78,559 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,6 @@ jobs:
run: |
cmake --build build --config $env:B_BUILD_TYPE --target install
- name: Copy supporting binaries
run: |
copy input-leap\ext\openssl\windows\x64\bin\*.dll input-leap-install\
- name: Create Archive
run: Compress-Archive -Path input-leap-install\* -DestinationPath ${{ env.B_BUILD_TYPE }}.zip

Expand Down
75 changes: 4 additions & 71 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -258,78 +258,11 @@ include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/ext/gulrak-filesystem/include")
#
# OpenSSL
#
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set (OPENSSL_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/ext/openssl/windows)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set (OPENSSL_ROOT "${OPENSSL_ROOT}/x64")
else()
set (OPENSSL_ROOT "${OPENSSL_ROOT}/x86")
endif()

include_directories (BEFORE SYSTEM ${OPENSSL_ROOT}/include)
set (OPENSSL_LIBS
${OPENSSL_ROOT}/lib/libeay32.lib
${OPENSSL_ROOT}/lib/ssleay32.lib
)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_program(APT_PROGRAM "apt")
find_program(BREW_PROGRAM "brew")
find_program(PORT_PROGRAM "port")

if (IS_DIRECTORY /opt/procursus AND APT_PROGRAM)
# procursus/apt
set (OPENSSL_ROOT /opt/procursus)

include_directories (BEFORE SYSTEM ${OPENSSL_ROOT}/include)

set (OPENSSL_LIBS
${OPENSSL_ROOT}/lib/libssl.a
${OPENSSL_ROOT}/lib/libcrypto.a
)
elseif (IS_DIRECTORY /opt/local AND PORT_PROGRAM)
# macports
set (OPENSSL_ROOT /opt/local)

set (OPENSSL_LIBS
${OPENSSL_ROOT}/lib/libssl.a
${OPENSSL_ROOT}/lib/libcrypto.a
z
)
elseif (IS_DIRECTORY /usr/local/opt/openssl AND BREW_PROGRAM)
# brew
set (OPENSSL_ROOT /usr/local/opt/openssl)

include_directories (BEFORE SYSTEM ${OPENSSL_ROOT}/include)

set (OPENSSL_LIBS
${OPENSSL_ROOT}/lib/libssl.a
${OPENSSL_ROOT}/lib/libcrypto.a
)
elseif (IS_DIRECTORY /opt/homebrew/opt/openssl AND BREW_PROGRAM)
# brew
set (OPENSSL_ROOT /opt/homebrew/opt/openssl)

include_directories (BEFORE SYSTEM ${OPENSSL_ROOT}/include)

set (OPENSSL_LIBS
${OPENSSL_ROOT}/lib/libssl.a
${OPENSSL_ROOT}/lib/libcrypto.a
)
endif()

elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set (OPENSSL_LIBS ssl crypto)
else()
find_library (lib_ssl ssl)
find_library (lib_crypto crypto)
if (NOT lib_ssl)
message(FATAL_ERROR "openssl library not found")
elseif (NOT lib_crypto)
message(FATAL_ERROR "crypto library not found")
endif()
set (OPENSSL_LIBS ${lib_ssl} ${lib_crypto})
# Find Static Libs on mac OS and windows
if (APPLE OR WIN32)
set(OPENSSL_USE_STATIC_LIBS TRUE)
endif()

find_package(OpenSSL 1.1.1 REQUIRED COMPONENTS SSL Crypto)
#
# Configure_file... but for directories, recursively.
#
Expand Down
125 changes: 0 additions & 125 deletions ext/openssl/LICENSE

This file was deleted.

Binary file removed ext/openssl/windows/x64/bin/libeay32.dll
Binary file not shown.
Binary file removed ext/openssl/windows/x64/bin/openssl.exe
Binary file not shown.
Binary file removed ext/openssl/windows/x64/bin/ssleay32.dll
Binary file not shown.
149 changes: 0 additions & 149 deletions ext/openssl/windows/x64/include/openssl/aes.h

This file was deleted.

Loading

0 comments on commit 587c039

Please sign in to comment.