[Cmake-commits] [cmake-commits] hoffman committed cmGlobalVisualStudio71Generator.cxx 1.48 1.49 cmGlobalVisualStudio7Generator.cxx 1.99 1.100 cmGlobalVisualStudioGenerator.cxx 1.11 1.12 cmGlobalVisualStudioGenerator.h 1.7 1.8 cmLocalGenerator.cxx 1.273 1.274 cmLocalVisualStudio7Generator.cxx 1.223 1.224 cmLocalVisualStudio7Generator.h 1.50 1.51 cmMakefile.cxx 1.467 1.468

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Apr 30 13:26:08 EDT 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv23441

Modified Files:
	cmGlobalVisualStudio71Generator.cxx 
	cmGlobalVisualStudio7Generator.cxx 
	cmGlobalVisualStudioGenerator.cxx 
	cmGlobalVisualStudioGenerator.h cmLocalGenerator.cxx 
	cmLocalVisualStudio7Generator.cxx 
	cmLocalVisualStudio7Generator.h cmMakefile.cxx 
Log Message:
ENH: add support for Intel Fortran Visual studio IDE


Index: cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.223
retrieving revision 1.224
diff -C 2 -d -r1.223 -r1.224
*** cmLocalVisualStudio7Generator.cxx	17 Apr 2008 15:16:53 -0000	1.223
--- cmLocalVisualStudio7Generator.cxx	30 Apr 2008 17:26:03 -0000	1.224
***************
*** 69,72 ****
--- 69,73 ----
    lang.insert("IDL");
    lang.insert("DEF");
+   lang.insert("Fortran");
    this->CreateCustomTargetsAndCommands(lang);
    this->FixGlobalTargets();
***************
*** 201,204 ****
--- 202,208 ----
  ::CreateSingleVCProj(const char *lname, cmTarget &target)
  {
+   this->FortranProject =
+     static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator)
+     ->TargetIsFortranOnly(target);
    // add to the list of projects
    std::string pname = lname;
***************
*** 209,213 ****
    fname += "/";
    fname += lname;
!   fname += ".vcproj";
  
    // Generate the project file and replace it atomically with
--- 213,224 ----
    fname += "/";
    fname += lname;
!   if(this->FortranProject)
!     {
!     fname += ".vfproj";
!     }
!   else
!     {
!     fname += ".vcproj";
!     }
  
    // Generate the project file and replace it atomically with
***************
*** 287,291 ****
--- 298,356 ----
    fout << "\t</Configurations>\n";
  }
+ cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranFlagTable[] =
+ { 
+   {"Preprocess", "fpp", "Run Preprocessor on files", "preprocessYes", 0}, 
+   {"SuppressStartupBanner", "nologo", "SuppressStartupBanner", "true", 0},
+   {"DebugInformationFormat", "Zi", "full debug", "debugEnabled", 0},
+   {"DebugInformationFormat", "debug:full", "full debug", "debugEnabled", 0},
+   {"DebugInformationFormat", "Z7", "c7 compat", "debugOldStyleInfo", 0},
+   {"DebugInformationFormat", "Zd", "line numbers", "debugLineInfoOnly", 0},
+   {"Optimization", "Od", "disable optimization", "optimizeDisabled", 0},
+   {"Optimization", "O1", "min space", "optimizeMinSpace", 0},
+   {"Optimization", "O3", "full optimize", "optimizeFull", 0},
+   {"GlobalOptimizations", "Og", "global optimize", "true", 0},
+   {"InlineFunctionExpansion", "Ob0", "", "expandDisable", 0},
+   {"InlineFunctionExpansion", "Ob1", "", "expandOnlyInline", 0},
+   {"FavorSizeOrSpeed", "Os", "", "favorSize", 0},
+   {"OmitFramePointers", "Oy-", "", "false", 0},
+   {"OptimizeForProcessor", "GB", "", "procOptimizeBlended", 0},
+   {"OptimizeForProcessor", "G5", "", "procOptimizePentium", 0},
+   {"OptimizeForProcessor", "G6", "", "procOptimizePentiumProThruIII", 0},
+   {"UseProcessorExtensions", "QzxK", "", "codeForStreamingSIMD", 0},
+   {"OptimizeForProcessor", "QaxN", "", "codeForPentium4", 0},
+   {"OptimizeForProcessor", "QaxB", "", "codeForPentiumM", 0},
+   {"OptimizeForProcessor", "QaxP", "", "codeForCodeNamedPrescott", 0},
+   {"OptimizeForProcessor", "QaxT", "", "codeForCore2Duo", 0},
+   {"OptimizeForProcessor", "QxK", "", "codeExclusivelyStreamingSIMD", 0},
+   {"OptimizeForProcessor", "QxN", "", "codeExclusivelyPentium4", 0},
+   {"OptimizeForProcessor", "QxB", "", "codeExclusivelyPentiumM", 0},
+   {"OptimizeForProcessor", "QxP", "", "codeExclusivelyCodeNamedPrescott", 0},
+   {"OptimizeForProcessor", "QxT", "", "codeExclusivelyCore2Duo", 0},
+   {"OptimizeForProcessor", "QxO", "", "codeExclusivelyCore2StreamingSIMD", 0},
+   {"OptimizeForProcessor", "QxS", "", "codeExclusivelyCore2StreamingSIMD4", 0},
  
+   {"ModulePath", "module:", "", "", 
+    cmVS7FlagTable::UserValueRequired},
+   {"LoopUnrolling", "Qunroll:", "", "", 
+    cmVS7FlagTable::UserValueRequired},
+   {"AutoParallelThreshold", "Qpar-threshold:", "", "", 
+    cmVS7FlagTable::UserValueRequired},
+   {"HeapArrays", "heap-arrays:", "", "", 
+    cmVS7FlagTable::UserValueRequired},
+   {"ObjectText", "bintext:", "", "", 
+    cmVS7FlagTable::UserValueRequired},
+   {"Parallelization", "Qparallel", "", "true", 0},
+   {"PrefetchInsertion", "Qprefetch-", "", "false", 0},
+   {"BufferedIO", "assume:buffered_io", "", "true", 0},
+   {"CallingConvention", "iface:stdcall", "", "callConventionStdCall", 0},
+   {"CallingConvention", "iface:cref", "", "callConventionCRef", 0},
+   {"CallingConvention", "iface:stdref", "", "callConventionStdRef", 0},
+   {"CallingConvention", "iface:stdcall", "", "callConventionStdCall", 0},
+   {"CallingConvention", "iface:cvf", "", "callConventionCVF", 0},
+   {"EnableRecursion", "recursive", "", "true", 0},
+   {"ReentrantCode", "reentrancy", "", "true", 0},
+   // done up to Language
+   {0,0,0,0,0}
+ };
  // fill the table here currently the comment field is not used for
  // anything other than documentation NOTE: Make sure the longer
***************
*** 380,383 ****
--- 445,450 ----
  };
  
