cmLocalVisualStudioGenerator.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. /* VS13 = 130 was skipped */
  39. VS14 = 140
  40. };
  41. cmLocalVisualStudioGenerator(VSVersion v);
  42. virtual ~cmLocalVisualStudioGenerator();
  43. /** Construct a script from the given list of command lines. */
  44. std::string ConstructScript(cmCustomCommandGenerator const& ccg,
  45. const std::string& newline = "\n");
  46. /** Label to which to jump in a batch file after a failed step in a
  47. sequence of custom commands. */
  48. const char* GetReportErrorLabel() const;
  49. /** Version of Visual Studio. */
  50. VSVersion GetVersion() const { return this->Version; }
  51. virtual std::string ComputeLongestObjectDirectory(cmTarget&) const = 0;
  52. virtual void AddCMakeListsRules() = 0;
  53. virtual void ComputeObjectFilenames(
  54. std::map<cmSourceFile const*, std::string>& mapping,
  55. cmGeneratorTarget const* = 0);
  56. protected:
  57. virtual const char* ReportErrorLabel() const;
  58. virtual bool CustomCommandUseLocal() const { return false; }
  59. /** Construct a custom command to make exe import lib dir. */
  60. cmsys::auto_ptr<cmCustomCommand>
  61. MaybeCreateImplibDir(cmTarget& target, const std::string& config,
  62. bool isFortran);
  63. VSVersion Version;
  64. };
  65. #endif