[Bf-committers] New Developer Meeting minutes
erwin.coumans at gmail.com
Mon Jan 11 19:10:44 CET 2010
>From the CMake mailinglist:
"The problem with globbing is that CMake has no way to determine that new
source (or header) files were added to a directory, other than ALWAYS
running when someone types 'make' (or the VS equivalent). This is not
really desirable behaviour, because oftentimes no new files will have
been added. And therefore, that's not how CMake behaves.
So, in general, when using globbing, YOU are responsible for rerunning
CMake whenever you've added a source file. Otherwise you run the risk of
the new file not being compiled. Furthermore, you might accidentally
compile sources that were just lying around in your directory as test
code. Deletion of sources can also cause interesting effects if you
create a library, because the object will remain in that library until
you (manually) remove and recreate the library.
I hope my examples convinced you enough that globbing is (in general) a
Re-running cmake each time to recognize new/deleted headerfiles
doesn't seem efficient,
but if developers prefer ease of use at the cost of some performance
you might want to use GLOB.
Just don't complain that dependencies don't reliably work, or that
cmake is a bit slow :-)
I follow the advice of the CMake developers for the Bullet project,
and I'm happy with it.
2010/1/11 Erwin Coumans <erwin.coumans at gmail.com>
> The stackoverflow answer seem to confirm there are some dependencies and
> performance issues with GLOB.
> I'm interested to hear what the 'official' recommendation is by the cmake
> 2010/1/11 José Ignacio <jose.cyborg at gmail.com>
> On Mon, Jan 11, 2010 at 1:17 PM, Erwin Coumans <erwin.coumans at gmail.com>
>> > The is no problem using GLOB with a wildcard, as I mentioned at least
>> > times in this thread ;)
>> > But explicitly listing each file seems recommended, I forgot why.
>> > Perhaps GLOB needs to search for (potential) new headerfiles, every
>> > time you build and a .cpp changed (slowing down things unnecesarily)?
>> > Perhaps reading the docs, using google or asking on the cmake
>> > mailingslist will tell why GLOB can better be avoided in CMakeLists.txt?
>> IIRC, if you use globbing and added a new file after you build for the
>> first time, it won't take it into account for the next call of "make"
>> unless you touch the CMakeLists.txt file or clear the cache and
>> rebuild. (though maybe that behavior changed on newer versions of
>> oh, a google search gave me this link:
>> > Cheers,
>> > Erwin
>> Bf-committers mailing list
>> Bf-committers at blender.org
More information about the Bf-committers