BUG: Do not remove the source file extension when computing an object file name. This addresses bug #6169. If CMAKE_BACKWARDS_COMPATIBILITY is 2.4 or lower maintain the old behavior so that existing build trees and old project releases are not affected.

This commit is contained in:
Brad King
2007-12-28 23:07:26 -05:00
parent f872c10b7e
commit 3efc6e40cb
3 changed files with 14 additions and 22 deletions
+7 -4
View File
@@ -2753,11 +2753,14 @@ cmLocalGenerator
// extension.
if(!source.GetPropertyAsBool("KEEP_EXTENSION"))
{
// Remove the original extension.
std::string::size_type dot_pos = objectName.rfind(".");
if(dot_pos != std::string::npos)
// Remove the original extension for CMake 2.4 compatibility.
if(this->NeedBackwardsCompatibility(2, 4))
{
objectName = objectName.substr(0, dot_pos);
std::string::size_type dot_pos = objectName.rfind(".");
if(dot_pos != std::string::npos)
{
objectName = objectName.substr(0, dot_pos);
}
}
// Store the new extension.