summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2009-06-26 02:53:02 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2009-06-26 02:53:02 (GMT)
commitb6d022f853b5eede9f15c6d61ea5fa896a139f90 (patch)
tree2c80f148561a3da51711669ee0fb9fe804cbf12d
parent7491f52992450bc6853c44c28db646c6176cbfd0 (diff)
downloadCMake-b6d022f853b5eede9f15c6d61ea5fa896a139f90.zip
CMake-b6d022f853b5eede9f15c6d61ea5fa896a139f90.tar.gz
CMake-b6d022f853b5eede9f15c6d61ea5fa896a139f90.tar.bz2
ENH: add obj file support and remove a warning
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx45
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h3
2 files changed, 39 insertions, 9 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index d08c676..f3d01e7 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -142,7 +142,8 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WritePathAndIncrementalLinkOptions();
this->WriteItemDefinitionGroups();
this->WriteCustomCommands();
- this->WriteSources();
+ this->WriteObjSources();
+ this->WriteCLSources();
this->WriteProjectReferences();
this->WriteString(
"<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\""
@@ -346,7 +347,38 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
}
-void cmVisualStudio10TargetGenerator::WriteSources()
+void cmVisualStudio10TargetGenerator::WriteObjSources()
+{
+ if(this->Target->GetType() > cmTarget::MODULE_LIBRARY)
+ {
+ return;
+ }
+ bool first = true;
+ std::vector<cmSourceFile*>const & sources = this->Target->GetSourceFiles();
+ for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
+ source != sources.end(); ++source)
+ {
+ std::cerr << (*source)->GetExtension() << "\n";
+ std::cerr << (*source)->GetFullPath() << "\n";
+ if((*source)->GetExtension() == "obj")
+ {
+ if(first)
+ {
+ this->WriteString("<ItemGroup>\n", 1);
+ first = false;
+ }
+ this->WriteString("<None Include=\"", 2);
+ (*this->BuildFileStream ) << (*source)->GetFullPath() << "\" />\n";
+ }
+ }
+ if(!first)
+ {
+ this->WriteString("</ItemGroup>\n", 1);
+ }
+}
+
+
+void cmVisualStudio10TargetGenerator::WriteCLSources()
{
this->WriteString("<ItemGroup>\n", 1);
if(this->Target->GetType() > cmTarget::MODULE_LIBRARY)
@@ -590,8 +622,7 @@ OutputLinkIncremental(std::string const& configName)
void
cmVisualStudio10TargetGenerator::
-WriteClOptions(std::string const&
- configName,
+WriteClOptions(std::string const& configName,
std::vector<std::string> const & includes)
{
@@ -699,7 +730,7 @@ OutputIncludes(std::vector<std::string> const & includes)
void cmVisualStudio10TargetGenerator::
-WriteRCOptions(std::string const& config,
+WriteRCOptions(std::string const& ,
std::vector<std::string> const & includes)
{
this->WriteString("<ResourceCompile>\n", 2);
@@ -898,8 +929,7 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
void cmVisualStudio10TargetGenerator::
-WriteMidlOptions(std::string const&
- config,
+WriteMidlOptions(std::string const& /*config*/,
std::vector<std::string> const & includes)
{
this->WriteString("<Midl>\n", 2);
@@ -949,7 +979,6 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
}
}
-// TODO handle .obj file direct stuff
void cmVisualStudio10TargetGenerator::WriteProjectReferences()
{
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 618b993..71662f0 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -49,7 +49,8 @@ private:
void WriteString(const char* line, int indentLevel);
void WriteProjectConfigurations();
void WriteProjectConfigurationValues();
- void WriteSources();
+ void WriteCLSources();
+ void WriteObjSources();
void WritePathAndIncrementalLinkOptions();
void WriteItemDefinitionGroups();
void WriteClOptions(std::string const& config,