comparison Applications/Samples/CMakeLists.txt @ 319:daa04d15192c am-2

new SimpleViewer sample that has been split in multiple files to be able to scale it
author am@osimis.io
date Thu, 11 Oct 2018 13:16:54 +0200
parents 3897f9f28cfa
children 29a79b8c3d39
comparison
equal deleted inserted replaced
318:3a4ca166fafa 319:daa04d15192c
83 ##################################################################### 83 #####################################################################
84 84
85 include_directories(${ORTHANC_STONE_ROOT}) 85 include_directories(${ORTHANC_STONE_ROOT})
86 86
87 # files common to all samples 87 # files common to all samples
88 list(APPEND APPLICATIONS_SOURCES 88 list(APPEND SAMPLE_APPLICATIONS_SOURCES
89 ${ORTHANC_STONE_ROOT}/Applications/Samples/SampleInteractor.h 89 ${ORTHANC_STONE_ROOT}/Applications/Samples/SampleInteractor.h
90 ${ORTHANC_STONE_ROOT}/Applications/Samples/SampleApplicationBase.h 90 ${ORTHANC_STONE_ROOT}/Applications/Samples/SampleApplicationBase.h
91 ) 91 )
92 92
93 if (ENABLE_QT) 93 if (ENABLE_QT)
94 list(APPEND APPLICATIONS_SOURCES 94 list(APPEND SAMPLE_APPLICATIONS_SOURCES
95 ${ORTHANC_STONE_ROOT}/Applications/Samples/Qt/SampleQtApplicationRunner.h 95 ${ORTHANC_STONE_ROOT}/Applications/Samples/Qt/SampleQtApplicationRunner.h
96 ${ORTHANC_STONE_ROOT}/Applications/Samples/Qt/SampleMainWindow.cpp 96 ${ORTHANC_STONE_ROOT}/Applications/Samples/Qt/SampleMainWindow.cpp
97 ${ORTHANC_STONE_ROOT}/Applications/Samples/Qt/SampleMainWindow.ui 97 ${ORTHANC_STONE_ROOT}/Applications/Samples/Qt/SampleMainWindow.ui
98 ) 98 )
99 endif() 99 endif()
100 100
101 if (ENABLE_NATIVE) 101 if (ENABLE_NATIVE)
102 list(APPEND APPLICATIONS_SOURCES 102 list(APPEND SAMPLE_APPLICATIONS_SOURCES
103 ${ORTHANC_STONE_ROOT}/Applications/Samples/SampleMainNative.cpp 103 ${ORTHANC_STONE_ROOT}/Applications/Samples/SampleMainNative.cpp
104 ) 104 )
105 105
106 elseif (ENABLE_WASM) 106 elseif (ENABLE_WASM)
107 107
108 list(APPEND APPLICATIONS_SOURCES 108 list(APPEND SAMPLE_APPLICATIONS_SOURCES
109 ${ORTHANC_STONE_ROOT}/Applications/Samples/SampleMainWasm.cpp 109 ${ORTHANC_STONE_ROOT}/Applications/Samples/SampleMainWasm.cpp
110 ${STONE_WASM_SOURCES} 110 ${STONE_WASM_SOURCES}
111 ) 111 )
112 endif() 112 endif()
113 113
114 114
115 macro(BuildSingleFileSample Target Header Sample) 115 macro(BuildSingleFileSample Target Header Sample)
116 add_executable(${Target} 116 add_executable(${Target}
117 ${ORTHANC_STONE_ROOT}/Applications/Samples/${Header} 117 ${ORTHANC_STONE_ROOT}/Applications/Samples/${Header}
118 ${APPLICATIONS_SOURCES} 118 ${SAMPLE_APPLICATIONS_SOURCES}
119 ) 119 )
120 set_target_properties(${Target} PROPERTIES COMPILE_DEFINITIONS ORTHANC_STONE_SAMPLE=${Sample}) 120 set_target_properties(${Target} PROPERTIES COMPILE_DEFINITIONS ORTHANC_STONE_SAMPLE=${Sample})
121 target_link_libraries(${Target} OrthancStone) 121 target_link_libraries(${Target} OrthancStone)
122 endmacro() 122 endmacro()
123 123
126 #BuildSingleFileSample(OrthancStoneSingleFrame SingleFrameApplication.h 3) 126 #BuildSingleFileSample(OrthancStoneSingleFrame SingleFrameApplication.h 3)
127 #BuildSingleFileSample(OrthancStoneSingleVolume SingleVolumeApplication.h 4) 127 #BuildSingleFileSample(OrthancStoneSingleVolume SingleVolumeApplication.h 4)
128 #BuildSingleFileSample(OrthancStoneBasicPetCtFusion 5) 128 #BuildSingleFileSample(OrthancStoneBasicPetCtFusion 5)
129 #BuildSingleFileSample(OrthancStoneSynchronizedSeries 6) 129 #BuildSingleFileSample(OrthancStoneSynchronizedSeries 6)
130 #BuildSingleFileSample(OrthancStoneLayoutPetCtFusion 7) 130 #BuildSingleFileSample(OrthancStoneLayoutPetCtFusion 7)
131 BuildSingleFileSample(OrthancStoneSimpleViewer SimpleViewerApplication.h 8) 131 BuildSingleFileSample(OrthancStoneSimpleViewerSingleFile SimpleViewerApplicationSingleFile.h 8) # we keep that one just as a sample before we convert another sample to this pattern
132
133 ##### SimpleViewer sample #######
134
135 if (ENABLE_QT)
136 list(APPEND SIMPLE_VIEWER_APPLICATION_SOURCES
137 ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Qt/SimpleViewerMainWindow.cpp
138 ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Qt/SimpleViewerMainWindow.ui
139 ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Qt/mainQt.cpp
140 )
141 elseif (ENABLE_WASM)
142 list(APPEND SIMPLE_VIEWER_APPLICATION_SOURCES
143 ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Wasm/mainWasm.cpp
144 ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Wasm/SimpleViewerWasmApplicationAdapter.cpp
145 ${STONE_WASM_SOURCES}
146 )
147 endif()
148
149 add_executable(OrthancStoneSimpleViewer
150 ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/SimpleViewerApplication.cpp
151 ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/ThumbnailInteractor.cpp
152 ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/MainWidgetInteractor.cpp
153 ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/AppStatus.h
154 ${ORTHANC_STONE_ROOT}/Applications/Samples/SimpleViewer/Messages.h
155 ${SIMPLE_VIEWER_APPLICATION_SOURCES}
156 )
157 target_link_libraries(OrthancStoneSimpleViewer OrthancStone)
158
132 159
133 ##################################################################### 160 #####################################################################
134 ## Build the unit tests 161 ## Build the unit tests
135 ##################################################################### 162 #####################################################################
136 163