1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmUtilitySourceCommand.h,v $
6 Date: $Date: 2008-01-23 15:27:59 $
7 Version: $Revision: 1.14 $
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 cmUtilitySourceCommand_h
18 #define cmUtilitySourceCommand_h
20 #include "cmCommand.h"
22 /** \class cmUtilitySourceCommand
23 * \brief A command to setup a cache entry with the location of a third-party
26 * cmUtilitySourceCommand is used when a third-party utility's source is
27 * included in the project's source tree. It specifies the location of
28 * the executable's source, and any files that may be needed to confirm the
29 * identity of the source.
31 class cmUtilitySourceCommand
: public cmCommand
35 * This is a virtual constructor for the command.
37 virtual cmCommand
* Clone()
39 return new cmUtilitySourceCommand
;
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
);
50 * The name of the command as specified in CMakeList.txt.
52 virtual const char* GetName() { return "utility_source";}
55 * Succinct documentation.
57 virtual const char* GetTerseDocumentation()
59 return "Specify the source tree of a third-party utility.";
65 virtual const char* GetFullDocumentation()
68 " utility_source(cache_entry executable_name\n"
69 " path_to_source [file1 file2 ...])\n"
70 "When a third-party utility's source is included in the distribution, "
71 "this command specifies its location and name. The cache entry will "
72 "not be set unless the path_to_source and all listed files exist. It "
73 "is assumed that the source tree of the utility will have been built "
74 "before it is needed.\n"
75 "When cross compiling CMake will print a warning if a utility_source() "
76 "command is executed, because in many cases it is used to build an "
77 "executable which is executed later on. This doesn't work when "
78 "cross compiling, since the executable can run only on their target "
79 "platform. So in this case the cache entry has to be adjusted manually "
80 "so it points to an executable which is runnable on the build host.";
83 /** This command is kept for compatibility with older CMake versions. */
84 virtual bool IsDiscouraged()
90 cmTypeMacro(cmUtilitySourceCommand
, cmCommand
);