cmFindCommon.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmFindCommon_h
  11. #define cmFindCommon_h
  12. #include "cmCommand.h"
  13. /** \class cmFindCommon
  14. * \brief Base class for FIND_XXX implementations.
  15. *
  16. * cmFindCommon is a parent class for cmFindBase,
  17. * cmFindProgramCommand, cmFindPathCommand, cmFindLibraryCommand,
  18. * cmFindFileCommand, and cmFindPackageCommand.
  19. */
  20. class cmFindCommon : public cmCommand
  21. {
  22. public:
  23. cmFindCommon();
  24. ~cmFindCommon();
  25. cmTypeMacro(cmFindCommon, cmCommand);
  26. protected:
  27. enum RootPathMode { RootPathModeBoth,
  28. RootPathModeOnlyRootPath,
  29. RootPathModeNoRootPath };
  30. enum PathType { FullPath, CMakePath, EnvPath };
  31. /** Place a set of search paths under the search roots. */
  32. void RerootPaths(std::vector<std::string>& paths);
  33. /** Get ignored paths from CMAKE_[SYSTEM_]IGNORE_path variables. */
  34. void GetIgnoredPaths(std::vector<std::string>& ignore);
  35. void GetIgnoredPaths(std::set<std::string>& ignore);
  36. /** Remove paths in the ignore set from the supplied vector. */
  37. void FilterPaths(std::vector<std::string>& paths,
  38. const std::set<std::string>& ignore);
  39. /** Add trailing slashes to all search paths. */
  40. void AddTrailingSlashes(std::vector<std::string>& paths);
  41. /** Compute the current default root path mode. */
  42. void SelectDefaultRootPathMode();
  43. /** Compute the current default bundle/framework search policy. */
  44. void SelectDefaultMacMode();
  45. virtual void GenerateDocumentation();
  46. cmStdString CMakePathName;
  47. RootPathMode FindRootPathMode;
  48. bool CheckCommonArgument(std::string const& arg);
  49. void AddPathSuffix(std::string const& arg);
  50. void AddUserPath(std::string const& p,
  51. std::vector<std::string>& paths);
  52. void AddCMakePath(const char* variable);
  53. void AddEnvPath(const char* variable);
  54. void AddPathsInternal(std::vector<std::string> const& in_paths,
  55. PathType pathType);
  56. void AddPathInternal(std::string const& in_path, PathType pathType);
  57. void SetMakefile(cmMakefile* makefile);
  58. bool NoDefaultPath;
  59. bool NoCMakePath;
  60. bool NoCMakeEnvironmentPath;
  61. bool NoSystemEnvironmentPath;
  62. bool NoCMakeSystemPath;
  63. std::vector<std::string> SearchPathSuffixes;
  64. std::vector<std::string> UserPaths;
  65. std::vector<std::string> UserHints;
  66. std::vector<std::string> SearchPaths;
  67. std::set<cmStdString> SearchPathsEmitted;
  68. std::string GenericDocumentationMacPolicy;
  69. std::string GenericDocumentationRootPath;
  70. std::string GenericDocumentationPathsOrder;
  71. bool SearchFrameworkFirst;
  72. bool SearchFrameworkOnly;
  73. bool SearchFrameworkLast;
  74. bool SearchAppBundleFirst;
  75. bool SearchAppBundleOnly;
  76. bool SearchAppBundleLast;
  77. };
  78. #endif