[cmake-developers] Safe source list GLOBs
Wojciech Knapik
wmknapik at gmail.com
Mon May 13 20:42:38 EDT 2013
On Mon, May 13, 2013 at 09:49:03AM -0400, Brad King wrote:
> On 05/11/2013 11:09 PM, Wojciech Knapik wrote:
>
> > I recently ran into the issue of GLOBs being unsafe for source lists and
> > wrote a very simple piece of code to fix the problem. A generalized
> > version of that code is available here:
> >
> > https://github.com/wknapik/scm/blob/master/code/cmake/Modules/RegenerateSourceListGlobs.cmake
> >
> > It seems to work quite well, at least on Linux. If you guys think this
> > is worth turning into an official module, I can make any changes
> > deemed necessary. I'm not up for the maintainer role though.
>
> It looks like you're using a custom target to re-run CMake with
> dependencies on the source directories themselves.
Is it just me, or did that sound like Clippy ?;]
> I think this is suitable as an example in a Wiki but not as an
> official module.
>
> This would be much better done as a change to CMake's implementation.
Oh, definitely. I'm not a C++ coder though, so I wrote a CMake module ;]
> We already generate a rule to re-run CMake when CMakeLists.txt and
> other files read by CMake change. One could add an option to add
> directories to the dependencies of that rule too. Look for the
> AddCMakeDependFile method for example. If you go this route please
> post a proposed interface here first before diving into the effort
> of a patch.
I hope someone does make the effort to implement this. Using GLOBs can
reduce the size of your CMakeLists by an order of magnitude and is just
so convenient...
> > PS. The wiki page mentioned in Modules/readme.txt says you should send
> > stuff like this to cmake-developers, but the email referred in the first
> > sentence says you should send new module proposals to the cmake list. I
> > guess the wiki could use an update.
>
> Which wiki page? The module maintainer one is:
>
> http://www.cmake.org/Wiki/CMake:Module_Maintainers
>
> and that one says cmake-developers.
The email linked in the first sentence - "Call for maintainers" - says
"cmake at www.cmake.org".
BTW, would you say the module is ok to use ? Do you see any problems
with this implementation ? I need that feature, so I'm planning to rely
on the module for the time being at least.
thanks,
WK
More information about the cmake-developers
mailing list