[CMake] Extensionless Headers, and Non-compiled SOURCE_GROUP files

Jacob Foshee jacobf at gmail.com
Thu Sep 21 15:52:54 EDT 2006


Howdy,
I'm helping out with the CMake build for OpenSceneGraph.  OSG follows the
standard practice of using extensionless headers for common interfaces.  We
would like all headers to show up in the project files (e.g. vcproj).  For
the SOURCE_GROUP command to work, the files must be listed in the
ADD_EXECUTABLE or ADD_LIBRARY command (as far as I can tell).

This leads to a problem.  I think this is a bug.  I think CMake doesn't know
how to handle the extensionless files, so attempts to add build rules to
some of them (at least with VC8).  Others, it does not.  I don't know why
some get the rules and some don't (this inconsistency seems to be a problem
with cpp files as well).  Here is an excerpt from a vcproj illustrating the
problem:
~~~
            <File

RelativePath="C:\...\Producer\include\Producer\BlockingQueue">
            </File>
            <File
                RelativePath="C:\...\Producer\include\Producer\Camera">
                <FileConfiguration
                    Name="Debug|Win32">
                    <Tool
                    Name="VCCLCompilerTool"
                    ObjectFile="$(IntDir)/__/__/."
                    />
                </FileConfiguration>
                <FileConfiguration
                    Name="Release|Win32">
                    <Tool
                    Name="VCCLCompilerTool"
                    ObjectFile="$(IntDir)/__/__/."
                    />
                </FileConfiguration>
                <FileConfiguration
                    Name="MinSizeRel|Win32">
                    <Tool
                    Name="VCCLCompilerTool"
                    ObjectFile="$(IntDir)/__/__/."
                    />
                </FileConfiguration>
                <FileConfiguration
                    Name="RelWithDebInfo|Win32">
                    <Tool
                    Name="VCCLCompilerTool"
                    ObjectFile="$(IntDir)/__/__/."
                    />
                </FileConfiguration>
            </File>
~~~
When VC8 tries to build some of these, I think it gets confused by the
reference to "__/__/." .  For example:
LINK : fatal error LNK1104: cannot open file
'.\producer.dir\debug\__\__.obj'

So, to sum up, I think there are a couple issues here.  First, SOURCE_GROUP
should allow files to be added to a project, even though they are not
compiled.  (Another example supporting this request is resource files.)
Second, decide if by adding files to ADD_EXECUTABLE or ADD_LIBRARY whether
that dictates they are each compiled or not.  Otherwise, if you want to
decide based on extension, extensionless files should not be compiled.

Thanks for listening!  Please let me know if I am misunderstanding any CMake
concepts here.
Jacob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20060921/5a00483f/attachment-0001.html


More information about the CMake mailing list