annotate OrthancFramework/UnitTestsSources/CMakeLists.txt @ 4771:9f207131c7f4

added ParsedDicomFile::LookupSubSequence()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 25 Aug 2021 17:20:21 +0200
parents c40c1234a696
children 7053502fbf97
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4120
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
1 # Orthanc - A Lightweight, RESTful DICOM Store
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
3 # Department, University Hospital of Liege, Belgium
4437
d9473bd5ed43 upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4309
diff changeset
4 # Copyright (C) 2017-2021 Osimis S.A., Belgium
4120
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
5 #
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
6 # This program is free software: you can redistribute it and/or
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
7 # modify it under the terms of the GNU Lesser General Public License
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
8 # as published by the Free Software Foundation, either version 3 of
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
9 # the License, or (at your option) any later version.
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
10 #
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
11 # 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: 4117
diff changeset
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
14 # Lesser General Public License for more details.
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
15 #
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
16 # You should have received a copy of the GNU Lesser General Public
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
17 # License along with this program. If not, see
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
18 # <http://www.gnu.org/licenses/>.
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
19
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4117
diff changeset
20
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 ##
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 ## This file is meant to be used only by ../SharedLibrary/CMakeLists.txt
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 ##
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 cmake_minimum_required(VERSION 2.8)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 project(UnitTestsProject)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
4094
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
28 set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)")
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
29 set(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests")
4309
73de065622ec missing cmake parameters if building unit tests of framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4307
diff changeset
30
4094
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
31 set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)")
4309
73de065622ec missing cmake parameters if building unit tests of framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4307
diff changeset
32 set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test")
73de065622ec missing cmake parameters if building unit tests of framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4307
diff changeset
33
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 if (UNIT_TESTS_WITH_HTTP_CONNEXIONS)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 else()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
4535
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
40 if (ORTHANC_FRAMEWORK_STATIC)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
41 include_directories(${ORTHANC_FRAMEWORK_ROOT}/..)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
42 else()
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
43 include(CheckIncludeFile)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
44 include(CheckIncludeFileCXX)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
45
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
46 link_libraries(jsoncpp)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
47
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
48 include(FindLua)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
49 if (NOT LUA_FOUND)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
50 message(FATAL_ERROR "Please install the liblua-dev package")
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
51 endif()
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
52 include_directories(${LUA_INCLUDE_DIR})
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
53 link_libraries(${LUA_LIBRARIES})
4496
9ea70ccf0c21 Possibility to generate a static library containing the Orthanc Framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4437
diff changeset
54
4535
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
55 check_include_file(sqlite3.h HAVE_SQLITE_H)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
56 if (NOT HAVE_SQLITE_H)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
57 message(FATAL_ERROR "Please install the libsqlite3-dev package")
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
58 endif()
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
59 link_libraries(sqlite3)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
60
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
61 check_include_file_cxx(pugixml.hpp HAVE_PUGIXML_H)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
62 if (NOT HAVE_PUGIXML_H)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
63 message(FATAL_ERROR "Please install the libpugixml-dev package")
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
64 endif()
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
65 link_libraries(pugixml)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
66
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
67 find_package(Boost COMPONENTS filesystem thread system date_time iostreams locale regex)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
68 if (NOT Boost_FOUND)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
69 message(FATAL_ERROR "Unable to locate Boost on this system")
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
70 endif()
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
71 link_libraries(${Boost_LIBRARIES})
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
72
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
73 include(FindDCMTK NO_MODULE)
c40c1234a696 simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4531
diff changeset
74 link_libraries(${DCMTK_LIBRARIES})
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DownloadOrthancFramework.cmake)
4094
1c89208fbba9 fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4063
diff changeset
78 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/GoogleTestConfiguration.cmake)
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 add_definitions(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 -DORTHANC_UNIT_TESTS_LINK_FRAMEWORK=1
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 -DORTHANC_BUILD_UNIT_TESTS=1 # For "HierarchicalZipWriter" tests
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 add_executable(UnitTests
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 ${CMAKE_SOURCE_DIR}/SharedLibraryUnitTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 ${CMAKE_SOURCE_DIR}/DicomMapTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 ${CMAKE_SOURCE_DIR}/FileStorageTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 ${CMAKE_SOURCE_DIR}/FrameworkTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 ${CMAKE_SOURCE_DIR}/FromDcmtkTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 ${CMAKE_SOURCE_DIR}/ImageProcessingTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 ${CMAKE_SOURCE_DIR}/ImageTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 ${CMAKE_SOURCE_DIR}/JobsTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 ${CMAKE_SOURCE_DIR}/JpegLosslessTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 ${CMAKE_SOURCE_DIR}/LoggingTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 ${CMAKE_SOURCE_DIR}/LuaTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 ${CMAKE_SOURCE_DIR}/MemoryCacheTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 ${CMAKE_SOURCE_DIR}/RestApiTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 ${CMAKE_SOURCE_DIR}/SQLiteChromiumTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 ${CMAKE_SOURCE_DIR}/SQLiteTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 ${CMAKE_SOURCE_DIR}/StreamTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 ${CMAKE_SOURCE_DIR}/ToolboxTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 ${CMAKE_SOURCE_DIR}/ZipTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 ${AUTOGENERATED_SOURCES}
4307
2a9d304b3a82 fix build of Orthanc framework DLL for Windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4120
diff changeset
107 ${BOOST_SOURCES}
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 ${GOOGLE_TEST_SOURCES}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110
4097
99e2054d1e8d fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4094
diff changeset
111 target_link_libraries(UnitTests ${ORTHANC_FRAMEWORK_LIBRARIES})
4063
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 install(TARGETS UnitTests
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 DESTINATION ${ORTHANC_FRAMEWORK_LIBDIR}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 )