[CMake] maximum length of a list

David Cole david.cole at kitware.com
Sun Jun 27 11:39:23 EDT 2010


On Sun, Jun 27, 2010 at 11:05 AM, Hicham Mouline <hicham at mouline.org> wrote:

> hello
>
> I assign the list of all directories the names of which starts with a
> pattern like   pattern_.... to a cmake variable which I then pass as a
> preprocessor macro:
>
> FILE(GLOB MYPROJECT_LIST_SYSTEMS RELATIVE ${CMAKE_SOURCE_DIR} system_*)
>
> MYPROJECT_LIST_SYSTEMS is then a cmake "list", a string with semicolon
> separators.
>
> What is the maximum number of entries in the list that cmake handles?
> Or what is the maximum length of a cmake string?
>

In theory, it should be around 2G for 32-bit build of CMake.

In practice, I bet you'll run into the beginnings of performance issues if
you start to have strings that are 10s or 100s of megabytes large.

There's no hard-coded or stack-based limits in CMake that I'm aware of -- it
should be simply based on how much memory CMake can allocate... so:
hopefully, larger than anything you can throw at it... :-)


HTH,
David




>
> Regards,
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100627/876e523a/attachment.htm>


More information about the CMake mailing list