Mercurial > hg > orthanc-python
annotate Resources/Orthanc/CMake/GoogleTestConfiguration.cmake @ 227:9574f06d8588 default tip
todo
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Tue, 24 Sep 2024 08:54:11 +0200 |
parents | 6fada29b6759 |
children |
rev | line source |
---|---|
145 | 1 # Orthanc - A Lightweight, RESTful DICOM Store |
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
3 # Department, University Hospital of Liege, Belgium | |
166
6fada29b6759
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
153
diff
changeset
|
4 # Copyright (C) 2017-2023 Osimis S.A., Belgium |
6fada29b6759
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
153
diff
changeset
|
5 # Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
153 | 6 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
145 | 7 # |
8 # This program is free software: you can redistribute it and/or | |
9 # modify it under the terms of the GNU Lesser General Public License | |
10 # as published by the Free Software Foundation, either version 3 of | |
11 # the License, or (at your option) any later version. | |
12 # | |
13 # This program is distributed in the hope that it will be useful, but | |
14 # WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 # Lesser General Public License for more details. | |
17 # | |
18 # You should have received a copy of the GNU Lesser General Public | |
19 # License along with this program. If not, see | |
20 # <http://www.gnu.org/licenses/>. | |
21 | |
22 | |
23 if (USE_GOOGLE_TEST_DEBIAN_PACKAGE) | |
24 find_path(GOOGLE_TEST_DEBIAN_SOURCES_DIR | |
25 NAMES src/gtest-all.cc | |
26 PATHS | |
27 ${CROSSTOOL_NG_IMAGE}/usr/src/gtest | |
28 ${CROSSTOOL_NG_IMAGE}/usr/src/googletest/googletest | |
29 PATH_SUFFIXES src | |
30 ) | |
31 | |
32 find_path(GOOGLE_TEST_DEBIAN_INCLUDE_DIR | |
33 NAMES gtest.h | |
34 PATHS | |
35 ${CROSSTOOL_NG_IMAGE}/usr/include/gtest | |
36 ) | |
37 | |
38 message("Path to the Debian Google Test sources: ${GOOGLE_TEST_DEBIAN_SOURCES_DIR}") | |
39 message("Path to the Debian Google Test includes: ${GOOGLE_TEST_DEBIAN_INCLUDE_DIR}") | |
40 | |
41 set(GOOGLE_TEST_SOURCES | |
42 ${GOOGLE_TEST_DEBIAN_SOURCES_DIR}/src/gtest-all.cc | |
43 ) | |
44 | |
45 include_directories(${GOOGLE_TEST_DEBIAN_SOURCES_DIR}) | |
46 | |
47 if (NOT EXISTS ${GOOGLE_TEST_SOURCES} OR | |
48 NOT EXISTS ${GOOGLE_TEST_DEBIAN_INCLUDE_DIR}/gtest.h) | |
49 message(FATAL_ERROR "Please install the libgtest-dev package") | |
50 endif() | |
51 | |
52 elseif (STATIC_BUILD OR NOT USE_SYSTEM_GOOGLE_TEST) | |
53 set(GOOGLE_TEST_SOURCES_DIR ${CMAKE_BINARY_DIR}/googletest-release-1.8.1) | |
148
8335b42be9fc
migration to UCLouvain servers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
145
diff
changeset
|
54 set(GOOGLE_TEST_URL "https://orthanc.uclouvain.be/downloads/third-party-downloads/gtest-1.8.1.tar.gz") |
145 | 55 set(GOOGLE_TEST_MD5 "2e6fbeb6a91310a16efe181886c59596") |
56 | |
57 DownloadPackage(${GOOGLE_TEST_MD5} ${GOOGLE_TEST_URL} "${GOOGLE_TEST_SOURCES_DIR}") | |
58 | |
59 include_directories( | |
60 ${GOOGLE_TEST_SOURCES_DIR}/googletest | |
61 ${GOOGLE_TEST_SOURCES_DIR}/googletest/include | |
62 ${GOOGLE_TEST_SOURCES_DIR} | |
63 ) | |
64 | |
65 set(GOOGLE_TEST_SOURCES | |
66 ${GOOGLE_TEST_SOURCES_DIR}/googletest/src/gtest-all.cc | |
67 ) | |
68 | |
69 # https://code.google.com/p/googletest/issues/detail?id=412 | |
70 if (MSVC) # VS2012 does not support tuples correctly yet | |
71 add_definitions(/D _VARIADIC_MAX=10) | |
72 endif() | |
73 | |
74 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") | |
75 add_definitions(-DGTEST_HAS_CLONE=0) | |
76 endif() | |
77 | |
78 source_group(ThirdParty\\GoogleTest REGULAR_EXPRESSION ${GOOGLE_TEST_SOURCES_DIR}/.*) | |
79 | |
80 else() | |
81 include(FindGTest) | |
82 if (NOT GTEST_FOUND) | |
83 message(FATAL_ERROR "Unable to find GoogleTest") | |
84 endif() | |
85 | |
86 include_directories(${GTEST_INCLUDE_DIRS}) | |
87 | |
88 # The variable GTEST_LIBRARIES contains the shared library of | |
89 # Google Test, create an alias for more uniformity | |
90 set(GOOGLE_TEST_LIBRARIES ${GTEST_LIBRARIES}) | |
91 endif() |