# HG changeset patch # User Sebastien Jodogne # Date 1550747148 -3600 # Node ID ce6a98f8ed85152c9253e5a8fd54c96a9f1a2c31 # Parent 7d4e06beb1ec8ab6248ac64cadcff51456ac37b1 New CMake option: "-DMSVC_MULTIPLE_PROCESSES=ON" for parallel build with Visual Studio diff -r 7d4e06beb1ec -r ce6a98f8ed85 NEWS --- a/NEWS Thu Feb 21 10:24:59 2019 +0100 +++ b/NEWS Thu Feb 21 12:05:48 2019 +0100 @@ -10,6 +10,7 @@ * Fix issue #134 (/patient/modify gives 500, should really be 400) * Support of SOP classes: BreastProjectionXRayImageStorageForProcessing/Presentation * More tolerance wrt. missing DICOM tags that must be returned by Orthanc C-FIND SCP +* New CMake option: "-DMSVC_MULTIPLE_PROCESSES=ON" for parallel build with Visual Studio Version 1.5.4 (2019-02-08) diff -r 7d4e06beb1ec -r ce6a98f8ed85 Resources/CMake/Compiler.cmake --- a/Resources/CMake/Compiler.cmake Thu Feb 21 10:24:59 2019 +0100 +++ b/Resources/CMake/Compiler.cmake Thu Feb 21 12:05:48 2019 +0100 @@ -39,6 +39,18 @@ # Add /Zm256 compiler option to Visual Studio to fix PCH errors set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm256") + # New in Orthanc 1.5.5 + 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() + add_definitions( -D_CRT_SECURE_NO_WARNINGS=1 -D_CRT_SECURE_NO_DEPRECATE=1 diff -r 7d4e06beb1ec -r ce6a98f8ed85 Resources/CMake/OrthancFrameworkParameters.cmake --- a/Resources/CMake/OrthancFrameworkParameters.cmake Thu Feb 21 10:24:59 2019 +0100 +++ b/Resources/CMake/OrthancFrameworkParameters.cmake Thu Feb 21 12:05:48 2019 +0100 @@ -71,6 +71,7 @@ set(USE_PUGIXML ON CACHE BOOL "Use the Pugixml parser (turn off only for debug)") set(USE_LEGACY_JSONCPP OFF CACHE BOOL "Use the old branch 0.x.y of JsonCpp, that does not require a C++11 compiler (for LSB and old versions of Visual Studio)") set(USE_LEGACY_LIBICU OFF CACHE BOOL "Use icu icu4c-58_2, latest version not requiring a C++11 compiler (for LSB and old versions of Visual Studio)") +set(MSVC_MULTIPLE_PROCESSES OFF CACHE BOOL "Add the /MP option to build with multiple processes if using Visual Studio") mark_as_advanced(USE_GOOGLE_TEST_DEBIAN_PACKAGE) mark_as_advanced(SYSTEM_MONGOOSE_USE_CALLBACKS)