Mercurial > hg > orthanc
annotate OrthancFramework/Resources/CMake/GoogleTestConfiguration.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:
4044
diff
changeset
|
1 # Orthanc - A Lightweight, RESTful DICOM Store |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
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:
4044
diff
changeset
|
7 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
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:
4044
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:
4044
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:
4044
diff
changeset
|
11 # the License, or (at your option) any later version. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
12 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
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:
4044
diff
changeset
|
14 # WITHOUT ANY WARRANTY; without even the implied warranty of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
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:
4044
diff
changeset
|
16 # Lesser General Public License for more details. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
17 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
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:
4044
diff
changeset
|
19 # License along with this program. If not, see |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
20 # <http://www.gnu.org/licenses/>. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
21 |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
22 |
2403
06536b4f30c0
rename USE_GOOGLE_TEST_DEBIAN_SOURCE_PACKAGE as USE_GOOGLE_TEST_DEBIAN_PACKAGE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2402
diff
changeset
|
23 if (USE_GOOGLE_TEST_DEBIAN_PACKAGE) |
2402
741765ec8374
rename GTEST_ as GOOGLE_TEST_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
24 find_path(GOOGLE_TEST_DEBIAN_SOURCES_DIR |
2159
cfaf2bea096e
fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2113
diff
changeset
|
25 NAMES src/gtest-all.cc |
cfaf2bea096e
fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2113
diff
changeset
|
26 PATHS |
3833
a3e38994d95a
compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3281
diff
changeset
|
27 ${CROSSTOOL_NG_IMAGE}/usr/src/gtest |
a3e38994d95a
compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3281
diff
changeset
|
28 ${CROSSTOOL_NG_IMAGE}/usr/src/googletest/googletest |
2159
cfaf2bea096e
fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2113
diff
changeset
|
29 PATH_SUFFIXES src |
cfaf2bea096e
fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2113
diff
changeset
|
30 ) |
157
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
31 |
2402
741765ec8374
rename GTEST_ as GOOGLE_TEST_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
32 find_path(GOOGLE_TEST_DEBIAN_INCLUDE_DIR |
2159
cfaf2bea096e
fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2113
diff
changeset
|
33 NAMES gtest.h |
cfaf2bea096e
fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2113
diff
changeset
|
34 PATHS |
3833
a3e38994d95a
compilation on mips qemu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3281
diff
changeset
|
35 ${CROSSTOOL_NG_IMAGE}/usr/include/gtest |
2159
cfaf2bea096e
fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2113
diff
changeset
|
36 ) |
cfaf2bea096e
fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2113
diff
changeset
|
37 |
2402
741765ec8374
rename GTEST_ as GOOGLE_TEST_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
38 message("Path to the Debian Google Test sources: ${GOOGLE_TEST_DEBIAN_SOURCES_DIR}") |
741765ec8374
rename GTEST_ as GOOGLE_TEST_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
39 message("Path to the Debian Google Test includes: ${GOOGLE_TEST_DEBIAN_INCLUDE_DIR}") |
2159
cfaf2bea096e
fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2113
diff
changeset
|
40 |
2404
e6af2c5cd0f1
migration of Google Test into OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2403
diff
changeset
|
41 set(GOOGLE_TEST_SOURCES |
e6af2c5cd0f1
migration of Google Test into OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2403
diff
changeset
|
42 ${GOOGLE_TEST_DEBIAN_SOURCES_DIR}/src/gtest-all.cc |
e6af2c5cd0f1
migration of Google Test into OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2403
diff
changeset
|
43 ) |
e6af2c5cd0f1
migration of Google Test into OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2403
diff
changeset
|
44 |
2402
741765ec8374
rename GTEST_ as GOOGLE_TEST_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
45 include_directories(${GOOGLE_TEST_DEBIAN_SOURCES_DIR}) |
2159
cfaf2bea096e
fix Google Test includes on Debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2113
diff
changeset
|
46 |
2402
741765ec8374
rename GTEST_ as GOOGLE_TEST_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
47 if (NOT EXISTS ${GOOGLE_TEST_SOURCES} OR |
741765ec8374
rename GTEST_ as GOOGLE_TEST_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
48 NOT EXISTS ${GOOGLE_TEST_DEBIAN_INCLUDE_DIR}/gtest.h) |
157
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
49 message(FATAL_ERROR "Please install the libgtest-dev package") |
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
50 endif() |
134 | 51 |
634 | 52 elseif (STATIC_BUILD OR NOT USE_SYSTEM_GOOGLE_TEST) |
3281
ea54109a7312
upgrade to GoogleTest 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
53 set(GOOGLE_TEST_SOURCES_DIR ${CMAKE_BINARY_DIR}/googletest-release-1.8.1) |
5434
aa1c09fa6632
changed location of third-party downloads
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5271
diff
changeset
|
54 set(GOOGLE_TEST_URL "https://orthanc.uclouvain.be/downloads/third-party-downloads/gtest-1.8.1.tar.gz") |
3281
ea54109a7312
upgrade to GoogleTest 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
55 set(GOOGLE_TEST_MD5 "2e6fbeb6a91310a16efe181886c59596") |
1537
fbf763bb1fa3
error detection in patches
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1092
diff
changeset
|
56 |
2402
741765ec8374
rename GTEST_ as GOOGLE_TEST_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
57 DownloadPackage(${GOOGLE_TEST_MD5} ${GOOGLE_TEST_URL} "${GOOGLE_TEST_SOURCES_DIR}") |
0 | 58 |
59 include_directories( | |
3281
ea54109a7312
upgrade to GoogleTest 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
60 ${GOOGLE_TEST_SOURCES_DIR}/googletest |
ea54109a7312
upgrade to GoogleTest 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
61 ${GOOGLE_TEST_SOURCES_DIR}/googletest/include |
2402
741765ec8374
rename GTEST_ as GOOGLE_TEST_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
62 ${GOOGLE_TEST_SOURCES_DIR} |
0 | 63 ) |
64 | |
2402
741765ec8374
rename GTEST_ as GOOGLE_TEST_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
65 set(GOOGLE_TEST_SOURCES |
3281
ea54109a7312
upgrade to GoogleTest 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
66 ${GOOGLE_TEST_SOURCES_DIR}/googletest/src/gtest-all.cc |
0 | 67 ) |
68 | |
1061
4b4ab35c04f5
fix for visual studio 2012
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
638
diff
changeset
|
69 # https://code.google.com/p/googletest/issues/detail?id=412 |
4b4ab35c04f5
fix for visual studio 2012
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
638
diff
changeset
|
70 if (MSVC) # VS2012 does not support tuples correctly yet |
4b4ab35c04f5
fix for visual studio 2012
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
638
diff
changeset
|
71 add_definitions(/D _VARIADIC_MAX=10) |
4b4ab35c04f5
fix for visual studio 2012
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
638
diff
changeset
|
72 endif() |
2450
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2404
diff
changeset
|
73 |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2404
diff
changeset
|
74 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2404
diff
changeset
|
75 add_definitions(-DGTEST_HAS_CLONE=0) |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2404
diff
changeset
|
76 endif() |
ade8b4ddd8a6
Static linking against libuuid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2404
diff
changeset
|
77 |
2402
741765ec8374
rename GTEST_ as GOOGLE_TEST_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2384
diff
changeset
|
78 source_group(ThirdParty\\GoogleTest REGULAR_EXPRESSION ${GOOGLE_TEST_SOURCES_DIR}/.*) |
2113
0108ac01fc8e
added source_group directives for MSVC
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1537
diff
changeset
|
79 |
0 | 80 else() |
81 include(FindGTest) | |
2462
d61e73357674
fix dynamic linking with google-test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2450
diff
changeset
|
82 if (NOT GTEST_FOUND) |
157
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
83 message(FATAL_ERROR "Unable to find GoogleTest") |
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
84 endif() |
a63fb54819d7
gtest on debian sid
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
85 |
2462
d61e73357674
fix dynamic linking with google-test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2450
diff
changeset
|
86 include_directories(${GTEST_INCLUDE_DIRS}) |
2404
e6af2c5cd0f1
migration of Google Test into OrthancFramework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2403
diff
changeset
|
87 |
2462
d61e73357674
fix dynamic linking with google-test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2450
diff
changeset
|
88 # The variable GTEST_LIBRARIES contains the shared library of |
d61e73357674
fix dynamic linking with google-test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2450
diff
changeset
|
89 # Google Test, create an alias for more uniformity |
d61e73357674
fix dynamic linking with google-test
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2450
diff
changeset
|
90 set(GOOGLE_TEST_LIBRARIES ${GTEST_LIBRARIES}) |
0 | 91 endif() |