packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmIDEOptions.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
8   This software is distributed WITHOUT ANY WARRANTY; without even the
9   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10   See the License for more information.
11 ============================================================================*/
12 #ifndef cmIDEOptions_h
13 #define cmIDEOptions_h
14
15 #include "cmStandardIncludes.h"
16 #include "cmIDEFlagTable.h"
17
18 /** \class cmIDEOptions
19  * \brief Superclass for IDE option processing
20  */
21 class cmIDEOptions
22 {
23 public:
24   cmIDEOptions();
25   virtual ~cmIDEOptions();
26
27   // Store definitions and flags.
28   void AddDefine(const std::string& define);
29   void AddDefines(const char* defines);
30   void AddDefines(const std::vector<std::string> &defines);
31   void AddFlag(const char* flag, const char* value);
32   void RemoveFlag(const char* flag);
33   const char* GetFlag(const char* flag);
34
35 protected:
36   // create a map of xml tags to the values they should have in the output
37   // for example, "BufferSecurityCheck" = "TRUE"
38   // first fill this table with the values for the configuration
39   // Debug, Release, etc,
40   // Then parse the command line flags specified in CMAKE_CXX_FLAGS
41   // and CMAKE_C_FLAGS
42   // and overwrite or add new values to this map
43   std::map<cmStdString, cmStdString> FlagMap;
44
45   // Preprocessor definitions.
46   std::vector<std::string> Defines;
47
48   // Unrecognized flags that get no special handling.
49   cmStdString FlagString;
50
51   bool DoingDefine;
52   bool AllowDefine;
53   bool AllowSlash;
54   enum { FlagTableCount = 16 };
55   cmIDEFlagTable const* FlagTable[FlagTableCount];
56   void HandleFlag(const char* flag);
57   bool CheckFlagTable(cmIDEFlagTable const* table, const char* flag,
58                       bool& flag_handled);
59   virtual void StoreUnknownFlag(const char* flag) = 0;
60 };
61
62 #endif