Mercurial > hg > orthanc
annotate OrthancFramework/Resources/CMake/LibP11Configuration.cmake @ 5647:f048683aa619
added "?whole" option to "/instances/{id}/tags" to access tags stored after pixel data
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 04 Jun 2024 17:50:45 +0200 |
parents | f7adfb22e20e |
children |
rev | line source |
---|---|
4120
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
1 # Orthanc - A Lightweight, RESTful DICOM Store |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
3 # Department, University Hospital of Liege, Belgium |
5640
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
4 # Copyright (C) 2017-2023 Osimis S.A., Belgium |
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
5 # Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
5485
48b8dae6dc77
upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5434
diff
changeset
|
6 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
4120
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
7 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
8 # This program is free software: you can redistribute it and/or |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
9 # modify it under the terms of the GNU Lesser General Public License |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
10 # as published by the Free Software Foundation, either version 3 of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
11 # the License, or (at your option) any later version. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
12 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
13 # This program is distributed in the hope that it will be useful, but |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
14 # WITHOUT ANY WARRANTY; without even the implied warranty of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
16 # Lesser General Public License for more details. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
17 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
18 # You should have received a copy of the GNU Lesser General Public |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
19 # License along with this program. If not, see |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
20 # <http://www.gnu.org/licenses/>. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
21 |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4052
diff
changeset
|
22 |
2025 | 23 if (STATIC_BUILD OR NOT USE_SYSTEM_LIBP11) |
4052 | 24 if (NOT STATIC_BUILD AND USE_SYSTEM_OPENSSL) |
25 message(FATAL_ERROR "If statically linking against libp11, one must also statically link against OpenSSL") | |
26 endif() | |
27 | |
2025 | 28 SET(LIBP11_SOURCES_DIR ${CMAKE_BINARY_DIR}/libp11-0.4.0) |
5434
aa1c09fa6632
changed location of third-party downloads
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5271
diff
changeset
|
29 SET(LIBP11_URL "https://orthanc.uclouvain.be/downloads/third-party-downloads/libp11-0.4.0.tar.gz") |
2025 | 30 SET(LIBP11_MD5 "00b3e41db5be840d822bda12f3ab2ca7") |
2026 | 31 |
32 if (IS_DIRECTORY "${LIBP11_SOURCES_DIR}") | |
33 set(FirstRun OFF) | |
34 else() | |
35 set(FirstRun ON) | |
36 endif() | |
37 | |
2025 | 38 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
|
39 |
2027 | 40 # Apply the patches |
2026 | 41 execute_process( |
4052 | 42 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${CMAKE_CURRENT_LIST_DIR}/../Patches/libp11-0.4.0.patch |
2026 | 43 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
44 RESULT_VARIABLE Failure | |
45 ) | |
46 | |
47 if (Failure AND FirstRun) | |
48 message(FATAL_ERROR "Error while patching libp11") | |
49 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
|
50 |
2027 | 51 # This command MUST be after applying the patch |
52 file(COPY | |
53 ${LIBP11_SOURCES_DIR}/src/engine.h | |
54 ${LIBP11_SOURCES_DIR}/src/libp11.h | |
55 DESTINATION ${AUTOGENERATED_DIR}/libp11) | |
56 | |
4052 | 57 file(WRITE ${AUTOGENERATED_DIR}/libp11/config.h "") |
58 | |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 set(LIBP11_SOURCES |
2025 | 60 #${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
|
61 ${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
|
62 ${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
|
63 ${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
|
64 ${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
|
65 ${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
|
66 ${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
|
67 ${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
|
68 ${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
|
69 ${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
|
70 ${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
|
71 ${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
|
72 ${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
|
73 ${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
|
74 ) |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 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
|
77 ${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
|
78 ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR |
2364 | 79 ${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
|
80 ${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
|
81 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
|
82 ${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
|
83 ) |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 endif() |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 |
2113
0108ac01fc8e
added source_group directives for MSVC
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2027
diff
changeset
|
86 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
|
87 |
2022
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 else() |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 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
|
90 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
|
91 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
|
92 endif() |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 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
|
95 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
|
96 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
|
97 endif() |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 |
fefbe71c2272
Possibility to use PKCS#11 authentication for hardware security modules with Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 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
|
100 endif() |