[CMake] MSVC6 .dsp file line length limit exceeded (include directories)

Reinhold Füreder R.Fureder at exeter.ac.uk
Fri May 13 10:45:06 EDT 2005


Dear Bill, Brad, Ken et al.,

CMake 2.05, MSVC 6.0, Windows 2000.

Due to efforts of making the usage of our CMake managed projects as easy
as possible we currently "resolve" all include directory dependencies in
each subproject directly. This now led to the issue of a too long
include directory line in the generated .dsp MSVC6 project file. After
4096 characters a simple line break is inserted:

# ADD CPP  /I "D:\CVS\wxWindows\include" ... /I "D:\CVS\bla [\n]
bla bla /I "D:\CVS\bla" -DUSE_BLA -DWNT /D "ScanCAD_EXPORTS"
# ADD CPP   /W3 /Zm1000 /GX /GR  -DNOMINMAX  /D "_MBCS"

Consequently MSVC does not seem to be able to parse this correctly and
omits '/I "D:\CVS\bla" -DUSE_BLA -DWNT /D "ScanCAD_EXPORTS"' in this
case.


The reason for our huge include directory list is our kinda lazy, but
user-friendly way of organising subprojects with direct
INCLUDE_DIRECTORIES (...) calls (B depends on A, C depends on A, D
depends on A and B and C):
A: INCLUDE_DIRECTORIES (a1 a2)
B: INCLUDE_DIRECTORIES (a1 a2 b1)
C: INCLUDE_DIRECTORIES (a1 a2 c1)
D: INCLUDE_DIRECTORIES (a1 a2 a1 a2 b1 a1 a2 c1)
Thus, there are a lot of dupliate entries.

Now as the line limit is exceeded we are wondering, if it would not be
an extremely easy option to just add a more MSVC friendly line break by
starting the next line with another '# ADD CPP /I "..." ...'? (In
analogy to LINK32 entries in the .dsp file, if it is accepted by MSVC6.)

Certainly, we could circumvent this duplicate entries by a less
convenient approach: Replacing direct calls of INCLUDE_DIRECTORIES (...)
by variable usage, but still resolve all dependencies directly, i.e.
leading to duplicates. In the end we then need to use the unifying
container adding macros (posted by Iker Arizmendi on 12 June 2004) for
the purpose of turning the list of include dirs (including duplicates)
into the final and single INCLUDE_DIRECTORIES (...) call.

Would you mind turning the current line breaks as aforementioned? Or,
another option by filtering the duplicate include directory entries
before writing them out in CMake?

Thanks for your time,
    Reinhold

____________________________
Reinhold Füreder
MPhil Student
School of Eng., CS and Maths
University of Exeter, UK



More information about the CMake mailing list