diff --git a/Source/cmGlobalCodeWarriorGenerator.cxx b/Source/cmGlobalCodeWarriorGenerator.cxx index 0d6fb6df6..b2e0a9825 100644 --- a/Source/cmGlobalCodeWarriorGenerator.cxx +++ b/Source/cmGlobalCodeWarriorGenerator.cxx @@ -46,7 +46,7 @@ int cmGlobalCodeWarriorGenerator::TryCompile(const char *, const char *targetName, std::string *output) { - return 1; + return 1; } ///! Create a local generator appropriate to this Global Generator @@ -279,6 +279,7 @@ void cmGlobalCodeWarriorGenerator::WriteGroupList(std::ostream& fout) static_cast(m_LocalGenerators[i])->WriteGroups(fout); } + fout << "\n"; } diff --git a/Source/cmLocalCodeWarriorGenerator.cxx b/Source/cmLocalCodeWarriorGenerator.cxx index 574566823..250ac22d1 100644 --- a/Source/cmLocalCodeWarriorGenerator.cxx +++ b/Source/cmLocalCodeWarriorGenerator.cxx @@ -52,20 +52,56 @@ void cmLocalCodeWarriorGenerator::WriteTarget(std::ostream& fout, fout << "\n"; fout << "" << tgtName << "\n"; - this->WriteSettingList(fout,tgtName,l); - this->WriteFileList(fout,tgtName,l); - // this->WriteLinkOrder(fout,l); + this->WriteSettingList(fout, tgtName,l); + this->WriteFileList(fout, tgtName,l); + this->WriteLinkOrder(fout, tgtName, l); // this->WriteSubTargetList(fout,l); fout << "\n"; } +void cmLocalCodeWarriorGenerator::AddFileMapping(std::ostream& fout, + const char *ftype, + const char *ext, + const char *comp, + const char *edit, + bool precomp, + bool launch, + bool res, + bool ignored) +{ + fout << "\n"; + fout << "FileType" << ftype << + "\n"; + fout << "FileExtension" << ext << + "\n"; + fout << "Compiler" << comp << + "\n"; + fout << "EditLanguage" << edit << + "\n"; + fout << "Precompile" + << (precomp ? "true" : "false") << "\n"; + fout << "Launchable" + << (launch ? "true" : "false") << "\n"; + fout << "ResourceFile" + << (res ? "true" : "false") << "\n"; + fout << "IgnoredByMake" + << (ignored ? "true" : "false") << "\n"; + fout << "\n"; +} + + void cmLocalCodeWarriorGenerator::WriteSettingList(std::ostream& fout, - const char *tgtName, + const char *tgtName, cmTarget const *l) { fout << "\n"; + fout << "UserSourceTrees\n"; + fout << "AlwaysSearchUserPathsfalse\n"; + fout << "InterpretDOSAndUnixPathsfalse\n"; + fout << "RequireFrameworkStyleIncludesfalse\n"; + // list the include paths fout << "UserSearchPaths\n"; std::vector& includes = m_Makefile->GetIncludeDirectories(); @@ -85,14 +121,144 @@ void cmLocalCodeWarriorGenerator::WriteSettingList(std::ostream& fout, } fout << "\n"; + fout << "SystemSearchPaths\n"; + fout << "\n"; + fout << "SearchPath\n"; + fout << "Path:MSL:\n"; + fout << "PathFormatMacOS\n"; + fout << "PathRootCodeWarrior\n"; + fout << "\n"; + fout << "Recursivetrue\n"; + fout << "FrameworkPathfalse\n"; + fout << "HostFlagsAll\n"; + fout << "\n"; + fout << "\n"; + fout << "SearchPath\n"; + fout << "Path:MacOS Support:\n"; + fout << "PathFormatMacOS\n"; + fout << "PathRootCodeWarrior\n"; + fout << "\n"; + fout << "Recursivetrue\n"; + fout << "FrameworkPathfalse\n"; + fout << "HostFlagsAll\n"; + fout << "\n"; + fout << "\n"; + + fout << "MWRuntimeSettings_WorkingDirectory\n"; + fout << "MWRuntimeSettings_CommandLine\n"; + fout << "MWRuntimeSettings_HostApplication\n"; + fout << "Path\n"; + fout << "PathFormatGeneric\n"; + fout << "PathRootAbsolute\n"; + fout << "\n"; + fout << "MWRuntimeSettings_EnvVars\n"; + + // + fout << "LinkerMacOS PPC Linker\n"; + fout << "PreLinker\n"; + fout << "PostLinker\n"; fout << "Targetname" << tgtName << "\n"; + fout << "OutputDirectory\n"; + fout << "Path:\n"; + fout << "PathFormatMacOS\n"; + fout << "PathRootProject\n"; + fout << "\n"; + fout << "SaveEntriesUsingRelativePathsfalse\n"; + + // add the cxx file type + fout << "FileMappings\n"; + this->AddFileMapping(fout,"TEXT",".cxx","MW C/C++ PPC","C/C++", + false,false,false,false); + this->AddFileMapping(fout,"TEXT",".cpp","MW C/C++ PPC","C/C++", + false,false,false,false); + this->AddFileMapping(fout,"TEXT",".c","MW C/C++ PPC","C/C++", + false,false,false,false); + this->AddFileMapping(fout,"TEXT",".cc","MW C/C++ PPC","C/C++", + false,false,false,false); + this->AddFileMapping(fout,"TEXT",".cp","MW C/C++ PPC","C/C++", + false,false,false,false); + this->AddFileMapping(fout,"TEXT",".cpp","MW C/C++ PPC","C/C++", + false,false,false,false); + this->AddFileMapping(fout,"TEXT",".h","MW C/C++ PPC","C/C++", + false,false,false,true); + this->AddFileMapping(fout,"TEXT",".hpp","MW C/C++ PPC","C/C++", + false,false,false,true); + this->AddFileMapping(fout,"TEXT",".m","MW C/C++ PPC","C/C++", + false,false,false,false); + this->AddFileMapping(fout,"TEXT",".mm","MW C/C++ PPC","C/C++", + false,false,false,false); + fout << "\n"; + + // + fout << "MWProject_PPC_type"; + switch (l->GetType()) + { + case cmTarget::STATIC_LIBRARY: + fout << "Library" << "\n"; + fout << "MWProject_PPC_outfile"; + fout << tgtName << ".lib"; + fout << "\n"; + break; + case cmTarget::SHARED_LIBRARY: + case cmTarget::MODULE_LIBRARY: + // m_Makefile->GetDefinition("CMAKE_MODULE_SUFFIX"); + fout << "Shared Library" << "\n"; + fout << "MWProject_PPC_outfile"; + fout << tgtName << ".dylib"; + fout << "\n"; + break; + case cmTarget::EXECUTABLE: + fout << "Application" << "\n"; + fout << "MWProject_PPC_outfile"; + fout << tgtName << cmSystemTools::GetExecutableExtension(); + fout << "\n"; + break; + } + + fout << "MWProject_PPC_filecreator????\n"; + fout << "MWProject_PPC_filetypeAPPL\n"; + fout << "MWProject_PPC_size384\n"; + fout << "MWProject_PPC_minsize384\n"; + fout << "MWProject_PPC_stacksize64\n"; + fout << "MWProject_PPC_flags22720\n"; + fout << "MWProject_PPC_symfilename\n"; + fout << "MWProject_PPC_rsrcname\n"; + fout << "MWProject_PPC_rsrcheaderNative\n"; + fout << "MWProject_PPC_rsrctype????\n"; + fout << "MWProject_PPC_rsrcid0\n"; + fout << "MWProject_PPC_rsrcflags0\n"; + fout << "MWProject_PPC_rsrcstore0\n"; + fout << "MWProject_PPC_rsrcmerge0\n"; + fout << "MWProject_PPC_flatrsrc0\n"; + fout << "MWProject_PPC_flatrsrcoutputdir\n"; + fout << "Path:\n"; + fout << "PathFormatMacOS\n"; + fout << "PathRootProject\n"; + fout << "\n"; + fout << "MWProject_PPC_flatrsrcfilename\n"; + + /* + fout << "MWMerge_MacOS_outputCreator????\n"; + fout << "MWMerge_MacOS_outputTypeAPPL\n"; + fout << "MWMerge_MacOS_suppressWarning0\n"; + fout << "MWMerge_MacOS_copyFragments1\n"; + fout << "MWMerge_MacOS_copyResources1\n"; + fout << "MWMerge_MacOS_flattenResource0\n"; + fout << "MWMerge_MacOS_flatFileNamea.rsrc\n"; + fout << "MWMerge_MacOS_flatFileOutputPath\n"; + fout << "Path:\n"; + fout << "PathFormatMacOS\n"; + fout << "PathRootProject\n"; + fout << "\n"; + fout << "MWMerge_MacOS_skipResources\n"; + */ fout << "\n"; } void cmLocalCodeWarriorGenerator::WriteFileList(std::ostream& fout, - const char *tgtName, + const char *tgtName, cmTarget const *l) { fout << "\n"; @@ -114,9 +280,61 @@ void cmLocalCodeWarriorGenerator::WriteFileList(std::ostream& fout, fout << "Debug\n"; fout << "\n"; } + + // now add in the libraries we depend on + + + // now add in the system libs (for an executable) + if (l->GetType() == cmTarget::EXECUTABLE) + { + fout << "\n"; + fout << "Name\n"; + fout << "MSL RuntimePPC.Lib\n"; + fout << "MacOS\n"; + fout << "Library\n"; + fout << "Debug\n"; + fout << "\n"; + } + fout << "\n"; } + +void cmLocalCodeWarriorGenerator::WriteLinkOrder(std::ostream& fout, + const char *tgtName, + cmTarget const *l) +{ + fout << "\n"; + + // for each file + std::vector const& classes = l->GetSourceFiles(); + for(std::vector::const_iterator i = classes.begin(); + i != classes.end(); i++) + { + // Add the file to the list of sources. + std::string source = (*i)->GetFullPath(); + fout << "\n"; + fout << "Absolute\n"; + fout << "Absolute\n"; + //fout << "common\n"; + fout << "" << source << "\n"; + fout << "Generic\n"; + fout << "\n"; + } + + // now add in the system libs (for an executable) + if (l->GetType() == cmTarget::EXECUTABLE) + { + fout << "\n"; + fout << "Name\n"; + fout << "MSL RuntimePPC.Lib\n"; + fout << "MacOS\n"; + fout << "\n"; + } + + fout << "\n"; +} + void cmLocalCodeWarriorGenerator::WriteGroups(std::ostream& fout) { cmTargets &tgts = m_Makefile->GetTargets(); @@ -125,6 +343,7 @@ void cmLocalCodeWarriorGenerator::WriteGroups(std::ostream& fout) { this->WriteGroup(fout,l->first.c_str(),&(l->second)); } + } void cmLocalCodeWarriorGenerator::WriteGroup(std::ostream& fout, @@ -141,11 +360,53 @@ void cmLocalCodeWarriorGenerator::WriteGroup(std::ostream& fout, std::string source = (*i)->GetFullPath(); fout << "\n"; fout << "" << tgtName << "\n"; - fout << "Name\n"; + fout << "Absolute\n"; + fout << "Absolute\n"; fout << "" << source << "\n"; fout << "Generic\n"; fout << "\n"; } + // write out the libraries groups +/* + + Classic Release + Name + console.stubs.c + MacOS + +*/ + + if (l->GetType() == cmTarget::EXECUTABLE) + { + fout << "\n"; + fout << "" << tgtName << "\n"; + fout << "Name\n"; + fout << "MSL RuntimePPC.Lib\n"; + fout << "MacOS\n"; + fout << "\n"; + } + +/* + + Classic Release + Name + MSL C++.PPC.Lib + MacOS + + + Classic Release + Name + MSL C.PPC.Lib + MacOS + + + Carbon Debug + Name + MSL C.CARBON.Lib + MacOS + +*/ + fout << "\n"; } diff --git a/Source/cmLocalCodeWarriorGenerator.h b/Source/cmLocalCodeWarriorGenerator.h index 2cfe95996..d3f2790d7 100644 --- a/Source/cmLocalCodeWarriorGenerator.h +++ b/Source/cmLocalCodeWarriorGenerator.h @@ -65,6 +65,12 @@ private: void WriteSettingList(std::ostream& fout, const char *name, cmTarget const *l); void WriteFileList(std::ostream& fout, const char *name, cmTarget const *l); + void WriteLinkOrder(std::ostream& fout, const char *name, cmTarget const *l); + void AddFileMapping(std::ostream& fout, const char *ftype, + const char *ext, const char *comp, + const char *edit, bool precomp, + bool launch, bool res, bool ignored); + }; #endif