/*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 2002 Insight Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "cmGlobalCodeWarriorGenerator.h"
#include "cmLocalCodeWarriorGenerator.h"
#include "cmMakefile.h"
#include "cmSystemTools.h"
#include "cmSourceFile.h"
#include "cmCacheManager.h"
cmLocalCodeWarriorGenerator::cmLocalCodeWarriorGenerator()
{
}
cmLocalCodeWarriorGenerator::~cmLocalCodeWarriorGenerator()
{
}
void cmLocalCodeWarriorGenerator::Generate(bool /* fromTheTop */)
{
}
void cmLocalCodeWarriorGenerator::WriteTargets(std::ostream& fout)
{
cmTargets &tgts = m_Makefile->GetTargets();
for(cmTargets::iterator l = tgts.begin();
l != tgts.end(); l++)
{
this->WriteTarget(fout,l->first.c_str(),&(l->second));
}
}
void cmLocalCodeWarriorGenerator::WriteTarget(std::ostream& fout,
const char *tgtName,
cmTarget const *l)
{
fout << "\n";
fout << "" << tgtName << "\n";
this->WriteSettingList(fout,tgtName,l);
this->WriteFileList(fout,tgtName,l);
// this->WriteLinkOrder(fout,l);
// this->WriteSubTargetList(fout,l);
fout << "\n";
}
void cmLocalCodeWarriorGenerator::WriteSettingList(std::ostream& fout,
const char *tgtName,
cmTarget const *l)
{
fout << "\n";
// list the include paths
fout << "UserSearchPaths\n";
std::vector& includes = m_Makefile->GetIncludeDirectories();
std::vector::iterator i = includes.begin();
for(;i != includes.end(); ++i)
{
fout << "\n";
fout << "SearchPath\n";
fout << "Path" << i->c_str() << "\n";
fout << "PathFormatGeneric\n";
fout << "PathRootAbsolute\n";
fout << "\n";
fout << "Recursivefalse\n";
fout << "FrameworkPathfalse\n";
fout << "HostFlagsAll\n";
fout << "\n";
}
fout << "\n";
fout << "Targetname" << tgtName
<< "\n";
fout << "\n";
}
void cmLocalCodeWarriorGenerator::WriteFileList(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 << "Text\n";
fout << "Debug\n";
fout << "\n";
}
fout << "\n";
}
void cmLocalCodeWarriorGenerator::WriteGroups(std::ostream& fout)
{
cmTargets &tgts = m_Makefile->GetTargets();
for(cmTargets::iterator l = tgts.begin();
l != tgts.end(); l++)
{
this->WriteGroup(fout,l->first.c_str(),&(l->second));
}
}
void cmLocalCodeWarriorGenerator::WriteGroup(std::ostream& fout,
const char *tgtName,
cmTarget const *l)
{
fout << "" << tgtName << "\n";
// for each file
std::vector const& classes = l->GetSourceFiles();
for(std::vector::const_iterator i = classes.begin();
i != classes.end(); i++)
{
std::string source = (*i)->GetFullPath();
fout << "\n";
fout << "" << tgtName << "\n";
fout << "Name\n";
fout << "" << source << "\n";
fout << "Generic\n";
fout << "\n";
}
fout << "\n";
}