comparison OrthancFramework/Resources/CMake/OpenSslConfiguration.cmake @ 4044:d25f4c0fa160 framework

splitting code into OrthancFramework and OrthancServer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 Jun 2020 20:30:34 +0200
parents Resources/CMake/OpenSslConfiguration.cmake@a3e38994d95a
children 304842a0d152
comparison
equal deleted inserted replaced
4043:6c6239aec462 4044:d25f4c0fa160
1 if (STATIC_BUILD OR NOT USE_SYSTEM_OPENSSL)
2 if (OPENSSL_STATIC_VERSION STREQUAL "1.0.2")
3 include(${CMAKE_CURRENT_LIST_DIR}/OpenSslConfigurationStatic-1.0.2.cmake)
4 elseif (OPENSSL_STATIC_VERSION STREQUAL "1.1.1")
5 include(${CMAKE_CURRENT_LIST_DIR}/OpenSslConfigurationStatic-1.1.1.cmake)
6 else()
7 message(FATAL_ERROR "Unsupported version of OpenSSL: ${OPENSSL_STATIC_VERSION}")
8 endif()
9
10 source_group(ThirdParty\\OpenSSL REGULAR_EXPRESSION ${OPENSSL_SOURCES_DIR}/.*)
11
12 elseif (CMAKE_CROSSCOMPILING AND
13 "${CMAKE_SYSTEM_VERSION}" STREQUAL "CrossToolNg")
14
15 CHECK_INCLUDE_FILE_CXX(openssl/opensslv.h HAVE_OPENSSL_H)
16 if (NOT HAVE_OPENSSL_H)
17 message(FATAL_ERROR "Please install the libopenssl-dev package")
18 endif()
19
20 CHECK_LIBRARY_EXISTS(crypto "OPENSSL_init" "" HAVE_OPENSSL_CRYPTO_LIB)
21 if (NOT HAVE_OPENSSL_CRYPTO_LIB)
22 message(FATAL_ERROR "Please install the libopenssl package")
23 endif()
24
25 CHECK_LIBRARY_EXISTS(ssl "SSL_library_init" "" HAVE_OPENSSL_SSL_LIB)
26 if (NOT HAVE_OPENSSL_SSL_LIB)
27 message(FATAL_ERROR "Please install the libopenssl package")
28 endif()
29
30 link_libraries(crypto ssl)
31
32 else()
33 include(FindOpenSSL)
34
35 if (NOT ${OPENSSL_FOUND})
36 message(FATAL_ERROR "Unable to find OpenSSL")
37 endif()
38
39 include_directories(${OPENSSL_INCLUDE_DIR})
40 link_libraries(${OPENSSL_LIBRARIES})
41 endif()