1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmLoadCacheCommand.cxx,v $
6 Date: $Date: 2002-03-29 19:20:21 $
7 Version: $Revision: 1.10 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 #include "cmLoadCacheCommand.h"
21 bool cmLoadCacheCommand::InitialPass(std::vector
<std::string
> const& argsIn
)
25 this->SetError("called with wrong number of arguments.");
27 std::vector
<std::string
> args
;
28 cmSystemTools::ExpandListArguments(argsIn
, args
);
30 // Cache entries to be excluded from the import list.
31 // If this set is empty, all cache entries are brought in
32 // and they can not be overridden.
33 bool excludeFiles
=false;
35 std::set
<std::string
> excludes
;
37 for(i
=0; i
<args
.size(); i
++)
41 excludes
.insert(args
[i
]);
43 if (args
[i
] == "EXCLUDE")
47 if (excludeFiles
&& (args
[i
] == "INCLUDE_INTERNALS"))
53 // Internal cache entries to be imported.
54 // If this set is empty, no internal cache entries are
56 bool includeFiles
=false;
57 std::set
<std::string
> includes
;
59 for(i
=0; i
<args
.size(); i
++)
63 includes
.insert(args
[i
]);
65 if (args
[i
] == "INCLUDE_INTERNALS")
69 if (includeFiles
&& (args
[i
] == "EXCLUDE"))
75 // Loop over each build directory listed in the arguments. Each
76 // directory has a cache file.
77 for(i
=0; i
<args
.size(); i
++)
79 if ((args
[i
] == "EXCLUDE") || (args
[i
] == "INCLUDE_INTERNALS"))
83 cmCacheManager::GetInstance()->LoadCache(args
[i
].c_str(), false,