cmFindLibraryCommand.h 1.99 KB
Newer Older
1 2 3
/*============================================================================
  CMake - Cross Platform Makefile Generator
  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
4

5 6
  Distributed under the OSI-approved BSD License (the "License");
  see accompanying file Copyright.txt for details.
7

8 9 10 11
  This software is distributed WITHOUT ANY WARRANTY; without even the
  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the License for more information.
============================================================================*/
12 13
#ifndef cmFindLibraryCommand_h
#define cmFindLibraryCommand_h
14

Bill Hoffman's avatar
Bill Hoffman committed
15
#include "cmFindBase.h"
16 17


18 19
/** \class cmFindLibraryCommand
 * \brief Define a command to search for a library.
20
 *
21 22
 * cmFindLibraryCommand is used to define a CMake variable
 * that specifies a library. The command searches for a given
23 24
 * file in a list of directories.
 */
Bill Hoffman's avatar
Bill Hoffman committed
25
class cmFindLibraryCommand : public cmFindBase
26 27
{
public:
Bill Hoffman's avatar
Bill Hoffman committed
28
  cmFindLibraryCommand();
29
  /**
30
   * This is a virtual constructor for the command.
31
   */
32
  virtual cmCommand* Clone() 
33
    {
34
    return new cmFindLibraryCommand;
35
    }
36 37

  /**
38
   * This is called when the command is first encountered in
39 40
   * the CMakeLists.txt file.
   */
41 42
  virtual bool InitialPass(std::vector<std::string> const& args,
                           cmExecutionStatus &status);
43

44 45 46
  /**
   * This determines if the command is invoked when in script mode.
   */
47
  virtual bool IsScriptable() const { return true; }
48

49
  /**
50
   * The name of the command as specified in CMakeList.txt.
51
   */
52
  virtual const char* GetName() const {return "find_library";}
53

54 55 56
  /**
   * Succinct documentation.
   */
57
  virtual const char* GetTerseDocumentation() const
58
    {
59
    return "Find a library.";
60
    }
Bill Hoffman's avatar
Bill Hoffman committed
61
  cmTypeMacro(cmFindLibraryCommand, cmFindBase);
62
  
Bill Hoffman's avatar
Bill Hoffman committed
63
protected:
64
  void AddArchitecturePaths(const char* suffix);
65
  std::string FindLibrary();
Brad King's avatar
Brad King committed
66
  virtual void GenerateDocumentation();
67 68 69
private:
  std::string FindNormalLibrary();
  std::string FindFrameworkLibrary();
70 71 72 73 74
};



#endif