Mercurial > hg > orthanc-stone
diff OrthancStone/Resources/CMake/OrthancStoneConfiguration.cmake @ 1591:5887a4f8594b
moving platform-specific files out of the "OrthancStone" folder
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 23 Oct 2020 13:15:03 +0200 |
parents | bd180f97c734 |
children | 621e4e11783d |
line wrap: on
line diff
--- a/OrthancStone/Resources/CMake/OrthancStoneConfiguration.cmake Thu Oct 22 18:39:03 2020 +0200 +++ b/OrthancStone/Resources/CMake/OrthancStoneConfiguration.cmake Fri Oct 23 13:15:03 2020 +0200 @@ -56,45 +56,11 @@ message(FATAL_ERROR "Cannot enable curl in sandboxed environments") endif() - if (ENABLE_SDL) - message(FATAL_ERROR "Cannot enable SDL in sandboxed environments") - endif() - if (ENABLE_SSL) message(FATAL_ERROR "Cannot enable SSL in sandboxed environments") endif() endif() -if (ENABLE_OPENGL) - if (NOT ENABLE_SDL AND NOT ENABLE_WASM) - message(FATAL_ERROR "Cannot enable OpenGL if WebAssembly and SDL are both disabled") - endif() -endif() - -if (ENABLE_WASM) - if (NOT ORTHANC_SANDBOXED) - message(FATAL_ERROR "WebAssembly target must me configured as sandboxed") - endif() - - if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten") - message(FATAL_ERROR "WebAssembly target requires the emscripten compiler") - endif() - - set(ENABLE_THREADS OFF) - set(ENABLE_WEB_CLIENT OFF) - add_definitions(-DORTHANC_ENABLE_WASM=1) -else() - if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR - CMAKE_SYSTEM_NAME STREQUAL "PNaCl" OR - CMAKE_SYSTEM_NAME STREQUAL "NaCl32" OR - CMAKE_SYSTEM_NAME STREQUAL "NaCl64") - message(FATAL_ERROR "Trying to use a Web compiler for a native build") - endif() - - set(ENABLE_THREADS ON) - add_definitions(-DORTHANC_ENABLE_WASM=0) -endif() - ##################################################################### ## Configure mandatory third-party components @@ -118,21 +84,6 @@ endif() -if(ENABLE_SDL) - message("SDL is enabled") - include(${CMAKE_CURRENT_LIST_DIR}/SdlConfiguration.cmake) - add_definitions( - -DORTHANC_ENABLE_SDL=1 - ) -else() - message("SDL is disabled") - unset(USE_SYSTEM_SDL CACHE) - add_definitions( - -DORTHANC_ENABLE_SDL=0 - ) -endif() - - if (ENABLE_THREADS) add_definitions(-DORTHANC_ENABLE_THREADS=1) else() @@ -200,13 +151,6 @@ ## System-specific patches ##################################################################### -if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND - NOT MSVC AND - ENABLE_SDL) - # This is necessary when compiling EXE for Windows using MinGW - link_libraries(mingw32) -endif() - if (ORTHANC_SANDBOXED) # Remove functions not suitable for a sandboxed environment list(REMOVE_ITEM ORTHANC_CORE_SOURCES @@ -222,23 +166,6 @@ ## All the source files required to build Stone of Orthanc ##################################################################### -if (ENABLE_SDL) - list(APPEND ORTHANC_STONE_SOURCES - ${ORTHANC_STONE_ROOT}/Sources/Viewport/SdlWindow.cpp - ${ORTHANC_STONE_ROOT}/Sources/Viewport/SdlWindow.h - ) - - if (ENABLE_OPENGL) - list(APPEND ORTHANC_STONE_SOURCES - ${ORTHANC_STONE_ROOT}/Sources/OpenGL/SdlOpenGLContext.cpp - ${ORTHANC_STONE_ROOT}/Sources/OpenGL/SdlOpenGLContext.h - ${ORTHANC_STONE_ROOT}/Sources/Viewport/SdlViewport.cpp - ${ORTHANC_STONE_ROOT}/Sources/Viewport/SdlViewport.h - ) - endif() -endif() - - if (ENABLE_DCMTK) list(APPEND ORTHANC_STONE_SOURCES ${ORTHANC_STONE_ROOT}/Sources/Oracle/ParseDicomSuccessMessage.cpp @@ -259,17 +186,6 @@ endif() -if (ENABLE_WASM) - list(APPEND ORTHANC_STONE_SOURCES - ${ORTHANC_STONE_ROOT}/Sources/Loaders/WebAssemblyLoadersContext.cpp - ${ORTHANC_STONE_ROOT}/Sources/Oracle/WebAssemblyOracle.cpp - ${ORTHANC_STONE_ROOT}/Sources/Viewport/WebAssemblyCairoViewport.cpp - ${ORTHANC_STONE_ROOT}/Sources/Viewport/WebAssemblyViewport.cpp - ${ORTHANC_STONE_ROOT}/Sources/Viewport/WebAssemblyViewport.h - ) -endif() - - if (ENABLE_PUGIXML) list(APPEND ORTHANC_STONE_SOURCES ${ORTHANC_STONE_ROOT}/Sources/Toolbox/OsiriX/AngleAnnotation.cpp @@ -310,8 +226,6 @@ ${ORTHANC_STONE_ROOT}/Sources/Loaders/IFetchingItemsSorter.h ${ORTHANC_STONE_ROOT}/Sources/Loaders/IFetchingStrategy.h ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoadedDicomResources.cpp - ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoaderCache.cpp - ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoaderCache.h ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoaderStateMachine.cpp ${ORTHANC_STONE_ROOT}/Sources/Loaders/LoaderStateMachine.h ${ORTHANC_STONE_ROOT}/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp @@ -533,8 +447,6 @@ ${PIXMAN_SOURCES} # Optional components - ${SDL_SOURCES} - ${QT_SOURCES} ${GLEW_SOURCES} ) @@ -578,16 +490,8 @@ ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextureProgram.cpp ${ORTHANC_STONE_ROOT}/Sources/Scene2D/Internals/OpenGLTextureProgram.h ) +endif() - if (ENABLE_WASM) - list(APPEND ORTHANC_STONE_SOURCES - ${ORTHANC_STONE_ROOT}/Sources/OpenGL/WebAssemblyOpenGLContext.cpp - ${ORTHANC_STONE_ROOT}/Sources/OpenGL/WebAssemblyOpenGLContext.h - ${ORTHANC_STONE_ROOT}/Sources/Viewport/WebGLViewport.cpp - ${ORTHANC_STONE_ROOT}/Sources/Viewport/WebGLViewportsRegistry.cpp - ) - endif() -endif() ## ## TEST - Automatically add all ".h" headers to the list of sources