From 8013ffd23b329fbc4ce66c9c8e04e51e98fca392 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Wed, 31 Jan 2007 16:49:25 -0500 Subject: [PATCH] ENH: do not use crazy long paths to object files for try compile --- Source/cmLocalGenerator.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 0333a5ecc..f0fa9befa 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2286,6 +2286,16 @@ cmLocalGenerator::GetObjectFileNameWithoutTarget(const cmSourceFile& source) objectName = relFromSource; } } + // if it is still a full path check for the try compile case + // try compile never have in source sources, and should not + // have conflicting source file names in the same target + if(cmSystemTools::FileIsFullPath(objectName.c_str())) + { + if(this->GetGlobalGenerator()->GetCMakeInstance()->GetIsInTryCompile()) + { + objectName = cmSystemTools::GetFilenameName(source.GetFullPath()); + } + } // Replace the original source file extension with the object file // extension.