comparison Samples/Sdl/CMakeLists.txt @ 1419:f5493e5a51a3

single CMakeLists.txt for all SDL samples & unit tests + another one for all Wasm samples
author Alain Mazy <alain@mazy.be>
date Wed, 13 May 2020 12:42:52 +0200
parents
children 9e7015edd107
comparison
equal deleted inserted replaced
1415:998697c5ec74 1419:f5493e5a51a3
1 cmake_minimum_required(VERSION 2.8.10)
2
3 project(OrthancStone)
4
5 set(ORTHANC_FRAMEWORK_SOURCE "path")
6 set(ORTHANC_FRAMEWORK_ROOT ${CMAKE_CURRENT_LIST_DIR}/../../../orthanc)
7 set(STONE_ROOT ${CMAKE_CURRENT_LIST_DIR}/../../)
8
9 include(${STONE_ROOT}/Resources/CMake/OrthancStoneParameters.cmake)
10 include(${ORTHANC_ROOT}/Resources/CMake/DownloadPackage.cmake)
11
12 set(ALLOW_DOWNLOADS ON)
13 if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
14 set(STATIC_BUILD ON)
15 endif()
16 set(ENABLE_GOOGLE_TEST ON)
17 set(ENABLE_LOCALE ON) # Necessary for text rendering
18 set(ENABLE_SDL ON)
19 set(ENABLE_DCMTK ON) # <==
20 set(ENABLE_OPENGL ON) # <==
21 set(ENABLE_WEB_CLIENT ON)
22 set(ORTHANC_SANDBOXED OFF)
23
24 DownloadPackage(
25 "a24b8136b8f3bb93f166baf97d9328de"
26 "http://orthanc.osimis.io/ThirdPartyDownloads/ubuntu-font-family-0.83.zip"
27 "${CMAKE_BINARY_DIR}/ubuntu-font-family-0.83")
28
29 set(ORTHANC_STONE_APPLICATION_RESOURCES
30 UBUNTU_FONT ${CMAKE_BINARY_DIR}/ubuntu-font-family-0.83/Ubuntu-R.ttf
31 )
32
33 include(${STONE_ROOT}/Resources/CMake/OrthancStoneConfiguration.cmake)
34 include(${STONE_ROOT}/Resources/CMake/Utilities.cmake)
35
36 include_directories(${STONE_ROOT})
37 include_directories(../Common)
38
39 add_definitions(
40 -DORTHANC_ENABLE_LOGGING=1
41 -DORTHANC_ENABLE_LOGGING_PLUGIN=0
42 -DORTHANC_ENABLE_PUGIXML=0
43 -DORTHANC_DEFAULT_DICOM_ENCODING=Encoding_Latin1
44 )
45
46 SortFilesInSourceGroups()
47
48 add_library(OrthancStone STATIC
49 ${ORTHANC_STONE_SOURCES}
50 )
51
52
53 #############################
54 project(RtViewerSdl)
55
56 add_executable(RtViewerSdl
57 RtViewer/RtViewerSdl.cpp
58 SdlHelpers.h
59 ../Common/RtViewer.cpp
60 ../Common/RtViewer.h
61 ../Common/SampleHelpers.h
62 )
63
64 target_link_libraries(RtViewerSdl ${DCMTK_LIBRARIES} OrthancStone)
65
66 #############################
67 project(SdlSimpleViewer)
68
69 add_executable(SdlSimpleViewer
70 SdlHelpers.h
71 ../Common/SampleHelpers.h
72 SingleFrameViewer/SdlSimpleViewerApplication.h
73 SingleFrameViewer/SdlSimpleViewer.cpp
74 )
75
76 target_link_libraries(SdlSimpleViewer ${DCMTK_LIBRARIES} OrthancStone)
77
78 #############################
79 project(UnitTests)
80
81 add_executable(UnitTests
82 ${GOOGLE_TEST_SOURCES}
83 ${ORTHANC_STONE_ROOT}/UnitTestsSources/GenericToolboxTests.cpp
84 ${ORTHANC_STONE_ROOT}/UnitTestsSources/ImageToolboxTests.cpp
85 ${ORTHANC_STONE_ROOT}/UnitTestsSources/PixelTestPatternsTests.cpp
86 ${ORTHANC_STONE_ROOT}/UnitTestsSources/TestCommands.cpp
87 ${ORTHANC_STONE_ROOT}/UnitTestsSources/TestMessageBroker.cpp
88 ${ORTHANC_STONE_ROOT}/UnitTestsSources/TestStrategy.cpp
89 ${ORTHANC_STONE_ROOT}/UnitTestsSources/TestStructureSet.cpp
90 ${ORTHANC_STONE_ROOT}/UnitTestsSources/UnitTestsMain.cpp
91 )
92
93 target_link_libraries(UnitTests OrthancStone)
94
95 add_custom_command(
96 TARGET UnitTests
97 POST_BUILD
98 COMMAND ${CMAKE_COMMAND} -E copy
99 "${ORTHANC_STONE_ROOT}/UnitTestsSources/72c773ac-5059f2c4-2e6a9120-4fd4bca1-45701661.json"
100 "$<TARGET_FILE_DIR:UnitTests>/72c773ac-5059f2c4-2e6a9120-4fd4bca1-45701661.json"
101 )
102
103 target_link_libraries(UnitTests ${DCMTK_LIBRARIES} OrthancStone)