Imported Upstream version 2.8.9
[platform/upstream/cmake.git] / Source / cmUseMangledMesaCommand.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 cmUseMangledMesaCommand_h
13 #define cmUseMangledMesaCommand_h
14
15 #include "cmCommand.h"
16
17 #include "cmSourceFile.h"
18
19 /** \class cmUseMangledMesaCommand
20  * \brief Create Tcl Wrappers for VTK classes.
21  *
22  * cmUseMangledMesaCommand is used to define a CMake variable include
23  * path location by specifying a file and list of directories.
24  */
25 class cmUseMangledMesaCommand : public cmCommand
26 {
27 public:
28   cmTypeMacro(cmUseMangledMesaCommand, cmCommand);
29
30   /**
31    * This is a virtual constructor for the command.
32    */
33   virtual cmCommand* Clone()
34     {
35     return new cmUseMangledMesaCommand;
36     }
37
38   /**
39    * This is called when the command is first encountered in
40    * the CMakeLists.txt file.
41    */
42   virtual bool InitialPass(std::vector<std::string> const& args,
43                            cmExecutionStatus &status);
44
45   /**
46    * The name of the command as specified in CMakeList.txt.
47    */
48   virtual const char* GetName() const { return "use_mangled_mesa";}
49
50   /**
51    * Succinct documentation.
52    */
53   virtual const char* GetTerseDocumentation() const
54     {
55     return "Copy mesa headers for use in combination with system GL.";
56     }
57
58   /**
59    * More documentation.
60    */
61   virtual const char* GetFullDocumentation() const
62     {
63     return
64       "  use_mangled_mesa(PATH_TO_MESA OUTPUT_DIRECTORY)\n"
65       "The path to mesa includes, should contain gl_mangle.h.  "
66       "The mesa headers are copied to the specified output directory.  "
67       "This allows mangled mesa headers to override other GL headers by "
68       "being added to the include directory path earlier.";
69     }
70
71   /**
72    * This determines if the command is invoked when in script mode.
73    */
74   virtual bool IsScriptable() const { return true; }
75
76   /** This command is kept for compatibility with older CMake versions. */
77   virtual bool IsDiscouraged() const
78     {
79     return true;
80     }
81
82 protected:
83   void CopyAndFullPathMesaHeader(const char* source,
84                                  const char* outdir);
85 };
86
87
88 #endif