annotate Resources/Orthanc/CMake/GoogleTestConfiguration.cmake @ 382:97f12bcd1826 db-protobuf

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