From: David Cole [mailto:david.c...@kitware.com] Sent: 27 June 2010 16:39 To: Hicham Mouline Cc: cmake@cmake.org Subject: Re: [CMake] maximum length of a list
On Sun, Jun 27, 2010 at 11:05 AM, Hicham Mouline <hic...@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 That's totally all right then. I will probably never have more than 100 directories, ie a string of 100 max 20char length strings separated by semi colon. By the way, if I wish to replace the ; in the string by a , (comma) should I just use STRING(REPLACE ";" "," ... ) ?
_______________________________________________ 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