Mercurial > hg > orthanc
annotate OrthancFramework/UnitTestsSources/CMakeLists.txt @ 4110:d99739cbe94c
make DicomInstanceHasher and ParsedDicomDir public classes
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 07 Jul 2020 10:03:59 +0200 |
parents | 99e2054d1e8d |
children | 9286649df279 |
rev | line source |
---|---|
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 ## |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 ## 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
|
3 ## |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 cmake_minimum_required(VERSION 2.8) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 project(UnitTestsProject) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 |
4094
1c89208fbba9
fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
8 set(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages") |
1c89208fbba9
fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
9 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
|
10 set(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests") |
1c89208fbba9
fix build of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4063
diff
changeset
|
11 set(USE_GOOGLE_TEST_DEBIAN_PACKAGE OFF CACHE BOOL "Use the sources of Google Test shipped with libgtest-dev (Debian only)") |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 if (UNIT_TESTS_WITH_HTTP_CONNEXIONS) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 else() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 if (NOT ORTHANC_FRAMEWORK_STATIC) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 set(ENABLE_DCMTK ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 set(ENABLE_LUA ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 set(ENABLE_PUGIXML ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 set(ENABLE_SQLITE ON) |
4097
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4094
diff
changeset
|
24 |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4094
diff
changeset
|
25 set(USE_SYSTEM_GOOGLE_TEST ON CACHE BOOL "Use the system version of Google Test") |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4094
diff
changeset
|
26 else() |
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4094
diff
changeset
|
27 set(USE_SYSTEM_GOOGLE_TEST OFF CACHE INTERNAL "") |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 endif() |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 set(ENABLE_GOOGLE_TEST ON) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 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
|
32 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/GoogleTestConfiguration.cmake) |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 add_definitions( |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 -DORTHANC_UNIT_TESTS_LINK_FRAMEWORK=1 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 -DORTHANC_BUILD_UNIT_TESTS=1 # For "HierarchicalZipWriter" tests |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 add_executable(UnitTests |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 ${CMAKE_SOURCE_DIR}/SharedLibraryUnitTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 ${CMAKE_SOURCE_DIR}/DicomMapTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 ${CMAKE_SOURCE_DIR}/FileStorageTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 ${CMAKE_SOURCE_DIR}/FrameworkTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 ${CMAKE_SOURCE_DIR}/FromDcmtkTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 ${CMAKE_SOURCE_DIR}/ImageProcessingTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 ${CMAKE_SOURCE_DIR}/ImageTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 ${CMAKE_SOURCE_DIR}/JobsTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 ${CMAKE_SOURCE_DIR}/JpegLosslessTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 ${CMAKE_SOURCE_DIR}/LoggingTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 ${CMAKE_SOURCE_DIR}/LuaTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 ${CMAKE_SOURCE_DIR}/MemoryCacheTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 ${CMAKE_SOURCE_DIR}/RestApiTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 ${CMAKE_SOURCE_DIR}/SQLiteChromiumTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 ${CMAKE_SOURCE_DIR}/SQLiteTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 ${CMAKE_SOURCE_DIR}/StreamTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 ${CMAKE_SOURCE_DIR}/ToolboxTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 ${CMAKE_SOURCE_DIR}/ZipTests.cpp |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 ${AUTOGENERATED_SOURCES} |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 ${GOOGLE_TEST_SOURCES} |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 ) |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 |
4097
99e2054d1e8d
fix unit tests for orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4094
diff
changeset
|
64 target_link_libraries(UnitTests ${ORTHANC_FRAMEWORK_LIBRARIES}) |
4063
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 install(TARGETS UnitTests |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 DESTINATION ${ORTHANC_FRAMEWORK_LIBDIR} |
e00f3d089991
shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 ) |