fixing OutputFile in *.vcproj files
[reactos.git] / reactos / tools / rbuild / backend / msvc / msvc.cpp
index 04dca4e..e270911 100644 (file)
@@ -2,6 +2,7 @@
  * Copyright (C) 2005 Trevor McCort\r
  * Copyright (C) 2005 Casper S. Hornstrup\r
  * Copyright (C) 2005 Steven Edwards\r
+ * Copyright (C) 2005 Royce Mitchell\r
  *\r
  * This program is free software; you can redistribute it and/or modify\r
  * it under the terms of the GNU General Public License as published by\r
@@ -30,8 +31,6 @@
 \r
 using namespace std;\r
 \r
-void gen_guid();\r
-\r
 static class MSVCFactory : public Backend::Factory\r
 {\r
        public:\r
@@ -54,35 +53,28 @@ MSVCBackend::MSVCBackend(Project &project,
 \r
 void MSVCBackend::Process()\r
 {\r
-       string filename_dsw = ProjectNode.name + ".dsw";\r
-       string filename_sln = ProjectNode.name + ".sln";\r
-       \r
-       printf ( "Creating MSVC workspace: %s\n", filename_dsw.c_str() );\r
+       string filename_sln ( ProjectNode.name );\r
+       if ( configuration.VSProjectVersion == "6.00" )\r
+               filename_sln += ".dsw";\r
+       else\r
+               filename_sln += ".sln";\r
        printf ( "Creating MSVC workspace: %s\n", filename_sln.c_str() );\r
-\r
+       \r
        ProcessModules();\r
-\r
-       m_dswFile = fopen ( filename_dsw.c_str(), "wb" );\r
        m_slnFile = fopen ( filename_sln.c_str(), "wb" );\r
 \r
-       if ( !m_dswFile )\r
-       {\r
-               printf ( "Could not create file '%s'.\n", filename_dsw.c_str() );\r
-               return;\r
-       }\r
-       _generate_wine_dsw ( m_dswFile );\r
-\r
-\r
        if ( !m_slnFile )\r
        {\r
                printf ( "Could not create file '%s'.\n", filename_sln.c_str() );\r
                return;\r
        }\r
-       _generate_sln ( m_slnFile );\r
 \r
-       fclose ( m_dswFile );\r
-       fclose ( m_slnFile );\r
+       if ( configuration.VSProjectVersion == "6.00" )\r
+               _generate_wine_dsw ( m_slnFile );\r
+       else\r
+               _generate_sln ( m_slnFile );\r
 \r
+       fclose ( m_slnFile );\r
        printf ( "Done.\n" );\r
 }\r
 \r
@@ -92,9 +84,13 @@ void MSVCBackend::ProcessModules()
        {\r
                Module &module = *ProjectNode.modules[i];\r
 \r
-               this->_generate_dsp ( module );\r
-               this->_generate_vcproj ( module );\r
-//             gen_guid();\r
+               module.guid = _gen_guid();\r
+\r
+               if (configuration.VSProjectVersion == "6.00")\r
+                       this->_generate_dsp ( module );\r
+               else\r
+                       this->_generate_vcproj ( module );\r
+\r
 \r
                /*for(size_t k = 0; k < module.non_if_data.files.size(); k++)\r
                {\r