comparison CMakeLists.txt @ 46:9b2a2fcc9878 nexus

added option to disable Nexus support
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 Apr 2024 07:49:45 +0200
parents 967f947014ac
children 0a408a81fb15
comparison
equal deleted inserted replaced
45:967f947014ac 46:9b2a2fcc9878
55 SET(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages") 55 SET(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages")
56 set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc framework (can be \"system\", \"hg\", \"archive\", \"web\" or \"path\")") 56 set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc framework (can be \"system\", \"hg\", \"archive\", \"web\" or \"path\")")
57 set(ORTHANC_FRAMEWORK_VERSION "${ORTHANC_FRAMEWORK_DEFAULT_VERSION}" CACHE STRING "Version of the Orthanc framework") 57 set(ORTHANC_FRAMEWORK_VERSION "${ORTHANC_FRAMEWORK_DEFAULT_VERSION}" CACHE STRING "Version of the Orthanc framework")
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
61 # New in release 2.0
62 set(ENABLE_NEXUS OFF CACHE BOOL "Include support for Nexus 3D models")
60 63
61 # Advanced parameters to fine-tune linking against system libraries 64 # Advanced parameters to fine-tune linking against system libraries
62 SET(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK") 65 SET(USE_SYSTEM_ORTHANC_SDK ON CACHE BOOL "Use the system version of the Orthanc plugin SDK")
63 66
64 # Parameters to fine-tune linking against system libraries 67 # Parameters to fine-tune linking against system libraries
166 169
167 ##################################################################### 170 #####################################################################
168 ## Create the autogenerated files 171 ## Create the autogenerated files
169 ##################################################################### 172 #####################################################################
170 173
171 EmbedResources( 174 set(EMBEDDED_RESOURCES
172 THREE_HTML ${CMAKE_SOURCE_DIR}/WebApplications/three.html 175 THREE_HTML ${CMAKE_SOURCE_DIR}/WebApplications/three.html
173 THREE_JS ${CMAKE_SOURCE_DIR}/WebApplications/three.js 176 THREE_JS ${CMAKE_SOURCE_DIR}/WebApplications/three.js
174 O3DV_HTML ${CMAKE_SOURCE_DIR}/WebApplications/o3dv.html 177 O3DV_HTML ${CMAKE_SOURCE_DIR}/WebApplications/o3dv.html
175 O3DV_JS ${CMAKE_SOURCE_DIR}/WebApplications/o3dv.js 178 O3DV_JS ${CMAKE_SOURCE_DIR}/WebApplications/o3dv.js
176 ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/Sources/OrthancExplorer.js 179 ORTHANC_EXPLORER ${CMAKE_SOURCE_DIR}/Sources/OrthancExplorer.js
177 180 )
178 NEXUS_HTML ${CMAKE_SOURCE_DIR}/Resources/Nexus/threejs.html 181
179 NEXUS_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/nexus.js 182 set(STATIC_ASSETS
180 NEXUS_MECO_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/meco.js 183 ${CMAKE_SOURCE_DIR}/JavaScriptLibraries/dist
181 NEXUS_THREE_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/nexus_three.js 184 )
182 NEXUS_TRACKBALL_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/TrackballControls.js 185
183 ) 186 if (ENABLE_NEXUS)
187 set(NEXUS_ASSETS_DIR ${AUTOGENERATED_DIR}/nexus)
188 file(MAKE_DIRECTORY ${NEXUS_ASSETS_DIR})
189
190 DownloadCompressedFile(
191 "df21a4a192c0952a1189125609cc76f9"
192 "https://orthanc.uclouvain.be/downloads/third-party-downloads/STL/three-84.js.gz"
193 "${NEXUS_ASSETS_DIR}/three-84.js")
194
195 list(APPEND EMBEDDED_RESOURCES
196 NEXUS_HTML ${CMAKE_SOURCE_DIR}/Resources/Nexus/threejs.html
197 NEXUS_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/nexus.js
198 NEXUS_MECO_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/meco.js
199 NEXUS_THREE_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/nexus_three.js
200 NEXUS_TRACKBALL_JS ${CMAKE_SOURCE_DIR}/Resources/Nexus/js/TrackballControls.js
201 )
202
203 list(APPEND STATIC_ASSETS
204 ${NEXUS_ASSETS_DIR}
205 )
206
207 add_definitions(-DORTHANC_ENABLE_NEXUS=1)
208 else()
209 add_definitions(-DORTHANC_ENABLE_NEXUS=0)
210 endif()
211
212 EmbedResources(${EMBEDDED_RESOURCES})
184 213
185 add_custom_command( 214 add_custom_command(
186 OUTPUT 215 OUTPUT
187 ${AUTOGENERATED_DIR}/StaticAssets.cpp 216 ${AUTOGENERATED_DIR}/StaticAssets.cpp
188 COMMAND 217 COMMAND
189 ${PYTHON_EXECUTABLE} 218 ${PYTHON_EXECUTABLE}
190 ${CMAKE_SOURCE_DIR}/Resources/EmbedStaticAssets.py 219 ${CMAKE_SOURCE_DIR}/Resources/EmbedStaticAssets.py
191 ${CMAKE_SOURCE_DIR}/JavaScriptLibraries/dist
192 ${AUTOGENERATED_DIR}/StaticAssets.cpp 220 ${AUTOGENERATED_DIR}/StaticAssets.cpp
221 ${STATIC_ASSETS}
193 DEPENDS 222 DEPENDS
194 ${CMAKE_SOURCE_DIR}/JavaScriptLibraries/dist
195 ${CMAKE_SOURCE_DIR}/Resources/EmbedStaticAssets.py 223 ${CMAKE_SOURCE_DIR}/Resources/EmbedStaticAssets.py
224 ${STATIC_ASSETS}
196 ) 225 )
197 226
198 list(APPEND AUTOGENERATED_SOURCES 227 list(APPEND AUTOGENERATED_SOURCES
199 ${AUTOGENERATED_DIR}/StaticAssets.cpp 228 ${AUTOGENERATED_DIR}/StaticAssets.cpp
200 ) 229 )