Mercurial > hg > orthanc
annotate OrthancFramework/UnitTestsSources/CMakeLists.txt @ 4991:3cdda1cec537
fix
author | Alain Mazy <am@osimis.io> |
---|---|
date | Sun, 01 May 2022 12:38:52 +0200 |
parents | 43e613a7756b |
children | 0ea402b4d901 |
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 |
4870
43e613a7756b
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4831
diff
changeset
|
4 # Copyright (C) 2017-2022 Osimis S.A., Belgium |
43e613a7756b
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4831
diff
changeset
|
5 # Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
4120
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4117
diff
changeset
|
6 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4117
diff
changeset
|
7 # 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
|
8 # 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
|
9 # 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
|
10 # the License, or (at your option) any later version. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4117
diff
changeset
|
11 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4117
diff
changeset
|
12 # 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
|
13 # WITHOUT ANY WARRANTY; without even the implied warranty of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4117
diff
changeset
|
14 # 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
|
15 # Lesser General Public License for more details. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4117
diff
changeset
|
16 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4117
diff
changeset
|
17 # 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
|
18 # License along with this program. If not, see |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4117
diff
changeset
|
19 # <http://www.gnu.org/licenses/>. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4117
diff
changeset
|
20 |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4117
diff
changeset
|
21 |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 ## |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 ## 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
|
24 ## |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 cmake_minimum_required(VERSION 2.8) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 project(UnitTestsProject) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 |
4094
1c89208fbba9
fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
29 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
|
30 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
|
31 |
4094
1c89208fbba9
fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
32 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
|
33 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
|
34 |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 if (UNIT_TESTS_WITH_HTTP_CONNEXIONS) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 else() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 |
4535
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
41 if (ORTHANC_FRAMEWORK_STATIC) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
42 include_directories(${ORTHANC_FRAMEWORK_ROOT}/..) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
43 else() |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
44 include(CheckIncludeFile) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
45 include(CheckIncludeFileCXX) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
46 |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
47 link_libraries(jsoncpp) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
48 |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
49 include(FindLua) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
50 if (NOT LUA_FOUND) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
51 message(FATAL_ERROR "Please install the liblua-dev package") |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
52 endif() |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
53 include_directories(${LUA_INCLUDE_DIR}) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
54 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
|
55 |
4535
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
56 check_include_file(sqlite3.h HAVE_SQLITE_H) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
57 if (NOT HAVE_SQLITE_H) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
58 message(FATAL_ERROR "Please install the libsqlite3-dev package") |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
59 endif() |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
60 link_libraries(sqlite3) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
61 |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
62 check_include_file_cxx(pugixml.hpp HAVE_PUGIXML_H) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
63 if (NOT HAVE_PUGIXML_H) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
64 message(FATAL_ERROR "Please install the libpugixml-dev package") |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
65 endif() |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
66 link_libraries(pugixml) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
67 |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
68 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
|
69 if (NOT Boost_FOUND) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
70 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
|
71 endif() |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
72 link_libraries(${Boost_LIBRARIES}) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
73 |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
74 include(FindDCMTK NO_MODULE) |
c40c1234a696
simplification of DownloadOrthancFramework.cmake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4531
diff
changeset
|
75 link_libraries(${DCMTK_LIBRARIES}) |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 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
|
79 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/GoogleTestConfiguration.cmake) |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 add_definitions( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 -DORTHANC_UNIT_TESTS_LINK_FRAMEWORK=1 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 -DORTHANC_BUILD_UNIT_TESTS=1 # For "HierarchicalZipWriter" tests |
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 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 add_executable(UnitTests |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 ${CMAKE_SOURCE_DIR}/SharedLibraryUnitTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 ${CMAKE_SOURCE_DIR}/DicomMapTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 ${CMAKE_SOURCE_DIR}/FileStorageTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 ${CMAKE_SOURCE_DIR}/FrameworkTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 ${CMAKE_SOURCE_DIR}/FromDcmtkTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 ${CMAKE_SOURCE_DIR}/ImageProcessingTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 ${CMAKE_SOURCE_DIR}/ImageTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 ${CMAKE_SOURCE_DIR}/JobsTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 ${CMAKE_SOURCE_DIR}/JpegLosslessTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 ${CMAKE_SOURCE_DIR}/LoggingTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 ${CMAKE_SOURCE_DIR}/LuaTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 ${CMAKE_SOURCE_DIR}/MemoryCacheTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 ${CMAKE_SOURCE_DIR}/RestApiTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 ${CMAKE_SOURCE_DIR}/SQLiteChromiumTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 ${CMAKE_SOURCE_DIR}/SQLiteTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 ${CMAKE_SOURCE_DIR}/StreamTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 ${CMAKE_SOURCE_DIR}/ToolboxTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 ${CMAKE_SOURCE_DIR}/ZipTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
107 ${AUTOGENERATED_SOURCES} |
4307
2a9d304b3a82
fix build of Orthanc framework DLL for Windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4120
diff
changeset
|
108 ${BOOST_SOURCES} |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
109 ${GOOGLE_TEST_SOURCES} |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 |
4097
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4094
diff
changeset
|
112 target_link_libraries(UnitTests ${ORTHANC_FRAMEWORK_LIBRARIES}) |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 install(TARGETS UnitTests |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 DESTINATION ${ORTHANC_FRAMEWORK_LIBDIR} |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 ) |