packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmFindPathCommand.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 cmFindPathCommand_h
13 #define cmFindPathCommand_h
14
15 #include "cmFindBase.h"
16
17
18 /** \class cmFindPathCommand
19  * \brief Define a command to search for a library.
20  *
21  * cmFindPathCommand is used to define a CMake variable
22  * that specifies a library. The command searches for a given
23  * file in a list of directories.
24  */
25 class cmFindPathCommand : public cmFindBase
26 {
27 public:
28   cmFindPathCommand();
29   /**
30    * This is a virtual constructor for the command.
31    */
32   virtual cmCommand* Clone()
33     {
34     return new cmFindPathCommand;
35     }
36
37   /**
38    * This is called when the command is first encountered in
39    * the CMakeLists.txt file.
40    */
41   virtual bool InitialPass(std::vector<std::string> const& args,
42                            cmExecutionStatus &status);
43
44   /**
45    * This determines if the command is invoked when in script mode.
46    */
47   virtual bool IsScriptable() const { return true; }
48
49   /**
50    * The name of the command as specified in CMakeList.txt.
51    */
52   virtual const char* GetName() const {return "find_path";}
53
54   /**
55    * Succinct documentation.
56    */
57   virtual const char* GetTerseDocumentation() const
58     {
59     return "Find the directory containing a file.";
60     }
61
62   cmTypeMacro(cmFindPathCommand, cmFindBase);
63   bool IncludeFileInPath;
64 protected:
65   virtual void GenerateDocumentation();
66 private:
67   std::string FindHeaderInFramework(std::string const& file,
68                                     std::string const& dir);
69   std::string FindHeader();
70   std::string FindNormalHeader();
71   std::string FindFrameworkHeader();
72 };
73
74
75
76 #endif