[CMake] MSBuild and automatic project file regenation

John Drescher drescherjm at gmail.com
Mon Jan 9 14:16:53 EST 2012


On Mon, Jan 9, 2012 at 1:56 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:
> Michael Hertling <mhertling at online.de>
> writes:
>
>> On 01/09/2012 02:34 PM, David Cole wrote:
>>> No trick, but to avoid this, perhaps we should change the "--build"
>>> handler to run the cmake configure & generate step before calling out
>>> to MSBuild. You can easily do this yourself from the command line by
>>> adopting the pattern:
>>>
>>>   cmake . && cmake --build . --config Release
>
> Fortunately my cmake scripts are simple enough so the extra invocation
> does not add much to the build.
>
> Thanks David.
>
>>> This is a good idea for a feature request. Not sure if we should just
>>> always do that by default and provide a way to turn off with a
>>> "--no-regenerate", or vice-versa with a "--please-generate-first" ...
>>> :-)
>
> The effect of --no-regenerate would be the same as the current buggy
> behavior (MSBuild.exe uses outdated project files). IMHO the
> --please-generate-first is the right thing.
>

One problem I have with doing this automatically in the --build
command is I run in parallel builds for each configuration (using a
program called RunJobs from codeproject.com):

cmake --build X:/64Bit/VC.100/Qt/StudyManager --config RelWithDebInfo
cmake --build X:/64Bit/VC.100/Qt/StudyManager --config Release
cmake --build X:/64Bit/VC.100/Qt/StudyManager --config Debug

for this I do the
cmake X:/64Bit/VC.100/Qt/StudyManager

step first then run the parallel jobs. I worry if --build forced a
configure that parallel building like this could break.

John


More information about the CMake mailing list