FIX: stupid pb fixed (close to being medieval'ed by The Ken)
[cmake.git] / Source / cmLoadCacheCommand.cxx
blob08e78a7a9c1bf18f3f540edb22b72ebec26a11cd
1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmLoadCacheCommand.cxx,v $
5 Language: C++
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"
20 // cmLoadcacheCommand
21 bool cmLoadCacheCommand::InitialPass(std::vector<std::string> const& argsIn)
23 if (argsIn.size()< 1)
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;
34 unsigned int i;
35 std::set<std::string> excludes;
37 for(i=0; i<args.size(); i++)
39 if (excludeFiles)
41 excludes.insert(args[i]);
43 if (args[i] == "EXCLUDE")
45 excludeFiles=true;
47 if (excludeFiles && (args[i] == "INCLUDE_INTERNALS"))
49 break;
53 // Internal cache entries to be imported.
54 // If this set is empty, no internal cache entries are
55 // brought in.
56 bool includeFiles=false;
57 std::set<std::string> includes;
59 for(i=0; i<args.size(); i++)
61 if (includeFiles)
63 includes.insert(args[i]);
65 if (args[i] == "INCLUDE_INTERNALS")
67 includeFiles=true;
69 if (includeFiles && (args[i] == "EXCLUDE"))
71 break;
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"))
81 break;
83 cmCacheManager::GetInstance()->LoadCache(args[i].c_str(), false,
84 excludes, includes);
88 return true;