cmFindPathCommand.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 cmFindPathCommand_h
  11. #define cmFindPathCommand_h
  12. #include "cmFindBase.h"
  13. /** \class cmFindPathCommand
  14. * \brief Define a command to search for a library.
  15. *
  16. * cmFindPathCommand is used to define a CMake variable
  17. * that specifies a library. The command searches for a given
  18. * file in a list of directories.
  19. */
  20. class cmFindPathCommand : public cmFindBase
  21. {
  22. public:
  23. cmFindPathCommand();
  24. /**
  25. * This is a virtual constructor for the command.
  26. */
  27. virtual cmCommand* Clone()
  28. {
  29. return new cmFindPathCommand;
  30. }
  31. /**
  32. * This is called when the command is first encountered in
  33. * the CMakeLists.txt file.
  34. */
  35. virtual bool InitialPass(std::vector<std::string> const& args,
  36. cmExecutionStatus &status);
  37. /**
  38. * This determines if the command is invoked when in script mode.
  39. */
  40. virtual bool IsScriptable() { return true; }
  41. /**
  42. * The name of the command as specified in CMakeList.txt.
  43. */
  44. virtual const char* GetName() {return "find_path";}
  45. /**
  46. * Succinct documentation.
  47. */
  48. virtual const char* GetTerseDocumentation()
  49. {
  50. return "Find the directory containing a file.";
  51. }
  52. cmTypeMacro(cmFindPathCommand, cmFindBase);
  53. bool IncludeFileInPath;
  54. protected:
  55. virtual void GenerateDocumentation();
  56. private:
  57. std::string FindHeaderInFramework(std::string const& file,
  58. std::string const& dir);
  59. std::string FindHeader();
  60. std::string FindNormalHeader();
  61. std::string FindFrameworkHeader();
  62. };
  63. #endif