cmFindBase.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 "cmCommand.h"
  16. /** \class cmFindBase
  17. * \brief Define a command to search for an executable program.
  18. *
  19. * cmFindBase is a parent class for cmFindProgramCommand, cmFindPathCommand,
  20. * and cmFindLibraryCommand, cmFindFile
  21. */
  22. class cmFindBase : public cmCommand
  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, cmCommand);
  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. void AddEnvironmentVairables();
  38. void AddCMakeVairables();
  39. void AddSystemEnvironmentVairables();
  40. void AddCMakeSystemVariables();
  41. void ExpandRegistryAndCleanPath();
  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();
  46. cmStdString GenericDocumentation;
  47. // use by command during find
  48. cmStdString VariableDocumentation;
  49. cmStdString VariableName;
  50. std::vector<std::string> Names;
  51. std::vector<std::string> SearchPaths;
  52. std::vector<std::string> SearchPathSuffixes;
  53. // CMAKE_*_PATH CMAKE_SYSTEM_*_PATH FRAMEWORK|LIBRARY|INCLUDE|PROGRAM
  54. cmStdString CMakePathName;
  55. cmStdString EnvironmentPath; // LIB,INCLUDE
  56. bool AlreadyInCache;
  57. bool NoSystemPath;
  58. bool NoCMakeEnvironmentPath;
  59. bool NoCMakePath;
  60. bool NoCMakeSystemPath;
  61. bool SearchFrameworkFirst;
  62. bool SearchFrameworkOnly;
  63. bool SearchFrameworkLast;
  64. };
  65. #endif