1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmFindBase.h,v $
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 =========================================================================*/
20 #include "cmFindCommon.h"
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
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();}
43 void PrintFindStuff();
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
62 bool AlreadyInCacheWithoutMetaInfo
;
64 // Add pieces of the search.
65 void AddCMakeEnvironmentPath();
66 void AddCMakeVariablePath();
67 void AddSystemEnvironmentPath();
68 void AddCMakeSystemVariablePath();
69 void AddUserHintsPath();
70 void AddUserGuessPath();
73 void AddCMakePrefixPath(const char* variable
);
74 void AddEnvPrefixPath(const char* variable
);
75 void AddPrefixPaths(std::vector
<std::string
> const& in_paths
,