cmFindPathCommand.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 cmFindPathCommand_h
  14. #define cmFindPathCommand_h
  15. #include "cmCommand.h"
  16. /** \class cmFindPathCommand
  17. * \brief Define a command to search for a library.
  18. *
  19. * cmFindPathCommand is used to define a CMake variable
  20. * that specifies a library. The command searches for a given
  21. * file in a list of directories.
  22. */
  23. class cmFindPathCommand : public cmCommand
  24. {
  25. public:
  26. /**
  27. * This is a virtual constructor for the command.
  28. */
  29. virtual cmCommand* Clone()
  30. {
  31. return new cmFindPathCommand;
  32. }
  33. /**
  34. * This is called when the command is first encountered in
  35. * the CMakeLists.txt file.
  36. */
  37. virtual bool InitialPass(std::vector<std::string> const& args);
  38. /**
  39. * This determines if the command is invoked when in script mode.
  40. */
  41. virtual bool IsScriptable() { return true; }
  42. /**
  43. * The name of the command as specified in CMakeList.txt.
  44. */
  45. virtual const char* GetName() {return "FIND_PATH";}
  46. /**
  47. * Succinct documentation.
  48. */
  49. virtual const char* GetTerseDocumentation()
  50. {
  51. return "Find the directory containing a file.";
  52. }
  53. /**
  54. * More documentation.
  55. */
  56. virtual const char* GetFullDocumentation()
  57. {
  58. return
  59. " FIND_PATH(<VAR> fileName path1 [path2 ...]\n"
  60. " [DOC \"docstring\"])\n"
  61. "Find the directory containing a file named by fileName. "
  62. "A cache entry named by "
  63. "<VAR> is created to store the result. If the file is not "
  64. "found, the result will be <VAR>-NOTFOUND. If DOC is specified "
  65. "then the next argument is treated as a documentation string for "
  66. "the cache entry <VAR>. "
  67. "The search proceeds first in paths listed in the CMAKE_INCLUDE_PATH "
  68. "CMake variable (which is generally set by the user on the command line), "
  69. "then in paths listed in the CMAKE_INCLUDE_PATH environment variable, "
  70. "then in paths given to the command, and finally in paths listed in the "
  71. "PATH environment variable.";
  72. }
  73. cmStdString FindHeaderInFrameworks( std::vector<std::string> path,
  74. const char* var, const char* file);
  75. cmTypeMacro(cmFindPathCommand, cmCommand);
  76. };
  77. #endif