cmFindBase.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 AddFrameWorkPaths();
  38. void AddAppBundlePaths();
  39. void AddEnvironmentVairables();
  40. void AddCMakeVairables();
  41. void AddSystemEnvironmentVairables();
  42. void AddCMakeSystemVariables();
  43. void ExpandRegistryAndCleanPath();
  44. // see if the VariableName is already set in the cache,
  45. // also copy the documentation from the cache to VariableDocumentation
  46. // if it has documentation in the cache
  47. bool CheckForVariableInCache();
  48. cmStdString GenericDocumentation;
  49. // use by command during find
  50. cmStdString VariableDocumentation;
  51. cmStdString VariableName;
  52. std::vector<std::string> Names;
  53. std::vector<std::string> SearchPaths;
  54. std::vector<std::string> SearchPathSuffixes;
  55. // CMAKE_*_PATH CMAKE_SYSTEM_*_PATH FRAMEWORK|LIBRARY|INCLUDE|PROGRAM
  56. cmStdString CMakePathName;
  57. cmStdString EnvironmentPath; // LIB,INCLUDE
  58. bool AlreadyInCache;
  59. bool NoDefaultPath;
  60. bool NoCMakePath;
  61. bool NoCMakeEnvironmentPath;
  62. bool NoSystemEnvironmentPath;
  63. bool NoCMakeSystemPath;
  64. bool SearchFrameworkFirst;
  65. bool SearchFrameworkOnly;
  66. bool SearchFrameworkLast;
  67. bool SearchAppBundleFirst;
  68. bool SearchAppBundleOnly;
  69. bool SearchAppBundleLast;
  70. };
  71. #endif