cmIDEOptions.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmIDEOptions_h
  14. #define cmIDEOptions_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmIDEFlagTable.h"
  17. /** \class cmIDEOptions
  18. * \brief Superclass for IDE option processing
  19. */
  20. class cmIDEOptions
  21. {
  22. public:
  23. cmIDEOptions();
  24. virtual ~cmIDEOptions();
  25. // Store definitions and flags.
  26. void AddDefine(const std::string& define);
  27. void AddDefines(const char* defines);
  28. void AddFlag(const char* flag, const char* value);
  29. protected:
  30. // create a map of xml tags to the values they should have in the output
  31. // for example, "BufferSecurityCheck" = "TRUE"
  32. // first fill this table with the values for the configuration
  33. // Debug, Release, etc,
  34. // Then parse the command line flags specified in CMAKE_CXX_FLAGS
  35. // and CMAKE_C_FLAGS
  36. // and overwrite or add new values to this map
  37. std::map<cmStdString, cmStdString> FlagMap;
  38. // Preprocessor definitions.
  39. std::vector<std::string> Defines;
  40. // Unrecognized flags that get no special handling.
  41. cmStdString FlagString;
  42. bool DoingDefine;
  43. bool AllowDefine;
  44. bool AllowSlash;
  45. enum { FlagTableCount = 16 };
  46. cmIDEFlagTable const* FlagTable[FlagTableCount];
  47. void HandleFlag(const char* flag);
  48. bool CheckFlagTable(cmIDEFlagTable const* table, const char* flag,
  49. bool& flag_handled);
  50. virtual void StoreUnknownFlag(const char* flag) = 0;
  51. };
  52. #endif