Mercurial > hg > orthanc-object-storage
annotate Aws/Graveyard/AwsExternalProject.cmake @ 110:37a4b8e2577f
sync orthanc + SDK 1.12.1
author | Alain Mazy <am@osimis.io> |
---|---|
date | Tue, 10 Oct 2023 15:40:36 +0200 |
parents | b922ae86bbe1 |
children | 3c7e0374f28e |
rev | line source |
---|---|
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 # Cloud storage plugins for Orthanc |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 # Copyright (C) 2020-2021 Osimis S.A., Belgium |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 # |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 # This program is free software: you can redistribute it and/or |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 # modify it under the terms of the GNU Affero General Public License |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 # as published by the Free Software Foundation, either version 3 of |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 # the License, or (at your option) any later version. |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 # |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 # This program is distributed in the hope that it will be useful, but |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 # WITHOUT ANY WARRANTY; without even the implied warranty of |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 # Affero General Public License for more details. |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 # |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 # You should have received a copy of the GNU Affero General Public License |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 ## |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 ## Building the C++ SDK for Amazon AWS |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 ## WARNING: This is *not* compatible with Ninja (yet) |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 ## |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 if (STATIC_AWS_CLIENT) |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 set(Flags -DBUILD_SHARED_LIBS=OFF) # Create static library |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 else() |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 set(Flags -DBUILD_SHARED_LIBS=ON) |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 endif() |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 include(ExternalProject) |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 externalproject_add(AwsSdkCpp |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 GIT_REPOSITORY https://github.com/aws/aws-sdk-cpp |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 GIT_TAG 1.8.127 |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 CMAKE_ARGS |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 -DBUILD_ONLY=s3 #-DBUILD_ONLY=s3;transfer |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 -DENABLE_TESTING=OFF |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 ${Flags} |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 UPDATE_COMMAND "" # Don't run "cmake" on AWS each time "make/ninja" is run |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 INSTALL_COMMAND "" # No install |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 ) |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 ExternalProject_Get_Property(AwsSdkCpp SOURCE_DIR) |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 include_directories( |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 ${SOURCE_DIR}/aws-cpp-sdk-core/include/ |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 ${SOURCE_DIR}/aws-cpp-sdk-s3/include/ |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 ) |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 ExternalProject_Get_Property(AwsSdkCpp BINARY_DIR) |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 if (STATIC_AWS_CLIENT) |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 set(AWSSDK_LINK_LIBRARIES |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 ${BINARY_DIR}/aws-cpp-sdk-s3/libaws-cpp-sdk-s3.a |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 ${BINARY_DIR}/aws-cpp-sdk-core/libaws-cpp-sdk-core.a |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 ${BINARY_DIR}/.deps/install/lib/libaws-c-event-stream.a |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 ${BINARY_DIR}/.deps/install/lib/libaws-checksums.a |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 ${BINARY_DIR}/.deps/install/lib/libaws-c-common.a |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 curl |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 crypto |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 ) |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 list(APPEND AWSSDK_LINK_LIBRARIES |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 gcc # for "undefined reference to `__cpu_model'" on Ubuntu 16.04 |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 ) |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 endif() |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 else() |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 set(AWSSDK_LINK_LIBRARIES |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 ${BINARY_DIR}/aws-cpp-sdk-core/libaws-cpp-sdk-core.so |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 ${BINARY_DIR}/aws-cpp-sdk-s3/libaws-cpp-sdk-s3.so |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 ) |
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 endif() |