cmFindPathCommand.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 gets propagated down
  40. * to makefiles located in subdirectories.
  41. */
  42. virtual bool IsInherited() {return false;}
  43. /**
  44. * The name of the command as specified in CMakeList.txt.
  45. */
  46. virtual const char* GetName() {return "FIND_PATH";}
  47. /**
  48. * Succinct documentation.
  49. */
  50. virtual const char* GetTerseDocumentation()
  51. {
  52. return "Find the directory containing a file.";
  53. }
  54. /**
  55. * More documentation.
  56. */
  57. virtual const char* GetFullDocumentation()
  58. {
  59. return
  60. " FIND_PATH(VAR fileName path1 path2 ... [DOC docstring])\n"
  61. "If the file is found, then VAR is set to the path where it was found. "
  62. "A cache entry named by VAR is created to "
  63. "store the result. VAR-NOTFOUND is the value used if the file was "
  64. "not found. CMake will continue to look as long as the value "
  65. "is not found. If DOC is specified the next argument is the "
  66. "documentation string for the cache entry VAR.";
  67. }
  68. cmTypeMacro(cmFindPathCommand, cmCommand);
  69. };
  70. #endif