MantisBT - CMake
View Issue Details
0011902CMakeCMakepublic2011-02-28 10:592016-06-10 14:31
ixSci 
Kitware Robot 
normalfeaturealways
closedmoved 
Windows
CMake 2.8.4 
 
0011902: EXCLUDE_FROM_BUILD source property for Visual Studio
It would be very useful to have an property which will allow to exclude some source from the build by setting the VS property "Exclude from build".
I've found this proposal here http://public.kitware.com/Bug/view.php?id=6314 [^]
People reasonable said that such a behavior could be achieved by using HEADER_FILE_ONLY property. But it is rather a workaround than solution because we have only similar behavior not a right one.
Difference:
If we set file property to HEADER_FILE_ONLY then VC++ compiler will ignore that file(and this part is what we need) but it doesn't do following:
a) If we mark cpp file as HEADER_FILE_ONLY then it won't be included in the project filter(by using SOURCE_GROUP) but will be placed at the project root instead. If we have many different files which should not build then we will have a mess where header will be placed in the correspondent group but cpp not.
b) Files which are marked as HEADER_FILE_ONLY don't have this verbose red circle which tells to the user "Hey I'm not part of the build, so just ignore me!". If that sign is present in the excluded file it makes project hierarchy more clear

So I think such an option should be added to the CMake.
No tags attached.
Issue History
2011-02-28 10:59ixSciNew Issue
2011-03-02 09:39franzNote Added: 0025621
2011-03-02 09:40franzNote Edited: 0025621bug_revision_view_page.php?bugnote_id=25621#r227
2011-10-13 16:11void.pointerNote Added: 0027583
2012-08-11 11:38David ColeStatusnew => backlog
2012-08-11 11:38David ColeNote Added: 0030313
2016-06-10 14:28Kitware RobotNote Added: 0041808
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0025621)
franz   
2011-03-02 09:39   
(edited on: 2011-03-02 09:40)
I'm also very much looking forward to such a property.

ixSci, the behavior you're reporting about SOURCE_GROUP placing files marked with HEADER_FILE_ONLY at the top level of the project is a regression in CMake 2.8.4; it used to work fine in 2.8.2.

(0027583)
void.pointer   
2011-10-13 16:11   
I would love to see this implemented. For reference, when "Exclude from Build" is enabled for a CPP file on Debug configuration, Visual Studio generates the following XML in the VCPROJ file:


            <File
                RelativePath="C:\Code\work\rdailey-t510-sandbox\n2\gpr\security\gtisecprovcleartext.cpp">
                <FileConfiguration
                    Name="Debug|Win32"
                    ExcludedFromBuild="TRUE">
                    <Tool
                        Name="VCCLCompilerTool"/>
                </FileConfiguration>
            </File>
(0030313)
David Cole   
2012-08-11 11:38   
Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0041808)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.