Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / cmFindBase.h
blob83279e5aed2cb062e937637c003f0a7b6d73f10d
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmFindBase.h,v $
5 Language: C++
6 Date: $Date: 2008-06-09 19:08:58 $
7 Version: $Revision: 1.16 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmFindBase_h
18 #define cmFindBase_h
20 #include "cmFindCommon.h"
22 /** \class cmFindBase
23 * \brief Base class for most FIND_XXX commands.
25 * cmFindBase is a parent class for cmFindProgramCommand, cmFindPathCommand,
26 * and cmFindLibraryCommand, cmFindFileCommand
28 class cmFindBase : public cmFindCommon
30 public:
31 cmFindBase();
32 /**
33 * This is called when the command is first encountered in
34 * the CMakeLists.txt file.
36 virtual bool ParseArguments(std::vector<std::string> const& args);
37 cmTypeMacro(cmFindBase, cmFindCommon);
39 virtual const char* GetFullDocumentation()
40 {return this->GenericDocumentation.c_str();}
42 protected:
43 void PrintFindStuff();
44 void ExpandPaths();
45 void AddPathSuffixes();
47 // see if the VariableName is already set in the cache,
48 // also copy the documentation from the cache to VariableDocumentation
49 // if it has documentation in the cache
50 bool CheckForVariableInCache();
52 cmStdString GenericDocumentation;
53 // use by command during find
54 cmStdString VariableDocumentation;
55 cmStdString VariableName;
56 std::vector<std::string> Names;
58 // CMAKE_*_PATH CMAKE_SYSTEM_*_PATH FRAMEWORK|LIBRARY|INCLUDE|PROGRAM
59 cmStdString EnvironmentPath; // LIB,INCLUDE
61 bool AlreadyInCache;
62 bool AlreadyInCacheWithoutMetaInfo;
63 private:
64 // Add pieces of the search.
65 void AddCMakeEnvironmentPath();
66 void AddCMakeVariablePath();
67 void AddSystemEnvironmentPath();
68 void AddCMakeSystemVariablePath();
69 void AddUserHintsPath();
70 void AddUserGuessPath();
72 // Helpers.
73 void AddCMakePrefixPath(const char* variable);
74 void AddEnvPrefixPath(const char* variable);
75 void AddPrefixPaths(std::vector<std::string> const& in_paths,
76 PathType pathType);
81 #endif