[CMake] Crash in ComputeLinkInformation: cmTarget::GetDirectory returns NULL for UTILITY type

Brad King brad.king at kitware.com
Thu Oct 12 09:20:44 EDT 2006


Eran Guendelman wrote:
> Looking at cmTarget::GetDirectory, my instinct for "fixing" this is to
> change
> 
> default:
> return 0;
> 
> to
> 
> default:
> this->Directory = "";
> 
> so that the subsequent check of if(this->Directory.empty()) will take
> care of this case.  But then again, I don't really know anything about
> how this code is supposed to work so this was just a guess (that at
> least did fix the crash and succeeded in generating project files --
> though I haven't tried to build them).

Thanks for the detailed report.  We'll get this fixed.

> Anyway, as for why we use ADD_CUSTOM_TARGET to build xerces-c_2D, it's
> because this is a third party library we are trying to build as part of
> our build system, and since the library came with a VC7 .sln file but no
> CMakeLists.txt files we basically made its CMakeLists.txt look something
> like:
> 
> ADD_CUSTOM_TARGET(xerces-c_2 ALL devenv
> ${OpenSim_SOURCE_DIR}/Vendors/xerces-c-src2_4_0/Projects/Win32/VC7/xerces-all/xerces-all.sln
> /build Release)

Have you tried the INCLUDE_EXTERNAL_MSPROJECT command?

-Brad


More information about the CMake mailing list