summaryrefslogtreecommitdiffstats
path: root/Source/cmVTKMakeInstantiatorCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2002-03-01 20:49:10 (GMT)
committerBrad King <brad.king@kitware.com>2002-03-01 20:49:10 (GMT)
commitac74d513827b7575319e37911888c1d6816ddd8a (patch)
tree40753bf0eed56af7a82d7601e5772c548fe2e80d /Source/cmVTKMakeInstantiatorCommand.cxx
parent3da299a796f6905662cbee7361e9a59c3c59c7b5 (diff)
downloadCMake-ac74d513827b7575319e37911888c1d6816ddd8a.zip
CMake-ac74d513827b7575319e37911888c1d6816ddd8a.tar.gz
CMake-ac74d513827b7575319e37911888c1d6816ddd8a.tar.bz2
ENH: Added support for including extra files in generated header to get access to export macros of derived projects.
Diffstat (limited to 'Source/cmVTKMakeInstantiatorCommand.cxx')
-rw-r--r--Source/cmVTKMakeInstantiatorCommand.cxx27
1 files changed, 24 insertions, 3 deletions
diff --git a/Source/cmVTKMakeInstantiatorCommand.cxx b/Source/cmVTKMakeInstantiatorCommand.cxx
index 320edf7..1f9edc5 100644
--- a/Source/cmVTKMakeInstantiatorCommand.cxx
+++ b/Source/cmVTKMakeInstantiatorCommand.cxx
@@ -37,6 +37,7 @@ cmVTKMakeInstantiatorCommand
std::vector<cmStdString> inSourceLists;
m_ExportMacro = "-";
unsigned int groupSize = 10;
+ bool includesMode = false;
// Find the path of the files to be generated.
std::string filePath = m_Makefile->GetCurrentOutputDirectory();
@@ -46,6 +47,7 @@ cmVTKMakeInstantiatorCommand
{
if(args[i] == "GROUP_SIZE")
{
+ includesMode = false;
if(++i < args.size())
{
std::string gSize = args[i].c_str();
@@ -60,6 +62,7 @@ cmVTKMakeInstantiatorCommand
}
else if(args[i] == "HEADER_LOCATION")
{
+ includesMode = false;
if(++i < args.size())
{
headerPath = args[i];
@@ -73,6 +76,7 @@ cmVTKMakeInstantiatorCommand
}
else if(args[i] == "EXPORT_MACRO")
{
+ includesMode = false;
if(++i < args.size())
{
m_ExportMacro = args[i];
@@ -84,12 +88,24 @@ cmVTKMakeInstantiatorCommand
return false;
}
}
- // If not an option, it must be another input source list name.
+ else if(args[i] == "INCLUDES")
+ {
+ includesMode = true;
+ }
+ // If not an option, it must be another input source list name or
+ // an include file.
else
{
std::string s = args[i];
m_Makefile->ExpandVariablesInString(s);
- inSourceLists.push_back(s);
+ if(!includesMode)
+ {
+ inSourceLists.push_back(s);
+ }
+ else
+ {
+ m_Includes.push_back(s);
+ }
}
}
@@ -223,7 +239,12 @@ cmVTKMakeInstantiatorCommand
"#ifndef __" << m_ClassName.c_str() << "_h\n"
"#define __" << m_ClassName.c_str() << "_h\n"
"\n"
- "#include \"vtkInstantiator.h\"\n"
+ "#include \"vtkInstantiator.h\"\n";
+ for(unsigned int i=0;i < m_Includes.size();++i)
+ {
+ os << "#include \"" << m_Includes[i].c_str() << "\"\n";
+ }
+ os <<
"\n"
"class " << m_ClassName.c_str() << "Initialize;\n"
"\n"