Initial commit.
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / cmFindProgramCommand.h
blobd7d553afe925de92d1aed33e1cf7ce88fc4e73e6
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmFindProgramCommand.h,v $
5 Language: C++
6 Date: $Date: 2008/01/23 15:27:59 $
7 Version: $Revision: 1.21 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmFindProgramCommand_h
18 #define cmFindProgramCommand_h
20 #include "cmFindBase.h"
22 /** \class cmFindProgramCommand
23 * \brief Define a command to search for an executable program.
25 * cmFindProgramCommand is used to define a CMake variable
26 * that specifies an executable program. The command searches
27 * in the current path (e.g., PATH environment variable) for
28 * an executable that matches one of the supplied names.
30 class cmFindProgramCommand : public cmFindBase
32 public:
33 cmFindProgramCommand();
34 /**
35 * This is a virtual constructor for the command.
37 virtual cmCommand* Clone()
39 return new cmFindProgramCommand;
42 /**
43 * This is called when the command is first encountered in
44 * the CMakeLists.txt file.
46 virtual bool InitialPass(std::vector<std::string> const& args,
47 cmExecutionStatus &status);
49 /**
50 * This determines if the command is invoked when in script mode.
52 virtual bool IsScriptable() { return true; }
54 /**
55 * The name of the command as specified in CMakeList.txt.
57 virtual const char* GetName() { return "find_program";}
59 /**
60 * Succinct documentation.
62 virtual const char* GetTerseDocumentation()
64 return "Find an executable program.";
67 cmTypeMacro(cmFindProgramCommand, cmFindBase);
69 protected:
70 std::string FindProgram(std::vector<std::string> names);
72 private:
73 std::string FindAppBundle(std::vector<std::string> names);
74 std::string GetBundleExecutable(std::string bundlePath);
80 #endif