1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #ifndef cmFindLibraryCommand_h
13 #define cmFindLibraryCommand_h
15 #include "cmFindBase.h"
18 /** \class cmFindLibraryCommand
19 * \brief Define a command to search for a library.
21 * cmFindLibraryCommand is used to define a CMake variable
22 * that specifies a library. The command searches for a given
23 * file in a list of directories.
25 class cmFindLibraryCommand : public cmFindBase
28 cmFindLibraryCommand();
30 * This is a virtual constructor for the command.
32 virtual cmCommand* Clone()
34 return new cmFindLibraryCommand;
38 * This is called when the command is first encountered in
39 * the CMakeLists.txt file.
41 virtual bool InitialPass(std::vector<std::string> const& args,
42 cmExecutionStatus &status);
45 * This determines if the command is invoked when in script mode.
47 virtual bool IsScriptable() const { return true; }
50 * The name of the command as specified in CMakeList.txt.
52 virtual const char* GetName() const {return "find_library";}
55 * Succinct documentation.
57 virtual const char* GetTerseDocumentation() const
59 return "Find a library.";
61 cmTypeMacro(cmFindLibraryCommand, cmFindBase);
64 void AddArchitecturePaths(const char* suffix);
65 void AddArchitecturePath(std::string const& dir,
66 std::string::size_type start_pos,
69 std::string FindLibrary();
70 virtual void GenerateDocumentation();
72 std::string FindNormalLibrary();
73 std::string FindNormalLibraryNamesPerDir();
74 std::string FindNormalLibraryDirsPerName();
75 std::string FindFrameworkLibrary();
76 std::string FindFrameworkLibraryNamesPerDir();
77 std::string FindFrameworkLibraryDirsPerName();