MantisBT - CMake
View Issue Details
0006314CMakeCMakepublic2008-02-11 04:242008-04-09 15:15
Ignacio Castaño 
 
normalfeaturealways
closedunable to reproduce 
 
 
0006314: Add EXCLUDE_FROM_BUILD source file property
As suggested in this email:

>> Is there a way to get cmake to generate a VC6 project file where some of the
>> files have the 'exclude file from build' attribute set?
>
> No, but files with extensions like ".txt" that do not mean anything to
> CMake or Visual Studio can be included in the project file with no ill
> effects. We can add a source file property to cause this behavior:
>
> SET_SOURCE_FILES_PROPERTIES(foo.xyz PROPERTIES EXCLUDE_FROM_BUILD 1)

http://www.cmake.org/pipermail/cmake/2004-August/005374.html [^]

I think this property would be very useful. For example, some systems have installed custom visual studio rules that cause .fx or .cgfx files to be automatically compiled, but you may want to only include these files on the project to edit them easily.

I can imagine similar issues arising in different circumstances. For example, you might have files with custom extensions selected as C/C++ to get syntax highlighting, but you may not want to build them.
No tags attached.
Issue History
2008-02-11 04:24Ignacio CastañoNew Issue
2008-02-14 15:23Alex NeundorfNote Added: 0010497
2008-02-14 15:23Alex NeundorfAssigned To => Alex Neundorf
2008-02-14 15:23Alex NeundorfStatusnew => closed
2008-02-14 15:23Alex NeundorfResolutionopen => no change required
2008-02-14 15:23Alex NeundorfCategoryCCMake => CMake
2008-02-17 04:31Ignacio CastañoStatusclosed => feedback
2008-02-17 04:31Ignacio CastañoResolutionno change required => reopened
2008-02-17 04:31Ignacio CastañoNote Added: 0010531
2008-02-21 12:10Alex NeundorfAssigned ToAlex Neundorf =>
2008-02-21 12:10Alex NeundorfNote Added: 0010618
2008-04-09 15:15Bill HoffmanStatusfeedback => closed
2008-04-09 15:15Bill HoffmanNote Added: 0011218
2008-04-09 15:15Bill HoffmanResolutionreopened => unable to reproduce
2008-04-09 15:15Bill HoffmanNote Added: 0011220

Notes
(0010497)
Alex Neundorf   
2008-02-14 15:23   
You can do this by setting the HEADER_FILE_ONLY source file property true. I tested it here for a foo.c file with cmake 2.4.6 and current cvs, but only with makefiles.
If that doesn't work with xcode or msvc, please reopen the bug report.

Alex
(0010531)
Ignacio Castaño   
2008-02-17 04:31   
Apparently that property doesn't have any effect in the MSVS 2005 target. I've tested it in cmake version 2.4-patch 8.
(0010618)
Alex Neundorf   
2008-02-21 12:10   
I don't have any Windows installation, so I can't really work on that.

Alex
(0011218)
Bill Hoffman   
2008-04-09 15:15   
I tested and this works with 2.4.8 and 2.6.0 RC 7:
set_source_files_properties(junk.c PROPERTIES HEADER_FILE_ONLY TRUE)
(0011220)
Bill Hoffman   
2008-04-09 15:15   
I tested with MSVC 2008, but 2005 should work as well.