[cmake-developers] cmake.exe parameters and system command line length limit

David Cole DLRdave at aol.com
Tue Jul 14 11:25:44 EDT 2015


Correct -- it's typically used as an **initial** cache only, in a
clean build tree.

Actually, I'm not sure what happens on subsequent (2nd and later)
runs... It may be that the cache has precedence, and the -C file has
no effect on subsequent runs unless you use "FORCE" in it... But I'm
uncertain. I'd have to do some code analysis or experimentation to
figure it out.


D



On Tue, Jul 14, 2015 at 9:34 AM, Robert Goulet
<Robert.Goulet at autodesk.com> wrote:
> Ah ok this means the -C option is in addition to the cmake cache, and not replace it?
>
> -----Original Message-----
> From: David Cole [mailto:DLRdave at aol.com]
> Sent: Monday, July 13, 2015 3:42 PM
> To: Robert Goulet
> Cc: David Cole; cmake-developers at cmake.org
> Subject: Re: [cmake-developers] cmake.exe parameters and system command line length limit
>
> You don't. It's just another way to specify the command line arguments, but as a single command line argument instead of dozens or hundreds.
>
> It's a mechanism for you to avoid the command line length limit.
> Wasn't that your question...?
>
>
> On Mon, Jul 13, 2015 at 2:01 PM, Robert Goulet <Robert.Goulet at autodesk.com> wrote:
>> Hi David,
>>
>> That option looks interesting. How do we populate it with the other CMake cache values that are originally set by CMake and not by our command line options?
>>
>> Thanks.
>>
>> -----Original Message-----
>> From: David Cole [mailto:DLRdave at aol.com]
>> Sent: Monday, July 13, 2015 1:56 PM
>> To: Robert Goulet
>> Cc: cmake-developers at cmake.org
>> Subject: Re: [cmake-developers] cmake.exe parameters and system
>> command line length limit
>>
>> You could use the -C command line option to pass in the name of a file containing initial cache values. See the "-C <initial-cache>" section at the top of this documentation section:
>>
>>     http://www.cmake.org/cmake/help/v3.3/manual/cmake.1.html#options
>>
>> The format of the file is just a bunch of set(... CACHE ...) commands.
>> Read the doc paragraph carefully, and give it a try. Maybe somebody else can point to a valid example of a live -C file being used out there on the Internet.
>>
>>
>> HTH,
>> David C.
>>
>>
>>
>> On Mon, Jul 13, 2015 at 1:44 PM, Robert Goulet <Robert.Goulet at autodesk.com> wrote:
>>> Hi all,
>>>
>>>
>>>
>>> We use a custom script to handle which parameters we set to cmake.exe
>>> on Windows. It sets CMake values based on the options provided to
>>> this script, using the -D cmake parameter. This works well, but
>>> recently we’ve reached the limit on how many characters we can set to
>>> a single system command line (cmd.exe), because our number of options is growing.
>>>
>>>
>>>
>>> Is there a work-around for this using CMake, or perhaps feed CMake
>>> parameters from a file rather than from command-line parameters? i.e.
>>> “cmake.exe < params.txt” ?
>>>
>>>
>>>
>>> Thanks!
>>>
>>>
>>> --
>>>
>>> Powered by www.kitware.com
>>>
>>> Please keep messages on-topic and check the CMake FAQ at:
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Kitware offers various services to support the CMake community. For
>>> more information on each offering, please visit:
>>>
>>> CMake Support: http://cmake.org/cmake/help/support.html
>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/cmake-developers


More information about the cmake-developers mailing list