CMake/Source/cmFindLibraryCommand.h

97 lines
3.0 KiB
C
Raw Normal View History

2001-01-11 16:04:28 +03:00
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
2001-01-11 16:04:28 +03:00
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
2001-04-27 16:01:17 +04:00
2002-01-21 23:30:43 +03:00
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
2001-01-11 16:04:28 +03:00
=========================================================================*/
2001-01-18 19:20:24 +03:00
#ifndef cmFindLibraryCommand_h
#define cmFindLibraryCommand_h
2001-01-18 19:20:24 +03:00
#include "cmCommand.h"
2001-01-18 19:20:24 +03:00
/** \class cmFindLibraryCommand
* \brief Define a command to search for a library.
2001-01-11 16:04:28 +03:00
*
2001-01-18 19:20:24 +03:00
* cmFindLibraryCommand is used to define a CMake variable
* that specifies a library. The command searches for a given
2001-01-11 16:04:28 +03:00
* file in a list of directories.
*/
2001-01-18 19:20:24 +03:00
class cmFindLibraryCommand : public cmCommand
{
public:
2001-01-11 16:04:28 +03:00
/**
2001-01-18 19:20:24 +03:00
* This is a virtual constructor for the command.
2001-01-11 16:04:28 +03:00
*/
2001-01-18 19:20:24 +03:00
virtual cmCommand* Clone()
{
2001-01-18 19:20:24 +03:00
return new cmFindLibraryCommand;
}
2001-01-11 16:04:28 +03:00
/**
2001-01-18 19:20:24 +03:00
* This is called when the command is first encountered in
2001-01-11 16:04:28 +03:00
* the CMakeLists.txt file.
*/
virtual bool InitialPass(std::vector<std::string> const& args);
2001-01-11 16:04:28 +03:00
2004-02-23 06:07:02 +03:00
/**
* This determines if the command is invoked when in script mode.
*/
virtual bool IsScriptable() { return true; }
2001-01-11 16:04:28 +03:00
/**
2001-01-18 19:20:24 +03:00
* The name of the command as specified in CMakeList.txt.
2001-01-11 16:04:28 +03:00
*/
virtual const char* GetName() {return "FIND_LIBRARY";}
2001-01-11 16:04:28 +03:00
/**
* Succinct documentation.
*/
2001-01-12 22:35:15 +03:00
virtual const char* GetTerseDocumentation()
{
2001-01-11 16:04:28 +03:00
return "Find a library.";
}
2001-01-11 16:04:28 +03:00
/**
* More documentation.
*/
2001-01-12 22:35:15 +03:00
virtual const char* GetFullDocumentation()
{
2001-01-11 16:04:28 +03:00
return
2003-11-13 21:51:18 +03:00
" FIND_LIBRARY(<VAR> NAMES name1 [name2 ...]\n"
" [PATHS path1 path2 ...]\n"
2003-11-13 21:51:18 +03:00
" [DOC \"docstring\"])\n"
"Find a library named by one of the names given after the NAMES "
"argument. A cache entry named by <VAR> is created "
2003-11-13 21:51:18 +03:00
"to store the result. If the library is not found, the result "
"will be <VAR>-NOTFOUND. If DOC is specified then the next "
"argument is treated as a documentation string for the cache "
"entry <VAR>.\n"
" FIND_LIBRARY(VAR libraryName [path1 path2 ...])\n"
"Find a library with the given name by searching in the specified "
"paths. This is a short-hand signature for the command that is "
"sufficient in many cases. "
"The search proceeds first in paths listed in the CMAKE_LIBRARY_PATH "
"CMake variable (which is generally set by the user on the command line), "
"then in paths listed in the CMAKE_LIBRARY_PATH environment variable, "
"then in paths given to the PATHS option of the command, "
"and finally in paths listed in the PATH environment variable.";
}
cmTypeMacro(cmFindLibraryCommand, cmCommand);
};
#endif