changeset 1182:3076a8a66db5

Merge
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 20 Nov 2019 20:26:13 +0100
parents bf08d28bc652 (current diff) ab3f3bb1bdb4 (diff)
children 2e52d1f4c9e3 848dcba80d81
files UnitTestsSources/GenericToolboxTests.cpp
diffstat 4 files changed, 36 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- 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)**
 
 ```
--- 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")
--- 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;