cmLocalVisualStudioGenerator.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 cmLocalVisualStudioGenerator
  18. * \brief Base class for Visual Studio generators.
  19. *
  20. * cmLocalVisualStudioGenerator provides functionality common to all
  21. * Visual Studio generators.
  22. */
  23. class cmLocalVisualStudioGenerator : public cmLocalGenerator
  24. {
  25. public:
  26. /** Known versions of Visual Studio. */
  27. enum VSVersion
  28. {
  29. VS6 = 60,
  30. VS7 = 70,
  31. VS71 = 71,
  32. VS8 = 80,
  33. VS9 = 90,
  34. VS10 = 100,
  35. VS11 = 110,
  36. VS12 = 120
  37. };
  38. cmLocalVisualStudioGenerator(VSVersion v);
  39. virtual ~cmLocalVisualStudioGenerator();
  40. /** Construct a script from the given list of command lines. */
  41. std::string ConstructScript(cmCustomCommand const& cc,
  42. const std::string& configName,
  43. const char* 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. protected:
  52. virtual const char* ReportErrorLabel() const;
  53. virtual bool CustomCommandUseLocal() const { return false; }
  54. /** Construct a custom command to make exe import lib dir. */
  55. cmsys::auto_ptr<cmCustomCommand>
  56. MaybeCreateImplibDir(cmTarget& target, const std::string& config,
  57. bool isFortran);
  58. VSVersion Version;
  59. };
  60. #endif