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 cmLoadCacheCommand_h
13 #define cmLoadCacheCommand_h
15 #include "cmCommand.h"
17 /** \class cmLoadCacheCommand
18 * \brief load a cache file
20 * cmLoadCacheCommand loads the non internal values of a cache file
22 class cmLoadCacheCommand : public cmCommand
26 * This is a virtual constructor for the command.
28 virtual cmCommand* Clone()
30 return new cmLoadCacheCommand;
34 * This is called when the command is first encountered in
35 * the CMakeLists.txt file.
37 virtual bool InitialPass(std::vector<std::string> const& args,
38 cmExecutionStatus &status);
41 * The name of the command as specified in CMakeList.txt.
43 virtual const char* GetName() const { return "load_cache";}
46 * Succinct documentation.
48 virtual const char* GetTerseDocumentation() const
50 return "Load in the values from another project's CMake cache.";
56 virtual const char* GetFullDocumentation() const
59 " load_cache(pathToCacheFile READ_WITH_PREFIX\n"
60 " prefix entry1...)\n"
61 "Read the cache and store the requested entries in variables with "
62 "their name prefixed with the given prefix. "
63 "This only reads the values, and does not create entries in the local "
65 " load_cache(pathToCacheFile [EXCLUDE entry1...]\n"
66 " [INCLUDE_INTERNALS entry1...])\n"
67 "Load in the values from another cache and store them in the local "
68 "project's cache as internal entries. This is useful for a project "
69 "that depends on another project built in a different tree. "
70 "EXCLUDE option can be used to provide a list of entries to be "
72 "INCLUDE_INTERNALS can be used to provide a list of internal entries "
73 "to be included. Normally, no internal entries are brought in. Use "
74 "of this form of the command is strongly discouraged, but it is "
75 "provided for backward compatibility.";
78 cmTypeMacro(cmLoadCacheCommand, cmCommand);
81 std::set<cmStdString> VariablesToRead;
84 bool ReadWithPrefix(std::vector<std::string> const& args);
85 void CheckLine(const char* line);