[Insight-developers] ITK Modular: mingw deal breaker

Bill Lorensen bill.lorensen at gmail.com
Sat Mar 12 16:50:30 EST 2011


I just tried an experiment using the gcc @file syntax to read command
line options from a file.

1) I stored the CXX_FLAGS contents in a file called opt.txt in the
same directory as flags.make).
2) I edited flags.cmake to contain:

CXX_FLAGS =   @"c:\lorensen\ProjectsGIT\ITKWikiExamples-modular\ItkVtkGlue\CMakeFiles\ItkVtkGlue.dir\opt.txt"

3) Then ran make and the target was built correctly.

NOTE: I had to enclose the filename in "'s.

This seems like a fairly clean way to handle long command line options
for the gcc compile. The justification is the same as was used for the
link.txt script.

Can a cmake guru comment on this solution?

Bill

On Sat, Mar 12, 2011 at 12:43 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Marcus,
>
> Sounds interesting. There are many apps that use both ITK and VTK.
> Once VTK is modularized, the command line length will be even larger.
> I suspect that platforms other than mingw will start to have issues.
>
> Bill
>
> On Sat, Mar 12, 2011 at 12:31 PM, Marcus D. Hanwell
> <marcus.hanwell at kitware.com> wrote:
>> On Sat, Mar 12, 2011 at 11:50 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>> On my mingw build, if I turn on all modules and testing, I get
>>> "The input line is too long."
>>> when trying to build ITK.
>>>
>>> This is a real deal breaker. A possible solution is to change the gcc
>>> compiler to use the @file command line option that allows options to
>>> be read from a file.
>>>
>> Another alternative is to use the forwarding headers work that I did
>> for Boost. It uses CMake to create forwarding headers, and could
>> create the flat layout that will be in the install tree in the build
>> directory. That way only one -I should be required for the ITK
>> headers, and it will be very similar to the installed header layout.
>>
>> It would need some adaptation, but might be a viable solution in this case.
>>
>> Marcus
>>
>


More information about the Insight-developers mailing list