[CMake] Can CMake confgure shorter cmmand argments?

Bo Berglund bo.berglund at gmail.com
Mon Aug 5 11:44:52 EDT 2013


I am strugging wth building the Visualization ToolKit package for the
Embarcadero RAD studio XE4 compiler.
It uses CMake to create the makefiles and prepare for building.
Now I have come across a showstopper where the CMake generated command
to handle a library uses an exessively long commandline argument.
Example:

tlib /p512 /a "..\bin\vtkFiltering.lib"
"CMakeFiles\vtkFiltering.dir\vtkAbstractMapper.obj"
"CMakeFiles\vtkFiltering.dir\vtkActor2D.obj"
"CMakeFiles\vtkFiltering.dir\vtkActor2DCollection.obj"
"CMakeFiles\vtkFiltering.dir\vtkAlgorithm.obj"
"CMakeFiles\vtkFiltering.dir\vtkAlgorithmOutput.obj"
"CMakeFiles\vtkFiltering.dir\vtkCachedStreamingDemandDrivenPipeline.obj"
<  -- lots of more files listed -- >
"CMakeFiles\vtkFiltering.dir\vtkFilteringInstantiator.obj"
Fatal: Command arguments too long

I estimated the command line to be about 10.5 kbytes in size...

Every single file starts with a common dir name "CMakeFiles" so
getting rid of that would help.

But the best way to handle such long argument sizes being just long
lists of files would be for CMake to supply these as follows:

tlib /p512 /a "..\bin\vtkFiltering.lib" @filelist.txt

Here the filelist.txt file contains the list of files that would
otherwise appear on the tlib command line. They can then be read by
tlib from the file and everything is much shorter on the command line.

And the long list of files in the filelist.txt can be broken down in
several lines of file names by using a continuation character & at the
end of the lines.

So what I would like to know is how one can configure CMake to do this
when creating the build system? (I assume it is possible...)


-- 
Bo Berglund
Developer in Sweden



More information about the CMake mailing list