cmLocalVisualStudioGenerator.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmLocalVisualStudioGenerator_h
  4. #define cmLocalVisualStudioGenerator_h
  5. #include "cmLocalGenerator.h"
  6. #include "cmGlobalVisualStudioGenerator.h"
  7. #include <cm_auto_ptr.hxx>
  8. class cmSourceFile;
  9. class cmSourceGroup;
  10. class cmCustomCommand;
  11. class cmCustomCommandGenerator;
  12. /** \class cmLocalVisualStudioGenerator
  13. * \brief Base class for Visual Studio generators.
  14. *
  15. * cmLocalVisualStudioGenerator provides functionality common to all
  16. * Visual Studio generators.
  17. */
  18. class cmLocalVisualStudioGenerator : public cmLocalGenerator
  19. {
  20. public:
  21. cmLocalVisualStudioGenerator(cmGlobalGenerator* gg, cmMakefile* mf);
  22. virtual ~cmLocalVisualStudioGenerator();
  23. /** Construct a script from the given list of command lines. */
  24. std::string ConstructScript(cmCustomCommandGenerator const& ccg,
  25. const std::string& newline = "\n");
  26. /** Label to which to jump in a batch file after a failed step in a
  27. sequence of custom commands. */
  28. const char* GetReportErrorLabel() const;
  29. cmGlobalVisualStudioGenerator::VSVersion GetVersion() const;
  30. virtual std::string ComputeLongestObjectDirectory(
  31. cmGeneratorTarget const*) const = 0;
  32. virtual void AddCMakeListsRules() = 0;
  33. virtual void ComputeObjectFilenames(
  34. std::map<cmSourceFile const*, std::string>& mapping,
  35. cmGeneratorTarget const* = 0);
  36. protected:
  37. virtual const char* ReportErrorLabel() const;
  38. virtual bool CustomCommandUseLocal() const { return false; }
  39. /** Construct a custom command to make exe import lib dir. */
  40. CM_AUTO_PTR<cmCustomCommand> MaybeCreateImplibDir(cmGeneratorTarget* target,
  41. const std::string& config,
  42. bool isFortran);
  43. };
  44. #endif