[CMake] Header files excluded from build in Visual Studio

Philip Lowman philip at yhbt.com
Thu Mar 12 22:46:51 EDT 2009


On Thu, Mar 12, 2009 at 10:34 PM, Claus Höfele <claus at claushoefele.com>wrote:

> Hi everyone,
>
> I've recently switched to cmake to generate Visual Studio project
> files for a project of mine and it's working great so far.
>
> One issue that bugs me is that header files end up being disabled in
> Visual Studio (Excluded From Build property is set for the header
> files). This prevents Visual Studio from syntax checking these files,
> which is quite a bummer for me because I have a lot of inline code in
> my header files.
>
> Setting the property HEADER_FILE_ONLY to false doesn't work because
> the code in cmSourceFile::CheckExtension() forces this property to
> true for headers files. The generator for Visual Studio then
> automatically disables the file when it writes the project file.
>
> For Visual Studio, this behaviour doesn't make much sense because
> header files are not compiled anyway. At the very minimum, I should be
> able to override this setting.
>
> I wonder if there's a workaround for this problem without resorting to
> building my own cmake executable.


What version of CMake and Visual Studio are you using?

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090312/2ff4c7e0/attachment.htm>


More information about the CMake mailing list