annotate OrthancFramework/UnitTestsSources/CMakeLists.txt @ 4083:26efd0404d97 framework

integration mainline->framework
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 23 Jun 2020 07:39:42 +0200
parents e00f3d089991
children 1c89208fbba9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 SET(UNIT_TESTS_WITH_HTTP_CONNEXIONS ON CACHE BOOL "Allow unit tests to make HTTP requests")
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 if (UNIT_TESTS_WITH_HTTP_CONNEXIONS)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=1)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 else()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 add_definitions(-DUNIT_TESTS_WITH_HTTP_CONNEXIONS=0)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 endif()
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 if (NOT ORTHANC_FRAMEWORK_STATIC)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 set(ENABLE_DCMTK ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 set(ENABLE_LUA ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 set(ENABLE_PUGIXML ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 set(ENABLE_SQLITE ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 endif()
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 set(ENABLE_GOOGLE_TEST ON)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 include(${CMAKE_SOURCE_DIR}/../Resources/CMake/DownloadOrthancFramework.cmake)
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 add_definitions(
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 -DORTHANC_UNIT_TESTS_LINK_FRAMEWORK=1
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 -DORTHANC_BUILD_UNIT_TESTS=1 # For "HierarchicalZipWriter" tests
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
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 add_executable(UnitTests
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 ${CMAKE_SOURCE_DIR}/SharedLibraryUnitTests.cpp
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 ${CMAKE_SOURCE_DIR}/DicomMapTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 ${CMAKE_SOURCE_DIR}/FileStorageTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 ${CMAKE_SOURCE_DIR}/FrameworkTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 ${CMAKE_SOURCE_DIR}/FromDcmtkTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 ${CMAKE_SOURCE_DIR}/ImageProcessingTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 ${CMAKE_SOURCE_DIR}/ImageTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 ${CMAKE_SOURCE_DIR}/JobsTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 ${CMAKE_SOURCE_DIR}/JpegLosslessTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 ${CMAKE_SOURCE_DIR}/LoggingTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 ${CMAKE_SOURCE_DIR}/LuaTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 ${CMAKE_SOURCE_DIR}/MemoryCacheTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 ${CMAKE_SOURCE_DIR}/RestApiTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 ${CMAKE_SOURCE_DIR}/SQLiteChromiumTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 ${CMAKE_SOURCE_DIR}/SQLiteTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 ${CMAKE_SOURCE_DIR}/StreamTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 ${CMAKE_SOURCE_DIR}/ToolboxTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 ${CMAKE_SOURCE_DIR}/ZipTests.cpp
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 ${AUTOGENERATED_SOURCES}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 ${GOOGLE_TEST_SOURCES}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 )
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 target_link_libraries(UnitTests OrthancFramework)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 set_target_properties(UnitTests PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 set_target_properties(UnitTests PROPERTIES INSTALL_RPATH ${ORTHANC_FRAMEWORK_LIBDIR})
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 install(TARGETS UnitTests
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 DESTINATION ${ORTHANC_FRAMEWORK_LIBDIR}
e00f3d089991 shared library of orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 )