[CMake] VS projects are rebuilt even if they don't change

James Bigler jamesbigler at gmail.com
Sat Jan 17 15:31:57 EST 2009



On Jan 17, 2009, at 5:11 AM, "Eric Noulard" <eric.noulard at gmail.com>  
wrote:

> 2009/1/17 James Bigler <jamesbigler at gmail.com>:
>> I started out with this CMakeLists.txt file:
>>
>> project(rebuild)
>> cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
>> add_executable(test test.cpp)
>>
>> I then built and ran the project without problems.
>>
>> I then added a comment to the file,
>
> Which file?
>
> test.cpp or CMakeLists.txt?
>
> modifying test.cpp shouldn't trigger CMake launch whereas
> changing CMakeLists.txt should.

You're right. I didn't specify. I was modifying CMakeLists.txt.

>
>> and when I built from VS, CMake
>> reconfigured and the VS plugin asked if I wanted to reload 1 or  
>> more .sln or
>> .vcproj files.
>>
>> It turns out it is the sln project file.
>>
>> Shouldn't CMake be using copy_if_different for these sorts of  
>> things?  I
>> understand that it may want to regenerate the project and solution  
>> files if
>> you configure, but only actually changing those files when they  
>> differ would
>> prevent a lot of reloading for some of my projects that compute  
>> dependencies
>> dynamically.
>
> Again which *files* ?
>>
>> I've noticed this more with the latest release candidate 2.6.3R8,  
>> using VS
>> 2008 on WinXP64.
>
> Which means 2.6.[012] do not exhibit the same behavior for the same  
> project?
>
>
> -- 
> Erk

If the CMakeLists.txt files change but have no meaningful changes I  
expect CMake to reconfigure but not actually write new sln or vcproj  
files.

I can't verify that this is a new thing with this version of CMake,  
but I only recently noticed it and wanted to make sure the developers  
knew which version I was working with.

James 


More information about the CMake mailing list