cmLocalVisualStudioGenerator.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 "cmGlobalVisualStudioGenerator.h"
  14. #include <cmsys/auto_ptr.hxx>
  15. class cmSourceFile;
  16. class cmSourceGroup;
  17. class cmCustomCommand;
  18. class cmCustomCommandGenerator;
  19. /** \class cmLocalVisualStudioGenerator
  20. * \brief Base class for Visual Studio generators.
  21. *
  22. * cmLocalVisualStudioGenerator provides functionality common to all
  23. * Visual Studio generators.
  24. */
  25. class cmLocalVisualStudioGenerator : public cmLocalGenerator
  26. {
  27. public:
  28. cmLocalVisualStudioGenerator(cmGlobalGenerator* gg,
  29. cmLocalGenerator* parent,
  30. cmState::Snapshot snapshot);
  31. virtual ~cmLocalVisualStudioGenerator();
  32. /** Construct a script from the given list of command lines. */
  33. std::string ConstructScript(cmCustomCommandGenerator const& ccg,
  34. const std::string& newline = "\n");
  35. /** Label to which to jump in a batch file after a failed step in a
  36. sequence of custom commands. */
  37. const char* GetReportErrorLabel() const;
  38. cmGlobalVisualStudioGenerator::VSVersion GetVersion() const;
  39. virtual std::string ComputeLongestObjectDirectory(cmTarget&) const = 0;
  40. virtual void AddCMakeListsRules() = 0;
  41. virtual void ComputeObjectFilenames(
  42. std::map<cmSourceFile const*, std::string>& mapping,
  43. cmGeneratorTarget const* = 0);
  44. protected:
  45. virtual const char* ReportErrorLabel() const;
  46. virtual bool CustomCommandUseLocal() const { return false; }
  47. /** Construct a custom command to make exe import lib dir. */
  48. cmsys::auto_ptr<cmCustomCommand>
  49. MaybeCreateImplibDir(cmTarget& target, const std::string& config,
  50. bool isFortran);
  51. };
  52. #endif