[CMake] SOURCE_GROUP

Jacob Foshee jacobf at gmail.com
Tue Sep 5 15:33:14 EDT 2006


Thanks for the response.  I see now that there is an unwritten
requirement that the source file(s) must be listed in the
ADD_EXECUTABLE command.  Otherwise, they will not be put in a group.

Perhaps this should be added to the SOURCE_GROUP documentation?

On 8/29/06, Tristan Carel <tristan.carel at gmail.com> wrote:
> On 8/29/06, Jacob Foshee <jacobf at gmail.com> wrote:
> > Howdy,
> > I am having trouble getting the SOURCE_GROUP command to work.
> >
> > I am using Visual Studio 8 and am not able to get any additional
> > folders to show up.
> >
> > Is there an order dependence as to when this command should appear?
> >
> > Thanks!  Great tool, by the way!
>
> Here is an example to describe you the two ways to use the SOURCE_GROUP command:
>
> PROJECT(testgroup)
> SET(sources
> foo.h
> foo_a.cpp
> foo_a.h
> foo_b.cpp
> foo_b.h
> foo_c.cpp
> foo_c.h
> foo_d.cpp
> foo_d.h
> main.cpp
> )
> SOURCE_GROUP(foo_code FILES foo_a.cpp foo_b.cpp foo_c.cpp foo_d.cpp)
> SOURCE_GROUP(foo_headers REGULAR_EXPRESSION "foo.*\\.h")
> ADD_EXECUTABLE(testgroup ${sources})
>
>
> I guess there are no particular dependence relative to the call location.
>
>
> by the way, you can also consult the FAQ:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> bye
> --
> Tristan Carel
>


More information about the CMake mailing list