summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-02-01 15:48:33 -0500
committerBill Hoffman <bill.hoffman@kitware.com>2005-02-01 15:48:33 -0500
commit7baa78034e04cde65995ea4f6ce784aec8879b70 (patch)
tree7712488b84d8482e5be015058012527fc6677c43
parent3bb54c00d578466e9f4d4db92bf5face00c4e313 (diff)
downloadcmake-7baa78034e04cde65995ea4f6ce784aec8879b70.tar.gz
ENH: getting closer
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx22
-rw-r--r--Source/cmXCodeObject.cxx8
2 files changed, 28 insertions, 2 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 0c45dbc781..2499aff92c 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -35,6 +35,7 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vector<std::string>const& lang,
{
mf->AddDefinition("CMAKE_GENERATOR_CC", "gcc");
mf->AddDefinition("CMAKE_GENERATOR_CXX", "g++");
+ mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
this->cmGlobalGenerator::EnableLanguage(lang, mf);
}
@@ -64,6 +65,7 @@ int cmGlobalXCodeGenerator::TryCompile(const char *,
*/
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(bindir);
+ std::cerr << "ChangeDirectory " << bindir << "\n";
// Usage: xcodebuild [-project <projectname>] [-activetarget]
// [-alltargets] [-target <targetname>]... [-activebuildstyle]
// [-buildstyle <buildstylename>] [-optionalbuildstyle <buildstylename>]
@@ -72,13 +74,14 @@ int cmGlobalXCodeGenerator::TryCompile(const char *,
makeCommand += " -project ";
makeCommand += projectName;
+ makeCommand += ".xcode";
makeCommand += " build ";
if (targetName)
{
makeCommand += "-target ";
makeCommand += targetName;
}
-
+ makeCommand += " -buildstyle Development ";
int retVal;
int timeout = cmGlobalGenerator::s_TryCompileTimeout;
if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output, &retVal,
@@ -89,6 +92,8 @@ int cmGlobalXCodeGenerator::TryCompile(const char *,
cmSystemTools::ChangeDirectory(cwd.c_str());
return 1;
}
+ std::cerr << makeCommand << "\n";
+ std::cerr << "build worked " << retVal << "\n";;
cmSystemTools::ChangeDirectory(cwd.c_str());
return retVal;
}
@@ -167,8 +172,21 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
cmXCodeObject* settings = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
buildFile->AddAttribute("settings", settings);
fileRef->AddAttribute("fileEncoding", this->CreateString("4"));
+ std::string lang =
+ this->GetLanguageFromExtension(sf->GetSourceExtension().c_str());
+ std::string sourcecode = "sourcecode";
+ if(lang == "C")
+ {
+ sourcecode += ".c.c";
+ }
+ // default to c++
+ else
+ {
+ sourcecode += ".cpp.cpp";
+ }
+
fileRef->AddAttribute("lastKnownFileType",
- this->CreateString("sourcecode.cpp.cpp"));
+ this->CreateString(sourcecode.c_str()));
fileRef->AddAttribute("path", this->CreateString(
lg->ConvertToRelativeOutputPath(sf->GetFullPath().c_str()).c_str()));
fileRef->AddAttribute("refType", this->CreateString("4"));
diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx
index 262729a4a4..b4ecee996b 100644
--- a/Source/cmXCodeObject.cxx
+++ b/Source/cmXCodeObject.cxx
@@ -20,6 +20,14 @@ cmXCodeObject::cmXCodeObject(PBXType ptype, Type type)
str << (void*)this;
m_Id = str.str();
cmSystemTools::ReplaceString(m_Id, "0x", "");
+ if(m_Id.size() < 24)
+ {
+ int diff = 24 - m_Id.size();
+ for(int i =0; i < diff; ++i)
+ {
+ m_Id += "0";
+ }
+ }
m_Type = type;
if(m_Type == OBJECT)
{