[Cmake] INCLUDE_EXTERNAL_MSPROJECT caused crash

Karr, David David.Karr at titan.com
Tue, 6 Jan 2004 13:41:43 -0500


I am trying to upgrade from CMake 1.6.7 to 1.8.1, but my CMakeLists.txt no
longer
works. I created a minimal test case that shows the problem:
 
# CMakeLists.txt
PROJECT(test)
INCLUDE_EXTERNAL_MSPROJECT(other_project other_project.dsp)
ADD_EXECUTABLE(test SomeSource.cpp)
 
where other_project.dsp and SomeSource.cpp were files that already 
existed in the same directory as CMakeLists.txt.
 
This works fine in CMake 1.6.7. It creates test.dsw which includes
other_project.
But CMake 1.8.1 crashes every time without warning. When I remove the
command
INCLUDE_EXTERNAL_MSPROJECT, CMake 1.8.1 runs OK, but of
course then there are no external projects shown in my workspace.
 
Running this from the debugger, the error occurs while executing line 317 of
cmGlobalVisualStudio6Generator.cxx: 
 
        cmCustomCommand cc = l->second.GetPreLinkCommands()[0];

 
The problem seems to be that when this is executed, and I examine l->second,
which is supposed to be a cmTarget, all the vector<> members of l->second
are empty.
Hence what we get from l->second.GetPreLinkCommands()[0] is the "end"
marker,
and attempts to read strings from this object have bad results.
 
How is this supposed to work in 1.8.1, and why does it work differently than
in
version 1.6.7?
 
--David