Mercurial > hg > orthanc
annotate Resources/CMake/LibP11Configuration.cmake @ 2791:d015fa861e3c
selective disabling of modules in the Orthanc framework
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 26 Jul 2018 21:18:05 +0200 |
parents | 74d0953a3681 |
children | 0c2a8d5e0097 |
rev | line source |
---|---|
2025 | 1 if (STATIC_BUILD OR NOT USE_SYSTEM_LIBP11) |
2 SET(LIBP11_SOURCES_DIR ${CMAKE_BINARY_DIR}/libp11-0.4.0) | |
2384 | 3 SET(LIBP11_URL "http://www.orthanc-server.com/downloads/third-party/beid/libp11-0.4.0.tar.gz") |
2025 | 4 SET(LIBP11_MD5 "00b3e41db5be840d822bda12f3ab2ca7") |
2026 | 5 |
6 if (IS_DIRECTORY "${LIBP11_SOURCES_DIR}") | |
7 set(FirstRun OFF) | |
8 else() | |
9 set(FirstRun ON) | |
10 endif() | |
11 | |
2025 | 12 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
|
13 |
2027 | 14 # Apply the patches |
2026 | 15 execute_process( |
16 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Patches/libp11-0.4.0.patch | |
17 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} | |
18 RESULT_VARIABLE Failure | |
19 ) | |
20 | |
21 if (Failure AND FirstRun) | |
22 message(FATAL_ERROR "Error while patching libp11") | |
23 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
|
24 |
2027 | 25 # This command MUST be after applying the patch |
26 file(COPY | |
27 ${LIBP11_SOURCES_DIR}/src/engine.h | |
28 ${LIBP11_SOURCES_DIR}/src/libp11.h | |
29 DESTINATION ${AUTOGENERATED_DIR}/libp11) | |
30 | |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 set(LIBP11_SOURCES |
2025 | 32 #${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
|
33 ${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
|
34 ${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
|
35 ${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
|
36 ${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
|
37 ${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
|
38 ${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
|
39 ${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
|
40 ${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
|
41 ${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
|
42 ${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
|
43 ${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
|
44 ${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
|
45 ${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
|
46 ) |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 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
|
49 ${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
|
50 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR |
2364 | 51 ${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
|
52 ${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
|
53 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
|
54 ${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
|
55 ) |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 endif() |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 |
2113
0108ac01fc8e
added source_group directives for MSVC
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2027
diff
changeset
|
58 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
|
59 |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 else() |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 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
|
62 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
|
63 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
|
64 endif() |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 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
|
67 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
|
68 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
|
69 endif() |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 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
|
72 endif() |