MantisBT - CMake
View Issue Details
0011459CMakeCMakepublic2010-11-14 08:032011-05-02 14:47
Robert Lenhardt 
David Cole 
normalminoralways
closedfixed 
CMake 2.8.3 
CMake 2.8.4CMake 2.8.4 
0011459: VS2010 Generator inserts object files as headers
If you add an object file as source to a target, it gets inserted twice, as obj and as header. This confuses VS and it refuses to load the project. The culprit is WriteCLSources, it needs to check if the source file is an object file. I added a patch against the master file.
No tags attached.
related to 0011147closed David Cole VC10 error "item ... already exists under the filter" 
patch no_objects_as_headers.patch (496) 2010-11-14 08:03
https://public.kitware.com/Bug/file/3495/no_objects_as_headers.patch
patch vs10-devenv.patch (1,344) 2010-12-15 16:08
https://public.kitware.com/Bug/file/3577/vs10-devenv.patch
Issue History
2010-11-14 08:03Robert LenhardtNew Issue
2010-11-14 08:03Robert LenhardtFile Added: no_objects_as_headers.patch
2010-11-16 04:46Robert LenhardtNote Added: 0023281
2010-12-15 12:16David ColeAssigned To => Bill Hoffman
2010-12-15 12:16David ColeStatusnew => assigned
2010-12-15 12:17David ColeNote Added: 0024174
2010-12-15 16:08Robert LenhardtFile Added: vs10-devenv.patch
2010-12-15 16:11Robert LenhardtNote Added: 0024191
2010-12-15 16:28David ColeNote Added: 0024192
2010-12-16 05:40Robert LenhardtNote Added: 0024197
2010-12-16 08:33David ColeNote Added: 0024205
2011-01-21 10:21David ColeRelationship addedrelated to 0011147
2011-01-21 12:21David ColeAssigned ToBill Hoffman => David Cole
2011-01-21 18:09David ColeNote Added: 0025010
2011-01-21 18:10David ColeNote Added: 0025011
2011-01-21 18:16David ColeNote Added: 0025013
2011-01-21 18:16David ColeStatusassigned => resolved
2011-01-21 18:16David ColeResolutionopen => fixed
2011-01-31 16:13David ColeFixed in Version => CMake 2.8.4
2011-01-31 16:13David ColeTarget Version => CMake 2.8.4
2011-05-02 14:47David ColeNote Added: 0026386
2011-05-02 14:47David ColeStatusresolved => closed

Notes
(0023281)
Robert Lenhardt   
2010-11-16 04:46   
Now this is interesting:

There is a dashboard test ExternalOBJ which passes for VS2010, contradicting this issue. Why? Because for VS10 cmake switched to MSBuild as CMAKE_MAKEPROGRAM, and MSBuild does not complain about the solution. The VS10 IDE devenv does complain, just try to load ExternalOBJ.sln in VS10.

Trying to switch to devenv as CMAKE_MAKEPROGRAM does not work as the cmdline options are hardcoded in cmGlobalVisualStudio10Generator.cxx. It would be easy to switch to the old cmdline options, just call the one from cmGlobalVisualStudio7Generator.cxx. Maybe one could support both make commands by checking for MSBuild or devenv.
(0024174)
David Cole   
2010-12-15 12:17   
Interesting idea in http://public.kitware.com/Bug/view.php?id=11459#c23281 [^] to support *both* msbuild and devenv as CMAKE_MAKEPROGRAM values for VS10...
(0024191)
Robert Lenhardt   
2010-12-15 16:11   
Just added a quick and dirty patch to support devenv as CMAKE_MAKEPROGRAM. It just checks for "devenv" in makeprogram and calls VS7 generateBuildCommand for arguments.
(0024192)
David Cole   
2010-12-15 16:28   
Robert, can you run the full CMake test suite with the CMAKE_MAKEPROGRAM set to devenv? Can you submit an Experimental dashboard so that we can see how many tests fail and have a record of it on CDash?

That might point out additional problems that we should also address...

Thanks, if you can. If not, no sweat, one of us will get to it eventually.
(0024197)
Robert Lenhardt   
2010-12-16 05:40   
I made an ctest -D Experimental run after setting CMAKE_MAKEPROGRAM to the full path of the VS10 devenv exe. I used the source from the git master branch with the vs10-devenv.patch applied. You can look at the results at:

http://www.cdash.org/CDash/buildSummary.php?buildid=802828 [^]
(0024205)
David Cole   
2010-12-16 08:33   
Thanks for doing the Experimental run. I am glad to see that only 6 tests fail... Could be worse.

And I think some of those test failures are merely due to not being able to find the git executable. If "git.exe" is not in your PATH, you can either:
- adjust your PATH to include git.exe for running the dashboard
  or
- set GIT_EXECUTABLE to the full path of git.exe in the initial cache for the CMake build

Thanks!
(0025010)
David Cole   
2011-01-21 18:09   
I applied a patch very similar to vs10-devenv.patch and pushed it to 'next' just now:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2ca116189f26e758a47d4737afe21853d0676235 [^]

We'll probably wait until after CMake 2.8.4 to merge this change to 'master'
(0025011)
David Cole   
2011-01-21 18:10   
The related issue 0011147 was resolved by applying a patch inspired by the no_objects_as_headers.patch file attached here. See that issue's notes for details and commit pointer.
(0025013)
David Cole   
2011-01-21 18:16   
Resolving as fixed, but leaving the "target version" and "fixed in version" fields blank for now. I'll come back and fill those in when we know if this is going into 2.8.4 or waiting for 2.8.5...
(0026386)
David Cole   
2011-05-02 14:47   
Closing resolved issues that have not been updated in more than 3 months.