annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2379
4900688827a8 reorganization in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2367
diff changeset
1 if (STATIC_BUILD OR NOT USE_SYSTEM_OPENSSL)
3720
faa695f433d5 upgraded OpenSSL to 1.1.1d
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3287
diff changeset
2 if (OPENSSL_STATIC_VERSION STREQUAL "1.0.2")
faa695f433d5 upgraded OpenSSL to 1.1.1d
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3287
diff changeset
3 include(${CMAKE_CURRENT_LIST_DIR}/OpenSslConfigurationStatic-1.0.2.cmake)
faa695f433d5 upgraded OpenSSL to 1.1.1d
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3287
diff changeset
4 elseif (OPENSSL_STATIC_VERSION STREQUAL "1.1.1")
faa695f433d5 upgraded OpenSSL to 1.1.1d
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3287
diff changeset
5 include(${CMAKE_CURRENT_LIST_DIR}/OpenSslConfigurationStatic-1.1.1.cmake)
2379
4900688827a8 reorganization in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2367
diff changeset
6 else()
3720
faa695f433d5 upgraded OpenSSL to 1.1.1d
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3287
diff changeset
7 message(FATAL_ERROR "Unsupported version of OpenSSL: ${OPENSSL_STATIC_VERSION}")
2379
4900688827a8 reorganization in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2367
diff changeset
8 endif()
2022
fefbe71c2272 Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1919
diff changeset
9
2379
4900688827a8 reorganization in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2367
diff changeset
10 source_group(ThirdParty\\OpenSSL REGULAR_EXPRESSION ${OPENSSL_SOURCES_DIR}/.*)
735
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 672
diff changeset
11
3833
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
12 elseif (CMAKE_CROSSCOMPILING AND
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
13 "${CMAKE_SYSTEM_VERSION}" STREQUAL "CrossToolNg")
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
14
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
15 CHECK_INCLUDE_FILE_CXX(openssl/opensslv.h HAVE_OPENSSL_H)
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
16 if (NOT HAVE_OPENSSL_H)
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
17 message(FATAL_ERROR "Please install the libopenssl-dev package")
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
18 endif()
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
19
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
20 CHECK_LIBRARY_EXISTS(crypto "OPENSSL_init" "" HAVE_OPENSSL_CRYPTO_LIB)
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
21 if (NOT HAVE_OPENSSL_CRYPTO_LIB)
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
22 message(FATAL_ERROR "Please install the libopenssl package")
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
23 endif()
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
24
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
25 CHECK_LIBRARY_EXISTS(ssl "SSL_library_init" "" HAVE_OPENSSL_SSL_LIB)
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
26 if (NOT HAVE_OPENSSL_SSL_LIB)
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
27 message(FATAL_ERROR "Please install the libopenssl package")
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
28 endif()
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
29
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
30 link_libraries(crypto ssl)
a3e38994d95a compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3720
diff changeset
31
2379
4900688827a8 reorganization in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2367
diff changeset
32 else()
4900688827a8 reorganization in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2367
diff changeset
33 include(FindOpenSSL)
735
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 672
diff changeset
34
2379
4900688827a8 reorganization in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2367
diff changeset
35 if (NOT ${OPENSSL_FOUND})
4900688827a8 reorganization in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2367
diff changeset
36 message(FATAL_ERROR "Unable to find OpenSSL")
4900688827a8 reorganization in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2367
diff changeset
37 endif()
2022
fefbe71c2272 Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1919
diff changeset
38
2379
4900688827a8 reorganization in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2367
diff changeset
39 include_directories(${OPENSSL_INCLUDE_DIR})
4900688827a8 reorganization in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2367
diff changeset
40 link_libraries(${OPENSSL_LIBRARIES})
735
ee0d5abf7958 dos2unix
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 672
diff changeset
41 endif()