# HG changeset patch # User Sebastien Jodogne # Date 1592216805 -7200 # Node ID d6b7fb0f9652e3e0cd48ad0269b1140f98b39325 # Parent f1e82dd6acb1697ffe35d7532679f03743aee5c8 improved DownloadOrthancFramework.cmake diff -r f1e82dd6acb1 -r d6b7fb0f9652 OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake --- a/OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake Fri Jun 12 17:37:11 2020 +0200 +++ b/OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake Mon Jun 15 12:26:45 2020 +0200 @@ -195,10 +195,8 @@ endif() if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) - message(FATAL_ERROR "Directory not containing the source code of Orthanc: ${ORTHANC_FRAMEWORK_ROOT}") + message(FATAL_ERROR "Directory not containing the source code of the Orthanc framework: ${ORTHANC_FRAMEWORK_ROOT}") endif() - - set(ORTHANC_ROOT ${ORTHANC_FRAMEWORK_ROOT}) endif() @@ -245,6 +243,16 @@ if (Failure) message(FATAL_ERROR "Error while running Mercurial") endif() + + unset(ORTHANC_FRAMEWORK_ROOT CACHE) + set(ORTHANC_FRAMEWORK_ROOT "${ORTHANC_ROOT}/OrthancFramework" CACHE + STRING "Path to the Orthanc framework source directory") + + if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) + message(FATAL_ERROR "Directory not containing the source code of the Orthanc framework: ${ORTHANC_ROOT}") + endif() + + unset(ORTHANC_ROOT) endif() @@ -372,6 +380,16 @@ message(FATAL_ERROR "The Orthanc framework was not uncompressed at the proper location. Check the CMake instructions.") endif() endif() + + unset(ORTHANC_FRAMEWORK_ROOT CACHE) + set(ORTHANC_FRAMEWORK_ROOT "${ORTHANC_ROOT}/OrthancFramework" CACHE + STRING "Path to the Orthanc framework source directory") + + if (NOT EXISTS ${ORTHANC_FRAMEWORK_ROOT}/Resources/CMake/OrthancFrameworkParameters.cmake) + message(FATAL_ERROR "Directory not containing the source code of the Orthanc framework: ${ORTHANC_ROOT}") + endif() + + unset(ORTHANC_ROOT) endif() diff -r f1e82dd6acb1 -r d6b7fb0f9652 OrthancFramework/SharedLibrary/CMakeLists.txt --- a/OrthancFramework/SharedLibrary/CMakeLists.txt Fri Jun 12 17:37:11 2020 +0200 +++ b/OrthancFramework/SharedLibrary/CMakeLists.txt Mon Jun 15 12:26:45 2020 +0200 @@ -52,6 +52,7 @@ # WebAssembly or asm.js set(BOOST_LOCALE_BACKEND "libiconv") set(ORTHANC_SANDBOXED ON) + set(STANDALONE_BUILD ON) # Will be used by "../Resources/CMake/EmscriptenParameters.cmake" set(WASM_FLAGS "-s SIDE_MODULE=1 -s EXPORT_ALL=1") diff -r f1e82dd6acb1 -r d6b7fb0f9652 OrthancFramework/Sources/Images/PamReader.cpp --- a/OrthancFramework/Sources/Images/PamReader.cpp Fri Jun 12 17:37:11 2020 +0200 +++ b/OrthancFramework/Sources/Images/PamReader.cpp Mon Jun 15 12:26:45 2020 +0200 @@ -242,7 +242,7 @@ for (unsigned int w = 0; w < GetWidth(); ++w, ++pixel) { -#if ORTHANC_ENABLE_WASM == 1 +#if defined(__EMSCRIPTEN__) // For WebAssembly /* crash (2019-08-05):