+ 
+ 
  cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] =
  {
***************
*** 405,409 ****
    {
      Compiler,
!     Linker
    };
    cmLocalVisualStudio7GeneratorOptions(cmLocalVisualStudio7Generator* lg,
--- 472,477 ----
    {
      Compiler,
!     Linker,
!     FortranCompiler
    };
    cmLocalVisualStudio7GeneratorOptions(cmLocalVisualStudio7Generator* lg,
***************
*** 486,496 ****
--- 554,567 ----
    // 10 == utility
    const char* configType = "10";
+   const char* projectType = 0;
    switch(target.GetType())
      {
      case cmTarget::STATIC_LIBRARY:
+       projectType = "typeStaticLibrary";
        configType = "4";
        break;
      case cmTarget::SHARED_LIBRARY:
      case cmTarget::MODULE_LIBRARY:
+       projectType = "typeDynamicLibrary";
        configType = "2";
        break;
***************
*** 504,508 ****
        break;
      }
! 
    std::string flags;
    if(strcmp(configType, "10") != 0)
--- 575,582 ----
        break;
      }
!   if(this->FortranProject && projectType)
!     {
!     configType = projectType;
!     }
    std::string flags;
    if(strcmp(configType, "10") != 0)
***************
*** 517,521 ****
        return;
        }
!     if(strcmp(linkLanguage, "C") == 0 || strcmp(linkLanguage, "CXX") == 0)
        {
        std::string baseFlagVar = "CMAKE_";
--- 591,596 ----
        return;
        }
!     if(strcmp(linkLanguage, "C") == 0 || strcmp(linkLanguage, "CXX") == 0
!       || strcmp(linkLanguage, "Fortran") == 0)
        {
        std::string baseFlagVar = "CMAKE_";
***************
*** 552,558 ****
    // Get preprocessor definitions for this directory.
    std::string defineFlags = this->Makefile->GetDefineFlags();
! 
!   // Construct a set of build options for this target.
!   Options targetOptions(this, this->Version, Options::Compiler, this->ExtraFlagTable);
    targetOptions.FixExceptionHandlingDefault();
    targetOptions.Parse(flags.c_str());
--- 627,636 ----
    // Get preprocessor definitions for this directory.
    std::string defineFlags = this->Makefile->GetDefineFlags();
!   Options::Tool t = Options::Compiler;
!   if(this->FortranProject)
!     {
!     t = Options::FortranCompiler;
!     }
!   Options targetOptions(this, this->Version, t, this->ExtraFlagTable);
    targetOptions.FixExceptionHandlingDefault();
    targetOptions.Parse(flags.c_str());
***************
*** 600,606 ****
      fout << "\t\t\tCharacterSet=\"2\">\n";
      }
! 
    fout << "\t\t\t<Tool\n"
!        << "\t\t\t\tName=\"VCCLCompilerTool\"\n";
    targetOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n");
    fout << "\t\t\t\tAdditionalIncludeDirectories=\"";
--- 678,706 ----
      fout << "\t\t\tCharacterSet=\"2\">\n";
      }
!   const char* tool = "VCCLCompilerTool";
!   if(this->FortranProject)
!     {
!     tool = "VFFortranCompilerTool";
!     }
    fout << "\t\t\t<Tool\n"
!        << "\t\t\t\tName=\"" << tool << "\"\n";
!   if(this->FortranProject)
!     {
!     const char* target_mod_dir =
!       target.GetProperty("Fortran_MODULE_DIRECTORY"); 
!     std::string modDir;
!     if(target_mod_dir)
!       {
!       modDir = this->Convert(target_mod_dir,
!                              cmLocalGenerator::START_OUTPUT,
!                              cmLocalGenerator::UNCHANGED);
!       }
!     else
!       {
!       modDir = ".";
!       }
!     fout << "\t\t\t\tModulePath=\"" 
!          << this->ConvertToXMLOutputPath(modDir.c_str()) << "\\$(ConfigurationName)\"\n";
!     }
    targetOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n");
    fout << "\t\t\t\tAdditionalIncludeDirectories=\"";
***************
*** 610,615 ****
--- 710,725 ----
    for(;i != includes.end(); ++i)
      {
+     // output the include path
      std::string ipath = this->ConvertToXMLOutputPath(i->c_str());
      fout << ipath << ";";
+     // if this is fortran then output the include with 
+     // a ConfigurationName on the end of it.
+     if(this->FortranProject)
+       {
+       ipath = i->c_str();
+       ipath += "/$(ConfigurationName)";
+       ipath = this->ConvertToXMLOutputPath(ipath.c_str());
+       fout << ipath << ";";
+       }
      }
    fout << "\"\n";
***************
*** 630,635 ****
      }
    fout << "/>\n";  // end of <Tool Name=VCCLCompilerTool
