[CMake] Setting top level source_group with regex

Glen Knowles gknowles at ieee.org
Fri Apr 7 03:37:29 EDT 2017


On Windows, cmake version 3.7.2, generating project files for visual studio
2017.

I have a file called "configure.bat" that I would like to place at the root
of the visual studio project via regex.

Here is what I have tried along with where it put configure.bat:
1. no source_group -> "Source Files" folder
2. source_group("" FILES "configure.bat") -> at the root
3. source_group(" " FILES "configure.bat") -> at the root
4. source_group("x" REGULAR_EXPRESSION "configure\.bat") -> "x" folder
5. source_group("" REGULAR_EXPRESSION "configure\.bat") -> "Source Files"
folder
6. source_group(" " REGULAR_EXPRESSION "configure\.bat") -> at the root

So it's possible to get the result I want using #6, but #5 seems wrong to
me. Or if it's not wrong, and "" is suppose to restore the default, than #2
has a problem.

#3 and #6 are actually adding a filter with a single space as it's name, I
suspect it only works because VS is normalizing it to an empty string when
it reads the *.vcxproj.filters file.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170407/c68d1d47/attachment.html>


More information about the CMake mailing list