Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / cmGetFilenameComponentCommand.h
blob924b70161aad1625934aa01cb23b0e944ce89615
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmGetFilenameComponentCommand.h,v $
5 Language: C++
6 Date: $Date: 2009-02-09 14:23:55 $
7 Version: $Revision: 1.16 $
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 cmGetFilenameComponentCommand_h
18 #define cmGetFilenameComponentCommand_h
20 #include "cmCommand.h"
22 /** \class cmGetFilenameComponentCommand
23 * \brief Get a specific component of a filename.
25 * cmGetFilenameComponentCommand is a utility command used to get the path,
26 * name, extension or name without extension of a full filename.
28 class cmGetFilenameComponentCommand : public cmCommand
30 public:
31 /**
32 * This is a virtual constructor for the command.
34 virtual cmCommand* Clone()
36 return new cmGetFilenameComponentCommand;
39 /**
40 * This is called when the command is first encountered in
41 * the CMakeLists.txt file.
43 virtual bool InitialPass(std::vector<std::string> const& args,
44 cmExecutionStatus &status);
46 /**
47 * This determines if the command is invoked when in script mode.
49 virtual bool IsScriptable() { return true; }
51 /**
52 * The name of the command as specified in CMakeList.txt.
54 virtual const char* GetName() { return "get_filename_component";}
56 /**
57 * Succinct documentation.
59 virtual const char* GetTerseDocumentation()
61 return "Get a specific component of a full filename.";
64 /**
65 * More documentation.
67 virtual const char* GetFullDocumentation()
69 return
70 " get_filename_component(VarName FileName\n"
71 " PATH|ABSOLUTE|NAME|EXT|NAME_WE|REALPATH\n"
72 " [CACHE])\n"
73 "Set VarName to be the path (PATH), file name (NAME), file "
74 "extension (EXT), file name without extension (NAME_WE) of FileName, "
75 "the full path (ABSOLUTE), or the full path with all symlinks "
76 "resolved (REALPATH). "
77 "Note that the path is converted to Unix slashes format and has no "
78 "trailing slashes. The longest file extension is always considered. "
79 "If the optional CACHE argument is specified, the result variable is "
80 "added to the cache.\n"
81 " get_filename_component(VarName FileName\n"
82 " PROGRAM [PROGRAM_ARGS ArgVar]\n"
83 " [CACHE])\n"
84 "The program in FileName will be found in the system search path or "
85 "left as a full path. If PROGRAM_ARGS is present with PROGRAM, then "
86 "any command-line arguments present in the FileName string are split "
87 "from the program name and stored in ArgVar. This is used to separate "
88 "a program name from its arguments in a command line string.";
91 cmTypeMacro(cmGetFilenameComponentCommand, cmCommand);
96 #endif