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 cmFindProgramCommand_h
13 #define cmFindProgramCommand_h
15 #include "cmFindBase.h"
17 /** \class cmFindProgramCommand
18 * \brief Define a command to search for an executable program.
20 * cmFindProgramCommand is used to define a CMake variable
21 * that specifies an executable program. The command searches
22 * in the current path (e.g., PATH environment variable) for
23 * an executable that matches one of the supplied names.
25 class cmFindProgramCommand : public cmFindBase
29 * This is a virtual constructor for the command.
31 virtual cmCommand* Clone()
33 return new cmFindProgramCommand;
37 * This is called when the command is first encountered in
38 * the CMakeLists.txt file.
40 virtual bool InitialPass(std::vector<std::string> const& args,
41 cmExecutionStatus &status);
44 * This determines if the command is invoked when in script mode.
46 virtual bool IsScriptable() const { return true; }
49 * The name of the command as specified in CMakeList.txt.
51 virtual const char* GetName() const { return "find_program";}
54 * Succinct documentation.
56 virtual const char* GetTerseDocumentation() const
58 return "Find an executable program.";
61 cmTypeMacro(cmFindProgramCommand, cmFindBase);
64 std::string FindProgram(std::vector<std::string> names);
65 virtual void GenerateDocumentation();
68 std::string FindAppBundle(std::vector<std::string> names);
69 std::string GetBundleExecutable(std::string bundlePath);