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 cmUtilitySourceCommand_h
13 #define cmUtilitySourceCommand_h
15 #include "cmCommand.h"
17 /** \class cmUtilitySourceCommand
18 * \brief A command to setup a cache entry with the location of a third-party
21 * cmUtilitySourceCommand is used when a third-party utility's source is
22 * included in the project's source tree. It specifies the location of
23 * the executable's source, and any files that may be needed to confirm the
24 * identity of the source.
26 class cmUtilitySourceCommand : public cmCommand
30 * This is a virtual constructor for the command.
32 virtual cmCommand* Clone()
34 return new cmUtilitySourceCommand;
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 * The name of the command as specified in CMakeList.txt.
47 virtual const char* GetName() const { return "utility_source";}
50 * Succinct documentation.
52 virtual const char* GetTerseDocumentation() const
54 return "Specify the source tree of a third-party utility.";
60 virtual const char* GetFullDocumentation() const
63 " utility_source(cache_entry executable_name\n"
64 " path_to_source [file1 file2 ...])\n"
65 "When a third-party utility's source is included in the distribution, "
66 "this command specifies its location and name. The cache entry will "
67 "not be set unless the path_to_source and all listed files exist. It "
68 "is assumed that the source tree of the utility will have been built "
69 "before it is needed.\n"
70 "When cross compiling CMake will print a warning if a utility_source() "
71 "command is executed, because in many cases it is used to build an "
72 "executable which is executed later on. This doesn't work when "
73 "cross compiling, since the executable can run only on their target "
74 "platform. So in this case the cache entry has to be adjusted manually "
75 "so it points to an executable which is runnable on the build host.";
78 /** This command is kept for compatibility with older CMake versions. */
79 virtual bool IsDiscouraged() const
85 cmTypeMacro(cmUtilitySourceCommand, cmCommand);