cmLocalVisualStudioGenerator.h 2.3 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. };
  37. cmLocalVisualStudioGenerator(VSVersion v);
  38. virtual ~cmLocalVisualStudioGenerator();
  39. /** Construct a script from the given list of command lines. */
  40. std::string ConstructScript(cmCustomCommand const& cc,
  41. const char* configName,
  42. const char* newline = "\n");
  43. /** Label to which to jump in a batch file after a failed step in a
  44. sequence of custom commands. */
  45. const char* GetReportErrorLabel() const;
  46. /** Version of Visual Studio. */
  47. VSVersion GetVersion() const { return this->Version; }
  48. protected:
  49. virtual const char* ReportErrorLabel() const;
  50. virtual bool CustomCommandUseLocal() const { return false; }
  51. /** Construct a custom command to make exe import lib dir. */
  52. cmsys::auto_ptr<cmCustomCommand>
  53. MaybeCreateImplibDir(cmTarget& target, const char* config, bool isFortran);
  54. // Safe object file name generation.
  55. void ComputeObjectNameRequirements(std::vector<cmSourceFile*> const&);
  56. bool SourceFileCompiles(const cmSourceFile* sf);
  57. std::set<const cmSourceFile*> NeedObjectName;
  58. friend class cmVisualStudio10TargetGenerator;
  59. VSVersion Version;
  60. };
  61. #endif