~ubuntu-branches/ubuntu/intrepid/cmake/intrepid-backports

« back to all changes in this revision

Viewing changes to Source/cmConfigureGccXmlCommand.h

  • Committer: Bazaar Package Importer
  • Author(s): Maitland Bottoms
  • Date: 2002-02-14 18:36:25 UTC
  • Revision ID: james.westby@ubuntu.com-20020214183625-8m44isdas2k4l0f7
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*=========================================================================
 
2
 
 
3
  Program:   Insight Segmentation & Registration Toolkit
 
4
  Module:    $RCSfile: cmConfigureGccXmlCommand.h,v $
 
5
  Language:  C++
 
6
  Date:      $Date: 2001/09/20 19:08:21 $
 
7
  Version:   $Revision: 1.4 $
 
8
 
 
9
Copyright (c) 2001 Insight Consortium
 
10
All rights reserved.
 
11
 
 
12
Redistribution and use in source and binary forms, with or without
 
13
modification, are permitted provided that the following conditions are met:
 
14
 
 
15
 * Redistributions of source code must retain the above copyright notice,
 
16
   this list of conditions and the following disclaimer.
 
17
 
 
18
 * Redistributions in binary form must reproduce the above copyright notice,
 
19
   this list of conditions and the following disclaimer in the documentation
 
20
   and/or other materials provided with the distribution.
 
21
 
 
22
 * The name of the Insight Consortium, nor the names of any consortium members,
 
23
   nor of any contributors, may be used to endorse or promote products derived
 
24
   from this software without specific prior written permission.
 
25
 
 
26
  * Modified source versions must be plainly marked as such, and must not be
 
27
    misrepresented as being the original software.
 
28
 
 
29
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
 
30
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
31
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
32
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
 
33
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
34
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 
35
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 
36
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 
37
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
38
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
39
 
 
40
=========================================================================*/
 
41
#ifndef cmConfigureGccXmlCommand_h
 
42
#define cmConfigureGccXmlCommand_h
 
43
 
 
44
#include "cmStandardIncludes.h"
 
45
#include "cmCommand.h"
 
46
 
 
47
/** \class cmConfigureGccXmlCommand
 
48
 * \brief Define a command that configures flags for GCC-XML to run.
 
49
 */
 
50
class cmConfigureGccXmlCommand : public cmCommand
 
51
{
 
52
public:
 
53
  cmConfigureGccXmlCommand();
 
54
  virtual ~cmConfigureGccXmlCommand();
 
55
 
 
56
  /**
 
57
   * This is a virtual constructor for the command.
 
58
   */
 
59
  virtual cmCommand* Clone()
 
60
    {
 
61
      return new cmConfigureGccXmlCommand;
 
62
    }
 
63
 
 
64
  /**
 
65
   * This is called when the command is first encountered in
 
66
   * the CMakeLists.txt file.
 
67
   */
 
68
  virtual bool InitialPass(std::vector<std::string> const& args);  
 
69
  
 
70
  /**
 
71
   * The name of the command as specified in CMakeList.txt.
 
72
   */
 
73
  virtual const char* GetName() { return "CONFIGURE_GCCXML";}
 
74
 
 
75
  /**
 
76
   * Succinct documentation.
 
77
   */
 
78
  virtual const char* GetTerseDocumentation() 
 
79
    {
 
80
    return "Configure the flags needed for GCC-XML to run.";
 
81
    }
 
82
  
 
83
  /**
 
84
   * More documentation.
 
85
   */
 
86
  virtual const char* GetFullDocumentation()
 
87
    {
 
88
    return
 
89
      "CONFIGURE_GCCXML(exe_location flags_def)\n"
 
90
      "Configures the flags GCC-XML needs to parse source code just as\n"
 
91
      "the current compiler would.  This includes using the compiler's\n"
 
92
      "standard header files.  First argument is input of the full path to\n"
 
93
      "the GCC-XML executable.  The second argument should be the name of\n"
 
94
      "a cache entry to set with the flags chosen.\n";
 
95
    }
 
96
  
 
97
  cmTypeMacro(cmConfigureGccXmlCommand, cmCommand);
 
98
  
 
99
protected:
 
100
  bool GetSupportDirectory(const char*);
 
101
  bool FindVcIncludeFlags();
 
102
  bool FindGccIncludeFlags();
 
103
  bool FindMproIncludeFlags();
 
104
  bool CompilerIsGCC() const;
 
105
  bool CompilerIsMipsPro() const;
 
106
  
 
107
private:
 
108
  std::string m_SupportDir;
 
109
  std::string m_Flags;
 
110
};
 
111
 
 
112
#endif