# HG changeset patch # User Benjamin Golinvaux # Date 1574277973 -3600 # Node ID 3076a8a66db52d133293698a1301fa2b20ed629c # Parent bf08d28bc652d859202cdeaccd8973e8039c5541# Parent ab3f3bb1bdb499875c32cf0a98bde29e4bbd207f Merge diff -r bf08d28bc652 -r 3076a8a66db5 Applications/Samples/CMakeLists.txt --- a/Applications/Samples/CMakeLists.txt Wed Nov 20 20:25:23 2019 +0100 +++ b/Applications/Samples/CMakeLists.txt Wed Nov 20 20:26:13 2019 +0100 @@ -88,6 +88,10 @@ set(ENABLE_GOOGLE_TEST ON) set(ENABLE_WEB_CLIENT ON) +else() + set(ENABLE_NATIVE ON) + set(ENABLE_OPENGL OFF) + endif() @@ -182,16 +186,19 @@ target_link_libraries(${Target} OrthancStone) endmacro() -#BuildSingleFileSample(OrthancStoneEmpty EmptyApplication.h 1) -#BuildSingleFileSample(OrthancStoneTestPattern TestPatternApplication.h 2) -BuildSingleFileSample(OrthancStoneSingleFrame SingleFrameApplication.h 3) -#BuildSingleFileSample(OrthancStoneSingleVolume SingleVolumeApplication.h 4) -#BuildSingleFileSample(OrthancStoneBasicPetCtFusion 5) -#BuildSingleFileSample(OrthancStoneSynchronizedSeries 6) -#BuildSingleFileSample(OrthancStoneLayoutPetCtFusion 7) -BuildSingleFileSample(OrthancStoneSimpleViewerSingleFile SimpleViewerApplicationSingleFile.h 8) # we keep that one just as a sample before we convert another sample to this pattern -BuildSingleFileSample(OrthancStoneSingleFrameEditor SingleFrameEditorApplication.h 9) +if (ENABLE_SDL) + #BuildSingleFileSample(OrthancStoneEmpty EmptyApplication.h 1) + #BuildSingleFileSample(OrthancStoneTestPattern TestPatternApplication.h 2) + BuildSingleFileSample(OrthancStoneSingleFrame SingleFrameApplication.h 3) + #BuildSingleFileSample(OrthancStoneSingleVolume SingleVolumeApplication.h 4) + #BuildSingleFileSample(OrthancStoneBasicPetCtFusion 5) + #BuildSingleFileSample(OrthancStoneSynchronizedSeries 6) + #BuildSingleFileSample(OrthancStoneLayoutPetCtFusion 7) + BuildSingleFileSample(OrthancStoneSimpleViewerSingleFile SimpleViewerApplicationSingleFile.h 8) # we keep that one just as a sample before we convert another sample to this pattern + BuildSingleFileSample(OrthancStoneSingleFrameEditor SingleFrameEditorApplication.h 9) +endif() + ##### SimpleViewer sample (Qt and WASM only) ####### if (ENABLE_QT OR ENABLE_WASM) diff -r bf08d28bc652 -r 3076a8a66db5 README.md --- a/README.md Wed Nov 20 20:25:23 2019 +0100 +++ b/README.md Wed Nov 20 20:26:13 2019 +0100 @@ -146,6 +146,15 @@ cmake -G Ninja -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT="$($pwd)\..\orthanc" -DALLOW_DOWNLOADS=ON -DENABLE_SDL=ON ../orthanc-stone/Applications/Samples/ ``` +**Ninja generator with static SDL build (bash/zsh script)** + +``` +# Please yourself one level above the orthanc-stone and orthanc folders +if( -not (test-path stone_build_sdl)) { mkdir stone_build_sdl } +cd stone_build_sdl +cmake -G Ninja -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DORTHANC_FRAMEWORK_SOURCE=path -DORTHANC_FRAMEWORK_ROOT="`pwd`/../orthanc" -DALLOW_DOWNLOADS=ON -DENABLE_SDL=ON ../orthanc-stone/Applications/Samples/ +``` + **Visual Studio 2017 generator with static SDL build (pwsh script)** ``` diff -r bf08d28bc652 -r 3076a8a66db5 Resources/CMake/OrthancStoneConfiguration.cmake --- a/Resources/CMake/OrthancStoneConfiguration.cmake Wed Nov 20 20:25:23 2019 +0100 +++ b/Resources/CMake/OrthancStoneConfiguration.cmake Wed Nov 20 20:26:13 2019 +0100 @@ -56,6 +56,12 @@ endif() endif() +if (ENABLE_OPENGL) + if (NOT ENABLE_QT AND NOT ENABLE_SDL AND NOT ENABLE_WASM) + message(FATAL_ERROR "Cannot enable OpenGL if WebAssembly, SDL and Qt are all disabled") + endif() +endif() + if (ENABLE_WASM) if (NOT ORTHANC_SANDBOXED) message(FATAL_ERROR "WebAssembly target must me configured as sandboxed") diff -r bf08d28bc652 -r 3076a8a66db5 UnitTestsSources/GenericToolboxTests.cpp diff -r bf08d28bc652 -r 3076a8a66db5 UnitTestsSources/TestStructureSet.cpp --- a/UnitTestsSources/TestStructureSet.cpp Wed Nov 20 20:25:23 2019 +0100 +++ b/UnitTestsSources/TestStructureSet.cpp Wed Nov 20 20:26:13 2019 +0100 @@ -4729,8 +4729,8 @@ } ds.Union(0, 4); - EXPECT_EQ(0, ds.Find(0)); - EXPECT_EQ(0, ds.Find(4)); + EXPECT_EQ(0u, ds.Find(0)); + EXPECT_EQ(0u, ds.Find(4)); ds.Union(4, 6); ds.Union(8, 9); @@ -4875,7 +4875,7 @@ boundaries.clear(); EXPECT_NO_THROW(AddSlabBoundaries(boundaries, slabCuts, 0)); - ASSERT_EQ(0, boundaries.size()); + ASSERT_EQ(0u, boundaries.size()); } TEST(StructureSet, ProcessBoundaryListTopRow) @@ -4889,7 +4889,7 @@ { size_t i = 0; - ASSERT_EQ(4, boundaries.size()); + ASSERT_EQ(4u, boundaries.size()); ASSERT_EQ(RectangleBoundaryKind_Start, boundaries[i].second); ASSERT_NEAR(5, boundaries[i].first, DELTA_MAX); @@ -4919,7 +4919,7 @@ AddSlabBoundaries(boundaries, slabCuts, 0); AddSlabBoundaries(boundaries, slabCuts, 1); - ASSERT_EQ(8, boundaries.size()); + ASSERT_EQ(8u, boundaries.size()); { size_t i = 0;