!   fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"/>\n";
!   fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n"
         << "\t\t\t\tAdditionalIncludeDirectories=\"";
    for(i = includes.begin();i != includes.end(); ++i)
--- 740,755 ----
      }
    fout << "/>\n";  // end of <Tool Name=VCCLCompilerTool
!   tool = "VCCustomBuildTool";
!   if(this->FortranProject)
!     {
!     tool = "VFCustomBuildTool";
!     }
!   fout << "\t\t\t<Tool\n\t\t\t\tName=\"" << tool << "\"/>\n";
!   tool = "VCResourceCompilerTool";
!   if(this->FortranProject)
!     {
!     tool = "VFResourceCompilerTool";
!     }
!   fout << "\t\t\t<Tool\n\t\t\t\tName=\"" << tool << "\"\n"
         << "\t\t\t\tAdditionalIncludeDirectories=\"";
    for(i = includes.begin();i != includes.end(); ++i)
***************
*** 642,647 ****
    targetOptions.OutputPreprocessorDefinitions(fout, "\n\t\t\t\t", "");
    fout << "/>\n";
! 
!   fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n";
    targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n");
    fout << "\t\t\t\tMkTypLibCompatible=\"FALSE\"\n";
--- 762,771 ----
    targetOptions.OutputPreprocessorDefinitions(fout, "\n\t\t\t\t", "");
    fout << "/>\n";
!   tool = "VCMIDLTool";
!   if(this->FortranProject)
!     {
!     tool = "VFMIDLTool";
!     }
!   fout << "\t\t\t<Tool\n\t\t\t\tName=\"" << tool << "\"\n";
    targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n");
    fout << "\t\t\t\tMkTypLibCompatible=\"FALSE\"\n";
***************
*** 676,681 ****
        // for FAT32 file systems, which can cause an empty manifest
        // to be embedded into the resulting executable.  See CMake
!       // bug #2617.
!       fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n"
             << "\t\t\t\tUseFAT32Workaround=\"true\"\n"
             << "\t\t\t/>\n";
--- 800,810 ----
        // for FAT32 file systems, which can cause an empty manifest
        // to be embedded into the resulting executable.  See CMake
!       // bug #2617. 
!       const char* tool  = "VCManifestTool";
!       if(this->FortranProject)
!         {
!         tool = "VFManifestTool";
!         }
!       fout << "\t\t\t<Tool\n\t\t\t\tName=\"" << tool << "\"\n"
             << "\t\t\t\tUseFAT32Workaround=\"true\"\n"
             << "\t\t\t/>\n";
***************
*** 758,763 ****
      libpath += "/";
      libpath += targetNameFull;
      fout << "\t\t\t<Tool\n"
