cmLocalVisualStudioGenerator.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 cmLocalVisualStudioGenerator
  17. * \brief Base class for Visual Studio generators.
  18. *
  19. * cmLocalVisualStudioGenerator provides functionality common to all
  20. * Visual Studio generators.
  21. */
  22. class cmLocalVisualStudioGenerator : public cmLocalGenerator
  23. {
  24. public:
  25. cmLocalVisualStudioGenerator();
  26. virtual ~cmLocalVisualStudioGenerator();
  27. /** Construct a script from the given list of command lines. */
  28. std::string ConstructScript(const cmCustomCommandLines& commandLines,
  29. const char* workingDirectory,
  30. const char* configName,
  31. bool escapeOldStyle,
  32. bool escapeAllowMakeVars,
  33. const char* newline = "\n");
  34. /** Line of batch file text that skips to the end after
  35. * a failed step in a sequence of custom commands.
  36. */
  37. std::string GetCheckForErrorLine();
  38. protected:
  39. virtual std::string CheckForErrorLine();
  40. /** Construct a custom command to make exe import lib dir. */
  41. cmsys::auto_ptr<cmCustomCommand>
  42. MaybeCreateImplibDir(cmTarget& target, const char* config);
  43. // Safe object file name generation.
  44. void ComputeObjectNameRequirements(std::vector<cmSourceGroup> const&);
  45. bool SourceFileCompiles(const cmSourceFile* sf);
  46. void CountObjectNames(const std::vector<cmSourceGroup>& groups,
  47. std::map<cmStdString, int>& count);
  48. void InsertNeedObjectNames(const std::vector<cmSourceGroup>& groups,
  49. std::map<cmStdString, int>& count);
  50. std::set<const cmSourceFile*> NeedObjectName;
  51. friend class cmVisualStudio10TargetGenerator;
  52. };
  53. #endif