1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
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 ============================================================================*/
15 #include "cmFindCommon.h"
18 * \brief Base class for most FIND_XXX commands.
20 * cmFindBase is a parent class for cmFindProgramCommand, cmFindPathCommand,
21 * and cmFindLibraryCommand, cmFindFileCommand
23 class cmFindBase : public cmFindCommon
28 * This is called when the command is first encountered in
29 * the CMakeLists.txt file.
31 virtual bool ParseArguments(std::vector<std::string> const& args);
32 cmTypeMacro(cmFindBase, cmFindCommon);
34 virtual const char* GetFullDocumentation() const;
37 virtual void GenerateDocumentation();
38 void PrintFindStuff();
40 void AddPathSuffixes();
42 // see if the VariableName is already set in the cache,
43 // also copy the documentation from the cache to VariableDocumentation
44 // if it has documentation in the cache
45 bool CheckForVariableInCache();
47 cmStdString GenericDocumentation;
48 // use by command during find
49 cmStdString VariableDocumentation;
50 cmStdString VariableName;
51 std::vector<std::string> Names;
53 bool NamesPerDirAllowed;
55 // CMAKE_*_PATH CMAKE_SYSTEM_*_PATH FRAMEWORK|LIBRARY|INCLUDE|PROGRAM
56 cmStdString EnvironmentPath; // LIB,INCLUDE
59 bool AlreadyInCacheWithoutMetaInfo;
61 // Add pieces of the search.
62 void AddCMakeEnvironmentPath();
63 void AddCMakeVariablePath();
64 void AddSystemEnvironmentPath();
65 void AddCMakeSystemVariablePath();
66 void AddUserHintsPath();
67 void AddUserGuessPath();
70 void AddCMakePrefixPath(const char* variable);
71 void AddEnvPrefixPath(const char* variable);
72 void AddPrefixPaths(std::vector<std::string> const& in_paths,