!          << "\t\t\t\tName=\"VCLibrarianTool\"\n";
      if(const char* libflags = target.GetProperty("STATIC_LIBRARY_FLAGS"))
        {
--- 887,897 ----
      libpath += "/";
      libpath += targetNameFull;
+     const char* tool = "VCLibrarianTool";
+     if(this->FortranProject)
+       {
+       tool = "VFLibrarianTool";
+       }
      fout << "\t\t\t<Tool\n"
!          << "\t\t\t\tName=\"" << tool << "\"\n";
      if(const char* libflags = target.GetProperty("STATIC_LIBRARY_FLAGS"))
        {
***************
*** 793,799 ****
      standardLibsVar += linkLanguage;
      standardLibsVar += "_STANDARD_LIBRARIES";
! 
      fout << "\t\t\t<Tool\n"
!          << "\t\t\t\tName=\"VCLinkerTool\"\n";
      linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n");
      // Use the NOINHERIT macro to avoid getting VS project default
--- 927,937 ----
      standardLibsVar += linkLanguage;
      standardLibsVar += "_STANDARD_LIBRARIES";
!     const char* tool = "VCLinkerTool";
!     if(this->FortranProject)
!       {
!       tool = "VFLinkerTool";
!       }
      fout << "\t\t\t<Tool\n"
!          << "\t\t\t\tName=\"" << tool << "\"\n";
      linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n");
      // Use the NOINHERIT macro to avoid getting VS project default
***************
*** 862,868 ****
      standardLibsVar += linkLanguage;
      standardLibsVar += "_STANDARD_LIBRARIES";
! 
      fout << "\t\t\t<Tool\n"
!          << "\t\t\t\tName=\"VCLinkerTool\"\n";
      linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n");
      // Use the NOINHERIT macro to avoid getting VS project default
--- 1000,1010 ----
      standardLibsVar += linkLanguage;
      standardLibsVar += "_STANDARD_LIBRARIES";
!     const char* tool = "VCLinkerTool";
!     if(this->FortranProject)
!       {
!       tool = "VFLinkerTool";
!       }
      fout << "\t\t\t<Tool\n"
!          << "\t\t\t\tName=\"" << tool << "\"\n";
      linkOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n");
      // Use the NOINHERIT macro to avoid getting VS project default
***************
*** 1264,1275 ****
            {
            aCompilerTool = "VCMIDLTool";
            }
          if(ext == "rc")
            {
!           aCompilerTool = "VCResourceCompilerTool";
            }
          if(ext == "def")
            {
            aCompilerTool = "VCCustomBuildTool";
            }
          for(std::map<cmStdString, cmLVS7GFileConfig>::const_iterator
--- 1406,1429 ----
            {
            aCompilerTool = "VCMIDLTool";
+           if(this->FortranProject)
+             {
+             aCompilerTool = "VFMIDLTool";
+             }
            }
          if(ext == "rc")
            {
!           aCompilerTool = "VCResourceCompilerTool";  
!           if(this->FortranProject)
!             {
!             aCompilerTool = "VFResourceCompilerTool";
!             }
            }
          if(ext == "def")
            {
            aCompilerTool = "VCCustomBuildTool";
+           if(this->FortranProject)
+             {
+             aCompilerTool = "VFCustomBuildTool";
+             }
            }
          for(std::map<cmStdString, cmLVS7GFileConfig>::const_iterator
***************
*** 1347,1351 ****
      static_cast<cmGlobalVisualStudio7Generator *>
      (this->GlobalGenerator)->GetConfigurations();
! 
    for(i = configs->begin(); i != configs->end(); ++i)
      {
--- 1501,1514 ----
      static_cast<cmGlobalVisualStudio7Generator *>
      (this->GlobalGenerator)->GetConfigurations();
!   const char* compileTool = "VCCLCompilerTool";
!   if(this->FortranProject)
!     {
!     compileTool = "VFCLCompilerTool";
!     }
!   const char* customTool = "VCCustomBuildTool";
!   if(this->FortranProject)
!     {
!     customTool = "VFCustomBuildTool";
!     }
    for(i = configs->begin(); i != configs->end(); ++i)
      {
***************
*** 1356,1360 ****
        {
        fout << "\t\t\t\t\t<Tool\n"
!            << "\t\t\t\t\tName=\"VCCLCompilerTool\"\n"
             << "\t\t\t\t\tAdditionalOptions=\""
             << this->EscapeForXML(fc.CompileFlags.c_str()) << "\"/>\n";
--- 1519,1523 ----
        {
        fout << "\t\t\t\t\t<Tool\n"
!            << "\t\t\t\t\tName=\"" << compileTool << "\"\n"
             << "\t\t\t\t\tAdditionalOptions=\""
             << this->EscapeForXML(fc.CompileFlags.c_str()) << "\"/>\n";
***************
*** 1368,1372 ****
                              command.GetEscapeAllowMakeVars());
      fout << "\t\t\t\t\t<Tool\n"
!          << "\t\t\t\t\tName=\"VCCustomBuildTool\"\n"
           << "\t\t\t\t\tDescription=\"" 
           << this->EscapeForXML(comment.c_str()) << "\"\n"
--- 1531,1535 ----
                              command.GetEscapeAllowMakeVars());
      fout << "\t\t\t\t\t<Tool\n"
!          << "\t\t\t\t\tName=\"" << customTool << "\"\n"
           << "\t\t\t\t\tDescription=\"" 
           << this->EscapeForXML(comment.c_str()) << "\"\n"
***************
*** 1451,1457 ****
      return;
      }
! 
    // add the pre build rules
!   fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"";
    bool init = false;
    for (std::vector<cmCustomCommand>::const_iterator cr =
--- 1614,1624 ----
      return;
      }
!   const char* tool = "VCPreBuildEventTool";
!   if(this->FortranProject)
!     {
!     tool = "VFPreBuildEventTool";
!     }
    // add the pre build rules
!   fout << "\t\t\t<Tool\n\t\t\t\tName=\"" << tool << "\"";
    bool init = false;
    for (std::vector<cmCustomCommand>::const_iterator cr =
***************
*** 1489,1493 ****
  
    // add the pre Link rules
!   fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"";
    init = false;
    for (std::vector<cmCustomCommand>::const_iterator cr =
--- 1656,1665 ----
  
    // add the pre Link rules
!   tool = "VCPreLinkEventTool";
!   if(this->FortranProject)
!     {
!     tool = "VFPreLinkEventTool";
!     }
!   fout << "\t\t\t<Tool\n\t\t\t\tName=\"" << tool << "\"";
    init = false;
    for (std::vector<cmCustomCommand>::const_iterator cr =
***************
*** 1525,1529 ****
  
    // add the PostBuild rules
!   fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"";
    init = false;
    for (std::vector<cmCustomCommand>::const_iterator cr =
--- 1697,1706 ----
  
    // add the PostBuild rules
!   tool = "VCPostBuildEventTool";
!   if(this->FortranProject)
!     {
!     tool = "VFPostBuildEventTool";
!     }
!   fout << "\t\t\t<Tool\n\t\t\t\tName=\"" << tool << "\"";
    init = false;
    for (std::vector<cmCustomCommand>::const_iterator cr =
***************
*** 1562,1565 ****
--- 1739,1802 ----
  
  void
+ cmLocalVisualStudio7Generator
+ ::WriteProjectStartFortran(std::ostream& fout,
+                            const char *libName,
+                            cmTarget & target)
+ {
+   
+   cmGlobalVisualStudio7Generator* gg =
+     static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator);
+   fout << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n"
+        << "<VisualStudioProject\n"
+        << "\tProjectCreator=\"Intel Fortran\"\n"
+        << "\tVersion=\"9.10\"\n";
+   const char* keyword = target.GetProperty("VS_KEYWORD");
+   if(!keyword)
+     {
+     keyword = "Console Application";
+     } 
+   const char* projectType = 0;
+   switch(target.GetType())
+     {
+     case cmTarget::STATIC_LIBRARY:
+       projectType = "typeStaticLibrary";
+       if(keyword)
+         {
+         keyword = "Static Library";
+         }
+       break;
+     case cmTarget::SHARED_LIBRARY:
+     case cmTarget::MODULE_LIBRARY:
+       projectType = "typeDynamicLibrary";
+       if(!keyword)
+         {
+         keyword = "Dll";
+         }
+       break;
+     case cmTarget::EXECUTABLE:
+       if(!keyword)
+         {
+         keyword = "Console Application";
+         }
+       projectType = 0;
+       break;
+     case cmTarget::UTILITY:
+     case cmTarget::GLOBAL_TARGET:
+     default:
+       break;
+     }
+   if(projectType)
+     {
+     fout << "\tProjectType=\"" << projectType << "\">\n";
+     }
+   fout<< "\tKeyword=\"" << keyword << "\">\n" 
+        << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\">\n"
+        << "\t<Platforms>\n"
+        << "\t\t<Platform\n\t\t\tName=\"" << this->PlatformName << "\"/>\n"
+        << "\t</Platforms>\n";
+ }
+ 
+ 
+ void
  cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
                                                   const char *libName,
***************
*** 1567,1570 ****
--- 1804,1812 ----
                                                   std::vector<cmSourceGroup> &)
  {
+   if(this->FortranProject)
+     {
+     this->WriteProjectStartFortran(fout, libName, target);
+     return;
+     }
    fout << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n"
         << "<VisualStudioProject\n"
***************
*** 1778,1781 ****
--- 2020,2025 ----
      case Linker:
        this->FlagTable = cmLocalVisualStudio7GeneratorLinkFlagTable; break;
+     case FortranCompiler:
+       this->FlagTable = cmLocalVisualStudio7GeneratorFortranFlagTable;
      default: break;
      }

Index: cmLocalVisualStudio7Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.h,v
retrieving revision 1.50
retrieving revision 1.51
diff -C 2 -d -r1.50 -r1.51
*** cmLocalVisualStudio7Generator.h	30 Jan 2008 17:04:38 -0000	1.50
--- cmLocalVisualStudio7Generator.h	30 Apr 2008 17:26:03 -0000	1.51
***************
*** 103,106 ****
--- 103,108 ----
    void WriteProjectStart(std::ostream& fout, const char *libName,
                           cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
+   void WriteProjectStartFortran(std::ostream& fout, const char *libName,
+                                 cmTarget &tgt);
    void WriteVCProjBeginGroup(std::ostream& fout, 
                            const char* group,
***************
*** 125,128 ****
--- 127,131 ----
    std::string ModuleDefinitionFile;
    int Version;
+   bool FortranProject;
    std::string PlatformName; // Win32 or x64 
    cmLocalVisualStudio7GeneratorInternals* Internal;

Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.273
retrieving revision 1.274
diff -C 2 -d -r1.273 -r1.274
*** cmLocalGenerator.cxx	29 Apr 2008 19:34:35 -0000	1.273
--- cmLocalGenerator.cxx	30 Apr 2008 17:26:03 -0000	1.274
***************
*** 2617,2621 ****
      {
      cmsysSystem_Shell_GetArgumentForUnix(str, &arg[0], flags);
!     }
    return std::string(&arg[0]);
  }
--- 2617,2621 ----
      {
      cmsysSystem_Shell_GetArgumentForUnix(str, &arg[0], flags);
!     }  
    return std::string(&arg[0]);
  }

Index: cmGlobalVisualStudio71Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio71Generator.cxx,v
retrieving revision 1.48
retrieving revision 1.49
diff -C 2 -d -r1.48 -r1.49
*** cmGlobalVisualStudio71Generator.cxx	15 Feb 2008 16:49:58 -0000	1.48
--- cmGlobalVisualStudio71Generator.cxx	30 Apr 2008 17:26:02 -0000	1.49
***************
*** 154,161 ****
                                                cmTarget& t)
  {
!   fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" 
         << dspname << "\", \""
         << this->ConvertToSolutionPath(dir)
!        << "\\" << dspname << ".vcproj\", \"{"
         << this->GetGUID(dspname) << "}\"\n";
    fout << "\tProjectSection(ProjectDependencies) = postProject\n";
--- 154,170 ----
                                                cmTarget& t)
  {
!   // check to see if this is a fortran build
!   const char* ext = ".vcproj";
!   const char* project = "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"";
!   if(this->TargetIsFortranOnly(t))
!     {
!     ext = ".vfproj"; 
!     project = "Project(\"{6989167D-11E4-40FE-8C1A-2192A86A7E90}\") = \"";
!     }
!   
!   fout << project
         << dspname << "\", \""
         << this->ConvertToSolutionPath(dir)
!        << "\\" << dspname << ext << "\", \"{"
         << this->GetGUID(dspname) << "}\"\n";
    fout << "\tProjectSection(ProjectDependencies) = postProject\n";

Index: cmGlobalVisualStudioGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudioGenerator.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C 2 -d -r1.7 -r1.8
*** cmGlobalVisualStudioGenerator.h	15 Feb 2008 16:49:58 -0000	1.7
--- cmGlobalVisualStudioGenerator.h	30 Apr 2008 17:26:03 -0000	1.8
***************
*** 64,67 ****
--- 64,70 ----
    virtual void CallVisualStudioMacro(MacroName m,
                                       const char* vsSolutionFile = 0);
+   
+   // return true if target is fortran only
+   bool TargetIsFortranOnly(cmTarget& t);
  
  protected:

Index: cmGlobalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.cxx,v
retrieving revision 1.99
retrieving revision 1.100
diff -C 2 -d -r1.99 -r1.100
*** cmGlobalVisualStudio7Generator.cxx	4 Feb 2008 21:05:00 -0000	1.99
--- cmGlobalVisualStudio7Generator.cxx	30 Apr 2008 17:26:02 -0000	1.100
***************
*** 36,40 ****
    mf->AddDefinition("CMAKE_GENERATOR_RC", "rc");
    mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
!   mf->AddDefinition("CMAKE_GENERATOR_Fortran", "ifort");
  
    this->AddPlatformDefinitions(mf);
--- 36,40 ----
    mf->AddDefinition("CMAKE_GENERATOR_RC", "rc");
    mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
!   mf->AddDefinition("CMAKE_GENERATOR_FC", "ifort");
  
    this->AddPlatformDefinitions(mf);
***************
*** 483,492 ****
  void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout, 
                                 const char* dspname,
!                                const char* dir, cmTarget&)
! {
!   fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" 
         << dspname << "\", \""
         << this->ConvertToSolutionPath(dir)
!        << "\\" << dspname << ".vcproj\", \"{"
         << this->GetGUID(dspname) << "}\"\nEndProject\n";
  }
--- 483,501 ----
  void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout, 
                                 const char* dspname,
!                                const char* dir, cmTarget& target)
! { 
!    // check to see if this is a fortran build
!   const char* ext = ".vcproj";
!   const char* project = "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"";
!   if(this->TargetIsFortranOnly(target))
!     {
!     ext = ".vfproj";
!     project = "Project(\"{6989167D-11E4-40FE-8C1A-2192A86A7E90}\") = \"";
!     }
! 
!   fout << project
         << dspname << "\", \""
         << this->ConvertToSolutionPath(dir)
!        << "\\" << dspname << ext << "\", \"{"
         << this->GetGUID(dspname) << "}\"\nEndProject\n";
  }

Index: cmGlobalVisualStudioGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudioGenerator.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -C 2 -d -r1.11 -r1.12
*** cmGlobalVisualStudioGenerator.cxx	15 Feb 2008 16:49:58 -0000	1.11
--- cmGlobalVisualStudioGenerator.cxx	30 Apr 2008 17:26:02 -0000	1.12
***************
*** 705,706 ****
--- 705,721 ----
      }
  }
+ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(cmTarget& target)
+ {
+   // check to see if this is a fortran build
+   std::set<cmStdString> languages;
+   target.GetLanguages(languages);
+   const char* ext = ".vcproj";
+   if(languages.size() == 1)
+     {
+     if(*languages.begin() == "Fortran")
+       {
+       return true;
+       }
+     }
+   return false;
+ }

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.467
retrieving revision 1.468
diff -C 2 -d -r1.467 -r1.468
*** cmMakefile.cxx	29 Apr 2008 18:17:28 -0000	1.467
--- cmMakefile.cxx	30 Apr 2008 17:26:04 -0000	1.468
***************
*** 84,88 ****
    this->AddSourceGroup
      ("Source Files",
!      "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|m|mm|rc|def|r|odl|idl|hpj|bat)$");
    this->AddSourceGroup("Header Files",
                         "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$");
--- 84,88 ----
    this->AddSourceGroup
      ("Source Files",
!      "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|f|f90|for|fpp|ftn|m|mm|rc|def|r|odl|idl|hpj|bat)$");
    this->AddSourceGroup("Header Files",
                         "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$");



More information about the Cmake-commits mailing list