cmLocalVisualStudioGenerator.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 cmLocalVisualStudioGenerator_h
  11. #define cmLocalVisualStudioGenerator_h
  12. #include "cmLocalGenerator.h"
  13. #include <cmsys/auto_ptr.hxx>
  14. class cmSourceFile;
  15. class cmSourceGroup;
  16. class cmCustomCommand;
  17. class cmCustomCommandGenerator;
  18. /** \class cmLocalVisualStudioGenerator
  19. * \brief Base class for Visual Studio generators.
  20. *
  21. * cmLocalVisualStudioGenerator provides functionality common to all
  22. * Visual Studio generators.
  23. */
  24. class cmLocalVisualStudioGenerator : public cmLocalGenerator
  25. {
  26. public:
  27. /** Known versions of Visual Studio. */
  28. enum VSVersion
  29. {
  30. VS6 = 60,
  31. VS7 = 70,
  32. VS71 = 71,
  33. VS8 = 80,
  34. VS9 = 90,
  35. VS10 = 100,
  36. VS11 = 110,
  37. VS12 = 120
  38. };
  39. cmLocalVisualStudioGenerator(VSVersion v);
  40. virtual ~cmLocalVisualStudioGenerator();
  41. /** Construct a script from the given list of command lines. */
  42. std::string ConstructScript(cmCustomCommandGenerator const& ccg,
  43. const std::string& newline = "\n");
  44. /** Label to which to jump in a batch file after a failed step in a
  45. sequence of custom commands. */
  46. const char* GetReportErrorLabel() const;
  47. /** Version of Visual Studio. */
  48. VSVersion GetVersion() const { return this->Version; }
  49. virtual std::string ComputeLongestObjectDirectory(cmTarget&) const = 0;
  50. virtual void AddCMakeListsRules() = 0;
  51. virtual void ComputeObjectFilenames(
  52. std::map<cmSourceFile const*, std::string>& mapping,
  53. cmGeneratorTarget const* = 0);
  54. protected:
  55. virtual const char* ReportErrorLabel() const;
  56. virtual bool CustomCommandUseLocal() const { return false; }
  57. /** Construct a custom command to make exe import lib dir. */
  58. cmsys::auto_ptr<cmCustomCommand>
  59. MaybeCreateImplibDir(cmTarget& target, const std::string& config,
  60. bool isFortran);
  61. VSVersion Version;
  62. };
  63. #endif