diff options
author | Berk Geveci <berk.geveci@kitware.com> | 2001-06-01 17:29:32 (GMT) |
---|---|---|
committer | Berk Geveci <berk.geveci@kitware.com> | 2001-06-01 17:29:32 (GMT) |
commit | 6103324e011b56cdb5e44f1ea6840a3d9b2c449c (patch) | |
tree | d8f7d0662b40d5dc190035ea41d2afb3e335755c /Source/cmVTKWrapPythonCommand.cxx | |
parent | 01b980591bd26c30691530cdc848b4591e052c04 (diff) | |
download | CMake-6103324e011b56cdb5e44f1ea6840a3d9b2c449c.zip CMake-6103324e011b56cdb5e44f1ea6840a3d9b2c449c.tar.gz CMake-6103324e011b56cdb5e44f1ea6840a3d9b2c449c.tar.bz2 |
Fixing the module name for Unix.
Diffstat (limited to 'Source/cmVTKWrapPythonCommand.cxx')
-rw-r--r-- | Source/cmVTKWrapPythonCommand.cxx | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/Source/cmVTKWrapPythonCommand.cxx b/Source/cmVTKWrapPythonCommand.cxx index 4baf968..48c05ea 100644 --- a/Source/cmVTKWrapPythonCommand.cxx +++ b/Source/cmVTKWrapPythonCommand.cxx @@ -137,16 +137,6 @@ bool cmVTKWrapPythonCommand::CreateInitFile(std::string& res) { unsigned int i; - /* we have to make sure that the name is the correct case */ - std::string kitName = m_LibraryName; - if (kitName[0] > 90) kitName[0] -= 32; - for (i = 1; i < kitName.size(); i++) - { - if ((kitName[i] > 64)&&(kitName[i] < 91)) - { - kitName[i] += 32; - } - } std::vector<std::string> classes; int lastClass = m_WrapHeaders.size(); @@ -171,7 +161,7 @@ bool cmVTKWrapPythonCommand::CreateInitFile(std::string& res) m_Makefile->GetCurrentOutputDirectory(); outFileName += "/" + res; - return this->WriteInit(kitName.c_str(), outFileName, classes); + return this->WriteInit(m_LibraryName.c_str(), outFileName, classes); } @@ -207,15 +197,20 @@ bool cmVTKWrapPythonCommand::WriteInit(const char *kitName, #ifdef _WIN32 fprintf(fout,"extern \"C\" {__declspec( dllexport) void init%s();}\n\n",kitName); + fprintf(fout,"void init%s()\n{\n",kitName); #else - fprintf(fout,"extern \"C\" {void init%s();}\n\n",kitName); + fprintf(fout,"extern \"C\" {void initlib%s();}\n\n",kitName); + fprintf(fout,"void initlib%s()\n{\n",kitName); #endif /* module init function */ - fprintf(fout,"void init%s()\n{\n",kitName); fprintf(fout," PyObject *m, *d, *c;\n\n"); +#ifdef _WIN32 + fprintf(fout," static char modulename[] = \"lib%s\";\n",kitName); +#else fprintf(fout," static char modulename[] = \"%s\";\n",kitName); +#endif fprintf(fout," m = Py_InitModule(modulename, Py%s_ClassMethods);\n", kitName); |