cmLocalVisualStudioGenerator.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. cmLocalVisualStudioGenerator();
  27. virtual ~cmLocalVisualStudioGenerator();
  28. /** Construct a script from the given list of command lines. */
  29. std::string ConstructScript(cmCustomCommand const& cc,
  30. const char* configName,
  31. const char* newline = "\n");
  32. /** Label to which to jump in a batch file after a failed step in a
  33. sequence of custom commands. */
  34. const char* GetReportErrorLabel() const;
  35. protected:
  36. virtual const char* ReportErrorLabel() const;
  37. virtual bool CustomCommandUseLocal() const { return false; }
  38. /** Construct a custom command to make exe import lib dir. */
  39. cmsys::auto_ptr<cmCustomCommand>
  40. MaybeCreateImplibDir(cmTarget& target, const char* config, bool isFortran);
  41. // Safe object file name generation.
  42. void ComputeObjectNameRequirements(std::vector<cmSourceGroup> const&);
  43. bool SourceFileCompiles(const cmSourceFile* sf);
  44. void CountObjectNames(const std::vector<cmSourceGroup>& groups,
  45. std::map<cmStdString, int>& count);
  46. void InsertNeedObjectNames(const std::vector<cmSourceGroup>& groups,
  47. std::map<cmStdString, int>& count);
  48. std::set<const cmSourceFile*> NeedObjectName;
  49. friend class cmVisualStudio10TargetGenerator;
  50. };
  51. #endif