<div dir="ltr">Hi Petr,<div><br></div><div>VTK exposes the /MP compiler flag in its CMake configuration.</div><div><br></div><div>Here is the relevant code from <a href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=CMake/vtkDetermineCompilerFlags.cmake;h=1398050afb34ff8c0a74137d847c19a6f63b12e9;hb=HEAD">http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=CMake/vtkDetermineCompilerFlags.cmake;h=1398050afb34ff8c0a74137d847c19a6f63b12e9;hb=HEAD</a></div><div><br></div><div><div class="" style="font-family:monospace;white-space:pre;color:rgb(0,0,0)"><a id="l126" href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=CMake/vtkDetermineCompilerFlags.cmake;h=1398050afb34ff8c0a74137d847c19a6f63b12e9;hb=HEAD#l126" class="" style="color:rgb(153,153,153);text-decoration:none"> 126</a> # Enable /MP flag for Visual Studio 2008 and greator</div><div class="" style="font-family:monospace;white-space:pre;color:rgb(0,0,0)"><a id="l127" href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=CMake/vtkDetermineCompilerFlags.cmake;h=1398050afb34ff8c0a74137d847c19a6f63b12e9;hb=HEAD#l127" class="" style="color:rgb(153,153,153);text-decoration:none"> 127</a> IF(MSVC_VERSION GREATER 1400)</div><div class="" style="font-family:monospace;white-space:pre;color:rgb(0,0,0)"><a id="l128" href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=CMake/vtkDetermineCompilerFlags.cmake;h=1398050afb34ff8c0a74137d847c19a6f63b12e9;hb=HEAD#l128" class="" style="color:rgb(153,153,153);text-decoration:none"> 128</a>   SET(CMAKE_CXX_MP_FLAG OFF CACHE BOOL "Build with /MP flag enabled")</div><div class="" style="font-family:monospace;white-space:pre;color:rgb(0,0,0)"><a id="l129" href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=CMake/vtkDetermineCompilerFlags.cmake;h=1398050afb34ff8c0a74137d847c19a6f63b12e9;hb=HEAD#l129" class="" style="color:rgb(153,153,153);text-decoration:none"> 129</a>   SET(PROCESSOR_COUNT "$ENV{NUMBER_OF_PROCESSORS}")</div><div class="" style="font-family:monospace;white-space:pre;color:rgb(0,0,0)"><a id="l130" href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=CMake/vtkDetermineCompilerFlags.cmake;h=1398050afb34ff8c0a74137d847c19a6f63b12e9;hb=HEAD#l130" class="" style="color:rgb(153,153,153);text-decoration:none"> 130</a>   SET(CMAKE_CXX_MP_NUM_PROCESSORS CACHE ${PROCESSOR_COUNT} "The maximum number of processes for the /MP flag")</div><div class="" style="font-family:monospace;white-space:pre;color:rgb(0,0,0)"><a id="l131" href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=CMake/vtkDetermineCompilerFlags.cmake;h=1398050afb34ff8c0a74137d847c19a6f63b12e9;hb=HEAD#l131" class="" style="color:rgb(153,153,153);text-decoration:none"> 131</a>   IF (CMAKE_CXX_MP_FLAG)</div><div class="" style="font-family:monospace;white-space:pre;color:rgb(0,0,0)"><a id="l132" href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=CMake/vtkDetermineCompilerFlags.cmake;h=1398050afb34ff8c0a74137d847c19a6f63b12e9;hb=HEAD#l132" class="" style="color:rgb(153,153,153);text-decoration:none"> 132</a>     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP${CMAKE_CXX_MP_NUM_PROCESSORS}")</div><div class="" style="font-family:monospace;white-space:pre;color:rgb(0,0,0)"><a id="l133" href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=CMake/vtkDetermineCompilerFlags.cmake;h=1398050afb34ff8c0a74137d847c19a6f63b12e9;hb=HEAD#l133" class="" style="color:rgb(153,153,153);text-decoration:none"> 133</a>     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP${CMAKE_CXX_MP_NUM_PROCESSORS}")</div><div class="" style="font-family:monospace;white-space:pre;color:rgb(0,0,0)"><a id="l134" href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=CMake/vtkDetermineCompilerFlags.cmake;h=1398050afb34ff8c0a74137d847c19a6f63b12e9;hb=HEAD#l134" class="" style="color:rgb(153,153,153);text-decoration:none"> 134</a>   ENDIF ()</div><div class="" style="font-family:monospace;white-space:pre;color:rgb(0,0,0)"><a id="l135" href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=CMake/vtkDetermineCompilerFlags.cmake;h=1398050afb34ff8c0a74137d847c19a6f63b12e9;hb=HEAD#l135" class="" style="color:rgb(153,153,153);text-decoration:none"> 135</a> ENDIF()</div></div><div class="" style="font-family:monospace;white-space:pre;color:rgb(0,0,0)"><br></div>Hope that helps,<br>Cory</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 16, 2015 at 11:44 AM, Petr Bena <span dir="ltr"><<a href="mailto:benapetr@gmail.com" target="_blank">benapetr@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I know that I can pass -j parameter to GNU make as well as there is<br>
some sort of option to run MSVC compiler by hand and give that similar<br>
parameter, but that's not exactly what I want.<br>
<br>
I would prefer a way to get cmake to generate solution files for MSVC<br>
in a way that these options are enabled by default. Right now I need<br>
to do this by hand and when I run cmake again, it overwrites the<br>
solution files I modified and restore back the settings that disallow<br>
the multithreaded builds. Basically I would like to know if there is<br>
some option I would add to CMakeLists.txt that would make it do so. I<br>
understand that this may not possible with current version of CMake<br>
though.<br>
<br>
Thanks<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, Sep 16, 2015 at 5:28 PM, Bill Hoffman <<a href="mailto:bill.hoffman@kitware.com">bill.hoffman@kitware.com</a>> wrote:<br>
> <a href="http://www.kitware.com/blog/home/post/434" rel="noreferrer" target="_blank">http://www.kitware.com/blog/home/post/434</a><br>
><br>
> -Bill<br>
><br>
><br>
> --<br>
><br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Please keep messages on-topic and check the CMake FAQ at:<br>
> <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
><br>
> Kitware offers various services to support the CMake community. For more<br>
> information on each offering, please visit:<br>
><br>
> CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</div>