STYLE: Nightly Date Stamp
[cmake.git] / Source / cmFindPackageCommand.h
blob9cec72c49a5f4831b46c25fac7bb9469e9fffad7
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmFindPackageCommand.h,v $
5 Language: C++
6 Date: $Date: 2008-09-10 14:11:48 $
7 Version: $Revision: 1.25 $
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 cmFindPackageCommand_h
18 #define cmFindPackageCommand_h
20 #include "cmFindCommon.h"
22 class cmFindPackageFileList;
24 /** \class cmFindPackageCommand
25 * \brief Load settings from an external project.
27 * cmFindPackageCommand
29 class cmFindPackageCommand : public cmFindCommon
31 public:
32 cmFindPackageCommand();
34 /**
35 * This is a virtual constructor for the command.
37 virtual cmCommand* Clone()
39 return new cmFindPackageCommand;
42 /**
43 * This is called when the command is first encountered in
44 * the CMakeLists.txt file.
46 virtual bool InitialPass(std::vector<std::string> const& args,
47 cmExecutionStatus &status);
49 /**
50 * This determines if the command is invoked when in script mode.
52 virtual bool IsScriptable() { return true; }
54 /**
55 * The name of the command as specified in CMakeList.txt.
57 virtual const char* GetName() { return "find_package";}
59 /**
60 * Succinct documentation.
62 virtual const char* GetTerseDocumentation()
64 return "Load settings for an external project.";
67 /**
68 * More documentation.
70 virtual const char* GetFullDocumentation();
72 cmTypeMacro(cmFindPackageCommand, cmFindCommon);
73 private:
74 void AppendSuccessInformation();
75 void AppendToProperty(const char* propertyName);
76 void SetModuleVariables(const std::string& components);
77 bool FindModule(bool& found);
78 bool HandlePackageMode();
79 void FindConfig();
80 bool FindPrefixedConfig();
81 bool FindFrameworkConfig();
82 bool FindAppBundleConfig();
83 bool ReadListFile(const char* f);
84 void StoreVersionFound();
86 void ComputePrefixes();
87 void AddPrefixesCMakeEnvironment();
88 void AddPrefixesCMakeVariable();
89 void AddPrefixesSystemEnvironment();
90 void AddPrefixesBuilds();
91 void AddPrefixesCMakeSystemVariable();
92 void AddPrefixesUserGuess();
93 void AddPrefixesUserHints();
94 void ComputeFinalPrefixes();
95 bool SearchDirectory(std::string const& dir);
96 bool CheckDirectory(std::string const& dir);
97 bool FindConfigFile(std::string const& dir, std::string& file);
98 bool FindConfigFileToLoad(std::string const& dir, std::string& file);
99 bool CheckVersion(std::string const& config_file);
100 bool CheckVersionFile(std::string const& version_file);
101 bool SearchPrefix(std::string const& prefix);
102 bool SearchFrameworkPrefix(std::string const& prefix_in);
103 bool SearchAppBundlePrefix(std::string const& prefix_in);
105 friend class cmFindPackageFileList;
107 std::string CommandDocumentation;
108 cmStdString Name;
109 cmStdString Variable;
110 cmStdString Version;
111 unsigned int VersionMajor;
112 unsigned int VersionMinor;
113 unsigned int VersionPatch;
114 unsigned int VersionTweak;
115 unsigned int VersionCount;
116 bool VersionExact;
117 cmStdString FileFound;
118 cmStdString VersionFound;
119 unsigned int VersionFoundMajor;
120 unsigned int VersionFoundMinor;
121 unsigned int VersionFoundPatch;
122 unsigned int VersionFoundTweak;
123 unsigned int VersionFoundCount;
124 bool Quiet;
125 bool Required;
126 bool Compatibility_1_6;
127 bool NoModule;
128 bool NoBuilds;
129 bool DebugMode;
130 bool UseLib64Paths;
131 std::vector<std::string> Names;
132 std::vector<std::string> Configs;
135 #endif