comparison Resources/Orthanc/CMake/OpenSslConfiguration.cmake @ 36:92b93845d84b

use of OrthancPluginsExports.cmake, link against system-wide orthanc framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 06 Jul 2020 13:20:02 +0200
parents
children 789a6e960ae2
comparison
equal deleted inserted replaced
35:2af772742d0b 36:92b93845d84b
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()