cmFindBase.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmFindBase_h
  14. #define cmFindBase_h
  15. #include "cmFindCommon.h"
  16. /** \class cmFindBase
  17. * \brief Base class for most FIND_XXX commands.
  18. *
  19. * cmFindBase is a parent class for cmFindProgramCommand, cmFindPathCommand,
  20. * and cmFindLibraryCommand, cmFindFileCommand
  21. */
  22. class cmFindBase : public cmFindCommon
  23. {
  24. public:
  25. cmFindBase();
  26. /**
  27. * This is called when the command is first encountered in
  28. * the CMakeLists.txt file.
  29. */
  30. virtual bool ParseArguments(std::vector<std::string> const& args);
  31. cmTypeMacro(cmFindBase, cmFindCommon);
  32. virtual const char* GetFullDocumentation()
  33. {return this->GenericDocumentation.c_str();}
  34. protected:
  35. void PrintFindStuff();
  36. void ExpandPaths(std::vector<std::string> userPaths);
  37. // add to the SearchPaths
  38. void AddPaths(std::vector<std::string>& paths);
  39. void AddFrameWorkPaths();
  40. void AddAppBundlePaths();
  41. void AddEnvironmentVariables();
  42. void AddFindPrefix(std::vector<std::string>& dest,
  43. const std::vector<std::string>& src);
  44. void AddCMakeVariables();
  45. void AddSystemEnvironmentVariables();
  46. void AddCMakeSystemVariables();
  47. void ExpandRegistryAndCleanPath(std::vector<std::string>& paths);
  48. // see if the VariableName is already set in the cache,
  49. // also copy the documentation from the cache to VariableDocumentation
  50. // if it has documentation in the cache
  51. bool CheckForVariableInCache();
  52. cmStdString GenericDocumentation;
  53. // use by command during find
  54. cmStdString VariableDocumentation;
  55. cmStdString VariableName;
  56. std::vector<std::string> Names;
  57. std::vector<std::string> SearchPaths;
  58. // CMAKE_*_PATH CMAKE_SYSTEM_*_PATH FRAMEWORK|LIBRARY|INCLUDE|PROGRAM
  59. cmStdString EnvironmentPath; // LIB,INCLUDE
  60. bool AlreadyInCache;
  61. bool AlreadyInCacheWithoutMetaInfo;
  62. };
  63. #endif