Mercurial > hg > orthanc-stl
comparison CMakeLists.txt @ 62:b798387b085c
added 3DHOP viewer version 4.3
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 15 Jun 2024 16:08:52 +0200 |
parents | 5dc3f3dcc092 |
children | 5e11f5880e6d |
comparison
equal
deleted
inserted
replaced
61:5dc3f3dcc092 | 62:b798387b085c |
---|---|
58 set(ORTHANC_FRAMEWORK_ARCHIVE "" CACHE STRING "Path to the Orthanc archive, if ORTHANC_FRAMEWORK_SOURCE is \"archive\"") | 58 set(ORTHANC_FRAMEWORK_ARCHIVE "" CACHE STRING "Path to the Orthanc archive, if ORTHANC_FRAMEWORK_SOURCE is \"archive\"") |
59 set(ORTHANC_FRAMEWORK_ROOT "" CACHE STRING "Path to the Orthanc source directory, if ORTHANC_FRAMEWORK_SOURCE is \"path\"") | 59 set(ORTHANC_FRAMEWORK_ROOT "" CACHE STRING "Path to the Orthanc source directory, if ORTHANC_FRAMEWORK_SOURCE is \"path\"") |
60 | 60 |
61 # New in release 1.1 | 61 # New in release 1.1 |
62 set(ENABLE_NEXUS ON CACHE BOOL "Include support for Nexus 3D models") | 62 set(ENABLE_NEXUS ON CACHE BOOL "Include support for Nexus 3D models") |
63 | |
64 # New in release 1.2 | |
65 set(ENABLE_3DHOP ON CACHE BOOL "Include support for 3DHOP viewer") | |
63 | 66 |
64 # Advanced parameters to fine-tune linking against system libraries | 67 # Advanced parameters to fine-tune linking against system libraries |
65 SET(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK") | 68 SET(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK") |
66 | 69 |
67 # Parameters to fine-tune linking against system libraries | 70 # Parameters to fine-tune linking against system libraries |
169 | 172 |
170 ##################################################################### | 173 ##################################################################### |
171 ## Create the autogenerated files | 174 ## Create the autogenerated files |
172 ##################################################################### | 175 ##################################################################### |
173 | 176 |
177 if (ENABLE_3DHOP AND NOT | |
178 ENABLE_NEXUS) | |
179 message(FATAL_ERROR "3DHOP necessitates Nexus support") | |
180 endif() | |
181 | |
174 set(EMBEDDED_RESOURCES | 182 set(EMBEDDED_RESOURCES |
183 ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/Sources/OrthancExplorer.js | |
184 | |
185 # These resources correspond to the "Basic viewer built using Three.js" | |
175 THREE_HTML ${CMAKE_SOURCE_DIR}/WebApplications/three.html | 186 THREE_HTML ${CMAKE_SOURCE_DIR}/WebApplications/three.html |
176 THREE_JS ${CMAKE_SOURCE_DIR}/WebApplications/three.js | 187 THREE_JS ${CMAKE_SOURCE_DIR}/WebApplications/three.js |
188 | |
189 # These resources correspond to Online3DViewer | |
177 O3DV_HTML ${CMAKE_SOURCE_DIR}/WebApplications/o3dv.html | 190 O3DV_HTML ${CMAKE_SOURCE_DIR}/WebApplications/o3dv.html |
178 O3DV_JS ${CMAKE_SOURCE_DIR}/WebApplications/o3dv.js | 191 O3DV_JS ${CMAKE_SOURCE_DIR}/WebApplications/o3dv.js |
179 ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/Sources/OrthancExplorer.js | 192 ) |
180 ) | 193 |
181 | 194 set(STATIC_ASSETS_PREFIXES "o3dv") |
182 set(STATIC_ASSETS | 195 set(STATIC_ASSETS_CONTENT "${CMAKE_SOURCE_DIR}/JavaScriptLibraries/dist-o3dv") |
183 ${CMAKE_SOURCE_DIR}/JavaScriptLibraries/dist | 196 |
184 ) | 197 list(APPEND STATIC_ASSETS_PREFIXES "basic-viewer") |
198 list(APPEND STATIC_ASSETS_CONTENT "${CMAKE_SOURCE_DIR}/JavaScriptLibraries/dist-three") | |
185 | 199 |
186 if (ENABLE_NEXUS) | 200 if (ENABLE_NEXUS) |
187 set(NEXUS_ASSETS_DIR ${AUTOGENERATED_DIR}/nexus) | 201 set(NEXUS_ASSETS_DIR ${AUTOGENERATED_DIR}/nexus) |
188 file(MAKE_DIRECTORY ${NEXUS_ASSETS_DIR}) | 202 file(MAKE_DIRECTORY ${NEXUS_ASSETS_DIR}) |
189 | 203 |
190 DownloadCompressedFile( | 204 DownloadCompressedFile( |
191 "df21a4a192c0952a1189125609cc76f9" | 205 "df21a4a192c0952a1189125609cc76f9" |
192 "https://orthanc.uclouvain.be/downloads/third-party-downloads/STL/three-84.js.gz" | 206 "https://orthanc.uclouvain.be/downloads/third-party-downloads/STL/three-84.js.gz" |
193 "${NEXUS_ASSETS_DIR}/three-84.js") | 207 "${NEXUS_ASSETS_DIR}/three-84.js") |
208 | |
209 list(APPEND STATIC_ASSETS_PREFIXES "nexus") | |
210 list(APPEND STATIC_ASSETS_CONTENT | |
211 ${NEXUS_ASSETS_DIR} # This adds "three-84.js" that is needed by the Nexus viewer | |
212 ) | |
194 | 213 |
195 list(APPEND EMBEDDED_RESOURCES | 214 list(APPEND EMBEDDED_RESOURCES |
196 NEXUS_HTML ${CMAKE_SOURCE_DIR}/Resources/Nexus/threejs.html | 215 NEXUS_HTML ${CMAKE_SOURCE_DIR}/Resources/Nexus/threejs.html |
197 NEXUS_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/nexus.js | 216 NEXUS_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/nexus.js |
198 NEXUS_MECO_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/meco.js | 217 NEXUS_MECO_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/meco.js |
199 NEXUS_THREE_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/nexus_three.js | 218 NEXUS_THREE_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/nexus_three.js |
200 NEXUS_TRACKBALL_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/TrackballControls.js | 219 NEXUS_TRACKBALL_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/TrackballControls.js |
201 ) | 220 ) |
202 | 221 |
203 list(APPEND STATIC_ASSETS | 222 add_definitions(-DORTHANC_ENABLE_NEXUS=1) |
204 ${NEXUS_ASSETS_DIR} | 223 |
224 if (ENABLE_3DHOP) | |
225 include(${CMAKE_SOURCE_DIR}/Resources/CMake/3DHOP.cmake) | |
226 add_definitions(-DORTHANC_ENABLE_3DHOP=1) | |
227 else() | |
228 add_definitions(-DORTHANC_ENABLE_3DHOP=0) | |
229 endif() | |
230 else() | |
231 add_definitions( | |
232 -DORTHANC_ENABLE_NEXUS=0 | |
233 -DORTHANC_ENABLE_3DHOP=0 | |
205 ) | 234 ) |
206 | |
207 add_definitions(-DORTHANC_ENABLE_NEXUS=1) | |
208 else() | |
209 add_definitions(-DORTHANC_ENABLE_NEXUS=0) | |
210 endif() | 235 endif() |
211 | 236 |
212 EmbedResources(${EMBEDDED_RESOURCES}) | 237 EmbedResources(${EMBEDDED_RESOURCES}) |
213 | 238 |
214 add_custom_command( | 239 add_custom_command( |
216 ${AUTOGENERATED_DIR}/StaticAssets.cpp | 241 ${AUTOGENERATED_DIR}/StaticAssets.cpp |
217 COMMAND | 242 COMMAND |
218 ${PYTHON_EXECUTABLE} | 243 ${PYTHON_EXECUTABLE} |
219 ${CMAKE_SOURCE_DIR}/Resources/EmbedStaticAssets.py | 244 ${CMAKE_SOURCE_DIR}/Resources/EmbedStaticAssets.py |
220 ${AUTOGENERATED_DIR}/StaticAssets.cpp | 245 ${AUTOGENERATED_DIR}/StaticAssets.cpp |
221 ${STATIC_ASSETS} | 246 ${STATIC_ASSETS_PREFIXES} |
247 ${STATIC_ASSETS_CONTENT} | |
222 DEPENDS | 248 DEPENDS |
223 ${CMAKE_SOURCE_DIR}/Resources/EmbedStaticAssets.py | 249 ${CMAKE_SOURCE_DIR}/Resources/EmbedStaticAssets.py |
224 ${STATIC_ASSETS} | 250 ${STATIC_ASSETS_CONTENT} |
225 ) | 251 ) |
226 | 252 |
227 list(APPEND AUTOGENERATED_SOURCES | 253 list(APPEND AUTOGENERATED_SOURCES |
228 ${AUTOGENERATED_DIR}/StaticAssets.cpp | 254 ${AUTOGENERATED_DIR}/StaticAssets.cpp |
229 ) | 255 ) |