cmIDEOptions.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 cmIDEOptions_h
  11. #define cmIDEOptions_h
  12. #include "cmStandardIncludes.h"
  13. #include "cmIDEFlagTable.h"
  14. /** \class cmIDEOptions
  15. * \brief Superclass for IDE option processing
  16. */
  17. class cmIDEOptions
  18. {
  19. public:
  20. cmIDEOptions();
  21. virtual ~cmIDEOptions();
  22. // Store definitions and flags.
  23. void AddDefine(const std::string& define);
  24. void AddDefines(const char* defines);
  25. void AddFlag(const char* flag, const char* value);
  26. protected:
  27. // create a map of xml tags to the values they should have in the output
  28. // for example, "BufferSecurityCheck" = "TRUE"
  29. // first fill this table with the values for the configuration
  30. // Debug, Release, etc,
  31. // Then parse the command line flags specified in CMAKE_CXX_FLAGS
  32. // and CMAKE_C_FLAGS
  33. // and overwrite or add new values to this map
  34. std::map<cmStdString, cmStdString> FlagMap;
  35. // Preprocessor definitions.
  36. std::vector<std::string> Defines;
  37. // Unrecognized flags that get no special handling.
  38. cmStdString FlagString;
  39. bool DoingDefine;
  40. bool AllowDefine;
  41. bool AllowSlash;
  42. enum { FlagTableCount = 16 };
  43. cmIDEFlagTable const* FlagTable[FlagTableCount];
  44. void HandleFlag(const char* flag);
  45. bool CheckFlagTable(cmIDEFlagTable const* table, const char* flag,
  46. bool& flag_handled);
  47. virtual void StoreUnknownFlag(const char* flag) = 0;
  48. };
  49. #endif