Mercurial > hg > orthanc
annotate OrthancFramework/Resources/CMake/LibP11Configuration.cmake @ 4115:7d0f42c98419
integration Orthanc-1.4.2-fix-build->mainline
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 07 Jul 2020 13:12:23 +0200 |
parents | 9fa06bddaabe |
children | 304842a0d152 |
rev | line source |
---|---|
2025 | 1 if (STATIC_BUILD OR NOT USE_SYSTEM_LIBP11) |
4052 | 2 if (NOT STATIC_BUILD AND USE_SYSTEM_OPENSSL) |
3 message(FATAL_ERROR "If statically linking against libp11, one must also statically link against OpenSSL") | |
4 endif() | |
5 | |
2025 | 6 SET(LIBP11_SOURCES_DIR ${CMAKE_BINARY_DIR}/libp11-0.4.0) |
3133
0c2a8d5e0097
moving third-party dependencies to another server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
7 SET(LIBP11_URL "http://orthanc.osimis.io/ThirdPartyDownloads/libp11-0.4.0.tar.gz") |
2025 | 8 SET(LIBP11_MD5 "00b3e41db5be840d822bda12f3ab2ca7") |
2026 | 9 |
10 if (IS_DIRECTORY "${LIBP11_SOURCES_DIR}") | |
11 set(FirstRun OFF) | |
12 else() | |
13 set(FirstRun ON) | |
14 endif() | |
15 | |
2025 | 16 DownloadPackage(${LIBP11_MD5} ${LIBP11_URL} "${LIBP11_SOURCES_DIR}") |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 |
2027 | 18 # Apply the patches |
2026 | 19 execute_process( |
4052 | 20 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${CMAKE_CURRENT_LIST_DIR}/../Patches/libp11-0.4.0.patch |
2026 | 21 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
22 RESULT_VARIABLE Failure | |
23 ) | |
24 | |
25 if (Failure AND FirstRun) | |
26 message(FATAL_ERROR "Error while patching libp11") | |
27 endif() | |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 |
2027 | 29 # This command MUST be after applying the patch |
30 file(COPY | |
31 ${LIBP11_SOURCES_DIR}/src/engine.h | |
32 ${LIBP11_SOURCES_DIR}/src/libp11.h | |
33 DESTINATION ${AUTOGENERATED_DIR}/libp11) | |
34 | |
4052 | 35 file(WRITE ${AUTOGENERATED_DIR}/libp11/config.h "") |
36 | |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 set(LIBP11_SOURCES |
2025 | 38 #${LIBP11_SOURCES_DIR}/src/eng_front.c |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 ${LIBP11_SOURCES_DIR}/src/eng_back.c |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 ${LIBP11_SOURCES_DIR}/src/eng_parse.c |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 ${LIBP11_SOURCES_DIR}/src/libpkcs11.c |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 ${LIBP11_SOURCES_DIR}/src/p11_attr.c |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 ${LIBP11_SOURCES_DIR}/src/p11_cert.c |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 ${LIBP11_SOURCES_DIR}/src/p11_ec.c |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 ${LIBP11_SOURCES_DIR}/src/p11_err.c |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 ${LIBP11_SOURCES_DIR}/src/p11_front.c |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 ${LIBP11_SOURCES_DIR}/src/p11_key.c |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 ${LIBP11_SOURCES_DIR}/src/p11_load.c |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 ${LIBP11_SOURCES_DIR}/src/p11_misc.c |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 ${LIBP11_SOURCES_DIR}/src/p11_rsa.c |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 ${LIBP11_SOURCES_DIR}/src/p11_slot.c |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 ) |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR |
2364 | 57 ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" OR |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 list(APPEND LIBP11_SOURCES |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 ${LIBP11_SOURCES_DIR}/src/atfork.c |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 ) |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 endif() |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 |
2113
0108ac01fc8e
added source_group directives for MSVC
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2027
diff
changeset
|
64 source_group(ThirdParty\\libp11 REGULAR_EXPRESSION ${LIBP11_SOURCES_DIR}/.*) |
0108ac01fc8e
added source_group directives for MSVC
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2027
diff
changeset
|
65 |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 else() |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 check_include_file_cxx(libp11.h HAVE_LIBP11_H) |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 if (NOT HAVE_LIBP11_H) |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 message(FATAL_ERROR "Please install the libp11-dev package") |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 endif() |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 check_library_exists(p11 PKCS11_login "" HAVE_LIBP11_LIB) |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 if (NOT HAVE_LIBP11_LIB) |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 message(FATAL_ERROR "Please install the libp11-dev package") |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 endif() |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 link_libraries(p11) |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 endif() |