cmFindCommon.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. /** Add trailing slashes to all search paths. */
  34. void AddTrailingSlashes(std::vector<std::string>& paths);
  35. /** Compute the current default root path mode. */
  36. void SelectDefaultRootPathMode();
  37. /** Compute the current default bundle/framework search policy. */
  38. void SelectDefaultMacMode();
  39. cmStdString CMakePathName;
  40. RootPathMode FindRootPathMode;
  41. bool CheckCommonArgument(std::string const& arg);
  42. void AddPathSuffix(std::string const& arg);
  43. void AddUserPath(std::string const& p,
  44. std::vector<std::string>& paths);
  45. void AddCMakePath(const char* variable);
  46. void AddEnvPath(const char* variable);
  47. void AddPathsInternal(std::vector<std::string> const& in_paths,
  48. PathType pathType);
  49. void AddPathInternal(std::string const& in_path, PathType pathType);
  50. bool NoDefaultPath;
  51. bool NoCMakePath;
  52. bool NoCMakeEnvironmentPath;
  53. bool NoSystemEnvironmentPath;
  54. bool NoCMakeSystemPath;
  55. std::vector<std::string> SearchPathSuffixes;
  56. std::vector<std::string> UserPaths;
  57. std::vector<std::string> UserHints;
  58. std::vector<std::string> SearchPaths;
  59. std::set<cmStdString> SearchPathsEmitted;
  60. std::string GenericDocumentationMacPolicy;
  61. std::string GenericDocumentationRootPath;
  62. std::string GenericDocumentationPathsOrder;
  63. bool SearchFrameworkFirst;
  64. bool SearchFrameworkOnly;
  65. bool SearchFrameworkLast;
  66. bool SearchAppBundleFirst;
  67. bool SearchAppBundleOnly;
  68. bool SearchAppBundleLast;
  69. };
  70. #endif