cmLocalCodeWarriorGenerator.cxx 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #include "cmGlobalCodeWarriorGenerator.h"
  14. #include "cmLocalCodeWarriorGenerator.h"
  15. #include "cmMakefile.h"
  16. #include "cmSystemTools.h"
  17. #include "cmSourceFile.h"
  18. #include "cmCacheManager.h"
  19. cmLocalCodeWarriorGenerator::cmLocalCodeWarriorGenerator()
  20. {
  21. }
  22. cmLocalCodeWarriorGenerator::~cmLocalCodeWarriorGenerator()
  23. {
  24. }
  25. void cmLocalCodeWarriorGenerator::Generate(bool /* fromTheTop */)
  26. {
  27. }
  28. void cmLocalCodeWarriorGenerator::WriteTargets(std::ostream& fout)
  29. {
  30. cmTargets &tgts = m_Makefile->GetTargets();
  31. for(cmTargets::iterator l = tgts.begin();
  32. l != tgts.end(); l++)
  33. {
  34. this->WriteTarget(fout,l->first.c_str(),&(l->second));
  35. }
  36. }
  37. void cmLocalCodeWarriorGenerator::WriteTarget(std::ostream& fout,
  38. const char *tgtName,
  39. cmTarget const *l)
  40. {
  41. fout << "<TARGET>\n";
  42. fout << "<NAME>" << tgtName << "</NAME>\n";
  43. this->WriteSettingList(fout,tgtName,l);
  44. this->WriteFileList(fout,tgtName,l);
  45. // this->WriteLinkOrder(fout,l);
  46. // this->WriteSubTargetList(fout,l);
  47. fout << "</TARGET>\n";
  48. }
  49. void cmLocalCodeWarriorGenerator::WriteSettingList(std::ostream& fout,
  50. const char *tgtName,
  51. cmTarget const *l)
  52. {
  53. fout << "<SETTINGLIST>\n";
  54. // list the include paths
  55. fout << "<SETTING><NAME>UserSearchPaths</NAME>\n";
  56. std::vector<std::string>& includes = m_Makefile->GetIncludeDirectories();
  57. std::vector<std::string>::iterator i = includes.begin();
  58. for(;i != includes.end(); ++i)
  59. {
  60. fout << "<SETTING>\n";
  61. fout << "<SETTING><NAME>SearchPath</NAME>\n";
  62. fout << "<SETTING><NAME>Path</NAME><VALUE>" << i->c_str() << "</VALUE></SETTING>\n";
  63. fout << "<SETTING><NAME>PathFormat</NAME><VALUE>Generic</VALUE></SETTING>\n";
  64. fout << "<SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>\n";
  65. fout << "</SETTING>\n";
  66. fout << "<SETTING><NAME>Recursive</NAME><VALUE>false</VALUE></SETTING>\n";
  67. fout << "<SETTING><NAME>FrameworkPath</NAME><VALUE>false</VALUE></SETTING>\n";
  68. fout << "<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>\n";
  69. fout << "</SETTING>\n";
  70. }
  71. fout << "</SETTING>\n";
  72. fout << "<SETTING><NAME>Targetname</NAME><VALUE>" << tgtName
  73. << "</VALUE></SETTING>\n";
  74. fout << "</SETTINGLIST>\n";
  75. }
  76. void cmLocalCodeWarriorGenerator::WriteFileList(std::ostream& fout,
  77. const char *tgtName,
  78. cmTarget const *l)
  79. {
  80. fout << "<FILELIST>\n";
  81. // for each file
  82. std::vector<cmSourceFile*> const& classes = l->GetSourceFiles();
  83. for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
  84. i != classes.end(); i++)
  85. {
  86. // Add the file to the list of sources.
  87. std::string source = (*i)->GetFullPath();
  88. fout << "<FILE>\n";
  89. fout << "<PATHTYPE>PathAbsolute</PATHTYPE>\n";
  90. fout << "<PATHROOT>Absolute</PATHROOT>\n";
  91. //fout << "<ACCESSPATH>common</ACCESSPATH>\n";
  92. fout << "<PATH>" << source << "</PATH>\n";
  93. fout << "<PATHFORMAT>Generic</PATHFORMAT>\n";
  94. fout << "<FILEKIND>Text</FILEKIND>\n";
  95. fout << "<FILEFLAGS>Debug</FILEFLAGS>\n";
  96. fout << "</FILE>\n";
  97. }
  98. fout << "</FILELIST>\n";
  99. }