cmLocalVisualStudioGenerator.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. protected:
  35. /** Construct a custom command to make exe import lib dir. */
  36. cmsys::auto_ptr<cmCustomCommand>
  37. MaybeCreateImplibDir(cmTarget& target, const char* config);
  38. // Safe object file name generation.
  39. void ComputeObjectNameRequirements(std::vector<cmSourceGroup> const&);
  40. bool SourceFileCompiles(const cmSourceFile* sf);
  41. void CountObjectNames(const std::vector<cmSourceGroup>& groups,
  42. std::map<cmStdString, int>& count);
  43. void InsertNeedObjectNames(const std::vector<cmSourceGroup>& groups,
  44. std::map<cmStdString, int>& count);
  45. std::set<const cmSourceFile*> NeedObjectName;
  46. friend class cmVisualStudio10TargetGenerator;
  47. };
  48. #endif