[CMake] VS2012 builds using v3.1.0 are a lot slower than v2.8.12

Hendrik Sattler post at hendrik-sattler.de
Wed Jan 21 11:00:49 EST 2015


Hi,

This makes cmake --build much less predictable across cmake versions and cmake projects.
How can I find out if msbuild is chosen without inspecting the cmake project?
Specifying this manually is not really an option... too complicated.

Or like that:
- run CMake
- get the CMAKE_VS_MSBUILD... from cache and at set 
CMAKE_MAKE_PROGRAM from it.

@Paul: You can probably modify the CMAKE_VS_MSBUILD... variable to add /m. But to compile in parallel should be s decision of the user, not the project, and thus a decision of the caller of cmake --build.

HS


Am 21. Januar 2015 15:05:32 MEZ, schrieb Brad King <brad.king at kitware.com>:
>On 01/20/2015 03:40 PM, Paul Smith wrote:
>> Where can I go to find out more about how cmake --build chooses
>whether
>> to use msbuild vs. devenv?
>
>The behavior was updated in 3.0 and is now described here:
>
> http://www.cmake.org/cmake/help/v3.0/variable/CMAKE_MAKE_PROGRAM.html
>
>In 2.8.12 and below we always stored CMAKE_MAKE_PROGRAM in
>CMakeCache.txt
>instead of waiting until build time to choose it.  This was problematic
>because it was initialized before configuring the project so we could
>not
>know whether devenv had to be chosen for Intel Fortran support or not,
>so it always chose devenv if available.  However, devenv does not work
>when using an alternative PlatformToolset with CMAKE_GENERATOR_TOOLSET:
>
>http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/46795/focus=46969
>
>Therefore we had to switch to build-time selection of the build tool.
>The change was mentioned in the 3.0 release notes:
>
> http://www.cmake.org/cmake/help/v3.0/release/3.0.0.html#other-changes
> "Selection of the proper msbuild or devenv tool is now performed as
>  late as possible when the solution (.sln) file is available so it
>  can depend on project content."
>
>On 01/21/2015 05:53 AM, Yves Frederix wrote:
>> options like  'cmake --build . --config Release -- /m'. I checked and
>> this indeed works as expected.
>
>Yes.
>
>> The above explains all my initial observations. However, the fix is
>> not very handy. As I understood, one does not know until build time
>> what exact build (devenv or msbuild) will be used by CMake
>
>MSBuild will be used for VS >= 10 unless Fortran code is involved.  You
>can also add -DCMAKE_MAKE_PROGRAM=/path/to/msbuild.exe to explicitly
>specify it.  Once that is in CMakeCache.txt then it will always be used
>by "cmake --build".
>
>-Brad



More information about the CMake mailing list