diff Applications/Samples/CMakeLists.txt @ 551:90f3a60576a9 dev rtviewer19

Merged in ct-pet-dose-struct (pull request #2) Ct pet dose struct
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 02 Apr 2019 14:02:12 +0000
parents d10a295b607a
children adc1be326b62
line wrap: on
line diff
--- a/Applications/Samples/CMakeLists.txt	Fri Mar 29 15:21:33 2019 +0100
+++ b/Applications/Samples/CMakeLists.txt	Tue Apr 02 14:02:12 2019 +0000
@@ -12,6 +12,20 @@
 add_definitions(-DOPENSSL_NO_CAPIENG=1)
 endif()
 
+
+# the following block has been borrowed from orthanc/**/Compiler.cmake
+if (MSVC_MULTIPLE_PROCESSES)
+# "If you omit the processMax argument in the /MP option, the
+# compiler obtains the number of effective processors from the
+# operating system, and then creates one process per effective
+# processor"
+# https://blog.kitware.com/cmake-building-with-all-your-cores/
+# https://docs.microsoft.com/en-us/cpp/build/reference/mp-build-with-multiple-processes
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
+endif()
+
+
 #set(ENABLE_DCMTK ON)
 
 set(ENABLE_SDL OFF CACHE BOOL "Target SDL Native application")