2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2009-07-29 19:29:08 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2009-07-29 19:29:08 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
2009-07-29 19:29:08 +04:00
|
|
|
#ifndef cmIDEOptions_h
|
|
|
|
#define cmIDEOptions_h
|
|
|
|
|
|
|
|
#include "cmStandardIncludes.h"
|
|
|
|
#include "cmIDEFlagTable.h"
|
|
|
|
|
|
|
|
/** \class cmIDEOptions
|
|
|
|
* \brief Superclass for IDE option processing
|
|
|
|
*/
|
|
|
|
class cmIDEOptions
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cmIDEOptions();
|
|
|
|
virtual ~cmIDEOptions();
|
|
|
|
|
|
|
|
// Store definitions and flags.
|
|
|
|
void AddDefine(const std::string& define);
|
|
|
|
void AddDefines(const char* defines);
|
2013-07-10 17:22:59 +04:00
|
|
|
void AddDefines(const std::vector<std::string> &defines);
|
2009-07-29 19:29:08 +04:00
|
|
|
void AddFlag(const char* flag, const char* value);
|
2011-02-09 20:59:09 +03:00
|
|
|
void RemoveFlag(const char* flag);
|
2012-10-26 18:16:45 +04:00
|
|
|
const char* GetFlag(const char* flag);
|
2009-07-29 19:29:08 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// create a map of xml tags to the values they should have in the output
|
|
|
|
// for example, "BufferSecurityCheck" = "TRUE"
|
|
|
|
// first fill this table with the values for the configuration
|
|
|
|
// Debug, Release, etc,
|
|
|
|
// Then parse the command line flags specified in CMAKE_CXX_FLAGS
|
|
|
|
// and CMAKE_C_FLAGS
|
|
|
|
// and overwrite or add new values to this map
|
2014-02-10 09:21:34 +04:00
|
|
|
std::map<std::string, std::string> FlagMap;
|
2009-07-29 19:29:08 +04:00
|
|
|
|
|
|
|
// Preprocessor definitions.
|
|
|
|
std::vector<std::string> Defines;
|
|
|
|
|
|
|
|
// Unrecognized flags that get no special handling.
|
2014-02-10 09:21:34 +04:00
|
|
|
std::string FlagString;
|
2009-07-29 19:29:08 +04:00
|
|
|
|
|
|
|
bool DoingDefine;
|
|
|
|
bool AllowDefine;
|
|
|
|
bool AllowSlash;
|
|
|
|
enum { FlagTableCount = 16 };
|
|
|
|
cmIDEFlagTable const* FlagTable[FlagTableCount];
|
|
|
|
void HandleFlag(const char* flag);
|
|
|
|
bool CheckFlagTable(cmIDEFlagTable const* table, const char* flag,
|
|
|
|
bool& flag_handled);
|
|
|
|
virtual void StoreUnknownFlag(const char* flag) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|