cmGlobalVisualStudioGenerator.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmGlobalVisualStudioGenerator_h
  14. #define cmGlobalVisualStudioGenerator_h
  15. #include "cmGlobalGenerator.h"
  16. /** \class cmGlobalVisualStudioGenerator
  17. * \brief Base class for global Visual Studio generators.
  18. *
  19. * cmGlobalVisualStudioGenerator provides functionality common to all
  20. * global Visual Studio generators.
  21. */
  22. class cmGlobalVisualStudioGenerator : public cmGlobalGenerator
  23. {
  24. public:
  25. cmGlobalVisualStudioGenerator();
  26. virtual ~cmGlobalVisualStudioGenerator();
  27. /**
  28. * Basic generate implementation for all VS generators.
  29. */
  30. virtual void Generate();
  31. /**
  32. * Configure CMake's Visual Studio macros file into the user's Visual
  33. * Studio macros directory.
  34. */
  35. virtual void ConfigureCMakeVisualStudioMacros();
  36. /**
  37. * Where does this version of Visual Studio look for macros for the
  38. * current user? Returns the empty string if this version of Visual
  39. * Studio does not implement support for VB macros.
  40. */
  41. virtual std::string GetUserMacrosDirectory();
  42. /**
  43. * What is the reg key path to "vsmacros" for this version of Visual
  44. * Studio?
  45. */
  46. virtual std::string GetUserMacrosRegKeyBase();
  47. enum MacroName {MacroReload, MacroStop};
  48. /**
  49. * Call the ReloadProjects macro if necessary based on
  50. * GetFilesReplacedDuringGenerate results.
  51. */
  52. virtual void CallVisualStudioMacro(MacroName m,
  53. const char* vsSolutionFile = 0);
  54. // return true if target is fortran only
  55. bool TargetIsFortranOnly(cmTarget& t);
  56. const char* GetUtilityForTarget(cmTarget& target, const char*);
  57. protected:
  58. virtual void CreateGUID(const char*) {}
  59. void FixUtilityDepends();
  60. // Does this VS version link targets to each other if there are
  61. // dependencies in the SLN file? This was done for VS versions
  62. // below 8.
  63. virtual bool VSLinksDependencies() const { return true; }
  64. private:
  65. void FixUtilityDependsForTarget(cmTarget& target);
  66. void CreateUtilityDependTarget(cmTarget& target);
  67. bool CheckTargetLinks(cmTarget& target, const char* name);
  68. };
  69. #endif