[CMake] Help with source_group and regex

Joseph Henry poundpragma at gmail.com
Tue Jun 19 11:05:38 EDT 2012


Hi,

My scenario is that I have many source files in different directories that
are all going into the same lib.

dir1/file1.h
dir1/file1.cpp
dir1/file1.inl

dir2/file2.h
dir2/file2.cpp
dir2/file2.inl

These files are listed in a variable SOURCES.

what I want to do is add them to a source group using the directory as the
base group and then all .h files in group "inc", .cpp files in group "src"
and .inl files in group "inl".

So to reiterate:
SOURCES=dir1/file1.h;dir1/file1.cpp;dir1/file1.inl;dir2/file2.h;dir2/file2.cpp;dir2/file2.inl

and I want the source groups to look like this:

dir1/inc/file1.h
dir1/src/file1.cpp
....
dir2/inl/file2.inl

Any help on this would be greatly appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120619/8c1b5a27/attachment.htm>


More information about the CMake mailing list