diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-28 13:54:01 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-28 13:54:01 (GMT) |
commit | 40272a16bd99b2a099cb3ef910f6d70c7c3a6f65 (patch) | |
tree | 3834eae44422f7342369ae285f2daa99e66eb0bc /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | 5d722df21f76087d80603b1df3a6be628c3e1693 (diff) | |
download | CMake-40272a16bd99b2a099cb3ef910f6d70c7c3a6f65.zip CMake-40272a16bd99b2a099cb3ef910f6d70c7c3a6f65.tar.gz CMake-40272a16bd99b2a099cb3ef910f6d70c7c3a6f65.tar.bz2 |
ENH: Add support for adding content to bundles
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 52 |
1 files changed, 48 insertions, 4 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index b590ed8..2240345 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1542,15 +1542,54 @@ cmLocalUnixMakefileGenerator3 { objectName = objectName.substr(0, dot_pos); } - objectName += - this->GlobalGenerator->GetLanguageOutputExtensionFromExtension( - source.GetSourceExtension().c_str()); + if ( source.GetPropertyAsBool("KEEP_EXTENSION") ) + { + if ( !source.GetSourceExtension().empty() ) + { + objectName += "." + source.GetSourceExtension(); + } + } + else + { + objectName += + this->GlobalGenerator->GetLanguageOutputExtensionFromExtension( + source.GetSourceExtension().c_str()); + } // Convert to a safe name. objectName = this->CreateSafeUniqueObjectFileName(objectName.c_str()); // Prepend the target directory. - std::string obj = this->GetTargetDirectory(target); + std::string obj; + const char* fileTargetDirectory = source.GetProperty("MACOSX_PACKAGE_LOCATION"); + if ( fileTargetDirectory ) + { + std::string targetName; + std::string targetNameReal; + target.GetExecutableNames(targetName, targetNameReal, + this->ConfigurationName.c_str()); + if ( target.GetPropertyAsBool("MACOSX_BUNDLE") ) + { + // Construct the full path version of the names. + obj = this->ExecutableOutputPath; + if(obj.empty()) + { + obj = this->Makefile->GetStartOutputDirectory(); + obj += "/"; + } + obj += targetName + ".app/Contents/"; + obj += fileTargetDirectory; + } + else + { + // Framework not handled yet + abort(); + } + } + else + { + obj = this->GetTargetDirectory(target); + } obj += "/"; obj += objectName; if(nameWithoutTargetDir) @@ -1763,6 +1802,11 @@ const char* cmLocalUnixMakefileGenerator3 ::GetSourceFileLanguage(const cmSourceFile& source) { + const char* lang = source.GetProperty("LANGUAGE"); + if ( lang ) + { + return lang; + } // Identify the language of the source file. return (this->GlobalGenerator ->GetLanguageFromExtension(source.GetSourceExtension().c_str())); |