cmGlobalVisualStudioGenerator.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmGlobalVisualStudioGenerator_h
  11. #define cmGlobalVisualStudioGenerator_h
  12. #include "cmGlobalGenerator.h"
  13. /** \class cmGlobalVisualStudioGenerator
  14. * \brief Base class for global Visual Studio generators.
  15. *
  16. * cmGlobalVisualStudioGenerator provides functionality common to all
  17. * global Visual Studio generators.
  18. */
  19. class cmGlobalVisualStudioGenerator : public cmGlobalGenerator
  20. {
  21. public:
  22. cmGlobalVisualStudioGenerator();
  23. virtual ~cmGlobalVisualStudioGenerator();
  24. /**
  25. * Basic generate implementation for all VS generators.
  26. */
  27. virtual void Generate();
  28. /**
  29. * Configure CMake's Visual Studio macros file into the user's Visual
  30. * Studio macros directory.
  31. */
  32. virtual void ConfigureCMakeVisualStudioMacros();
  33. /**
  34. * Where does this version of Visual Studio look for macros for the
  35. * current user? Returns the empty string if this version of Visual
  36. * Studio does not implement support for VB macros.
  37. */
  38. virtual std::string GetUserMacrosDirectory();
  39. /**
  40. * What is the reg key path to "vsmacros" for this version of Visual
  41. * Studio?
  42. */
  43. virtual std::string GetUserMacrosRegKeyBase();
  44. enum MacroName {MacroReload, MacroStop};
  45. /**
  46. * Call the ReloadProjects macro if necessary based on
  47. * GetFilesReplacedDuringGenerate results.
  48. */
  49. virtual void CallVisualStudioMacro(MacroName m,
  50. const char* vsSolutionFile = 0);
  51. // return true if target is fortran only
  52. bool TargetIsFortranOnly(cmTarget& t);
  53. const char* GetUtilityForTarget(cmTarget& target, const char*);
  54. /** Get the top-level registry key for this VS version. */
  55. std::string GetRegistryBase();
  56. protected:
  57. void FixUtilityDepends();
  58. // Does this VS version link targets to each other if there are
  59. // dependencies in the SLN file? This was done for VS versions
  60. // below 8.
  61. virtual bool VSLinksDependencies() const { return true; }
  62. virtual const char* GetIDEVersion() = 0;
  63. struct TargetCompare
  64. {
  65. bool operator()(cmTarget const* l, cmTarget const* r) const;
  66. };
  67. class OrderedTargetDependSet: public std::multiset<cmTarget*, TargetCompare>
  68. {
  69. public:
  70. OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const&);
  71. };
  72. virtual void GetTargetSets(TargetDependSet& projectTargets,
  73. TargetDependSet& originalTargets,
  74. cmLocalGenerator* root, GeneratorVector const&);
  75. bool CheckTargetLinks(cmTarget& target, const char* name);
  76. private:
  77. void FixUtilityDependsForTarget(cmTarget& target);
  78. void CreateUtilityDependTarget(cmTarget& target);
  79. };
  80. #endif