cmFindBase.cxx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #include "cmFindBase.h"
  14. cmFindBase::cmFindBase()
  15. {
  16. cmSystemTools::ReplaceString(this->GenericDocumentationPathsOrder,
  17. "FIND_ARGS_XXX", "<VAR> NAMES name");
  18. this->AlreadyInCache = false;
  19. this->AlreadyInCacheWithoutMetaInfo = false;
  20. this->GenericDocumentation =
  21. " FIND_XXX(<VAR> name1 [path1 path2 ...])\n"
  22. "This is the short-hand signature for the command that "
  23. "is sufficient in many cases. It is the same "
  24. "as FIND_XXX(<VAR> name1 [PATHS path1 path2 ...])\n"
  25. " FIND_XXX(\n"
  26. " <VAR>\n"
  27. " name | NAMES name1 [name2 ...]\n"
  28. " [PATHS path1 [path2 ... ENV var]]\n"
  29. " [PATH_SUFFIXES suffix1 [suffix2 ...]]\n"
  30. " [DOC \"cache documentation string\"]\n"
  31. " [NO_DEFAULT_PATH]\n"
  32. " [NO_CMAKE_ENVIRONMENT_PATH]\n"
  33. " [NO_CMAKE_PATH]\n"
  34. " [NO_SYSTEM_ENVIRONMENT_PATH]\n"
  35. " [NO_CMAKE_SYSTEM_PATH]\n"
  36. " [CMAKE_FIND_ROOT_PATH_BOTH |\n"
  37. " ONLY_CMAKE_FIND_ROOT_PATH |\n"
  38. " NO_CMAKE_FIND_ROOT_PATH]\n"
  39. " )\n"
  40. ""
  41. "This command is used to find a SEARCH_XXX_DESC. "
  42. "A cache entry named by <VAR> is created to store the result "
  43. "of this command. "
  44. "If the SEARCH_XXX is found the result is stored in the variable "
  45. "and the search will not be repeated unless the variable is cleared. "
  46. "If nothing is found, the result will be "
  47. "<VAR>-NOTFOUND, and the search will be attempted again the "
  48. "next time FIND_XXX is invoked with the same variable. "
  49. "The name of the SEARCH_XXX that "
  50. "is searched for is specified by the names listed "
  51. "after the NAMES argument. Additional search locations "
  52. "can be specified after the PATHS argument. If ENV var is "
  53. "found in the PATHS section the environment variable var "
  54. "will be read and converted from a system environment variable to "
  55. "a cmake style list of paths. For example ENV PATH would be a way "
  56. "to list the system path variable. The argument "
  57. "after DOC will be used for the documentation string in "
  58. "the cache. PATH_SUFFIXES can be used to give sub directories "
  59. "that will be appended to the search paths.\n"
  60. "If NO_DEFAULT_PATH is specified, then no additional paths are "
  61. "added to the search. "
  62. "If NO_DEFAULT_PATH is not specified, the search process is as follows:\n"
  63. "1. Search cmake specific environment variables. This "
  64. "can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.\n"
  65. ""
  66. " <prefix>/XXX_SUBDIR for each <prefix> in CMAKE_PREFIX_PATH\n"
  67. " CMAKE_XXX_PATH\n"
  68. " CMAKE_XXX_MAC_PATH\n"
  69. "2. Search cmake variables with the same names as "
  70. "the cmake specific environment variables. These "
  71. "are intended to be used on the command line with a "
  72. "-DVAR=value. This can be skipped if NO_CMAKE_PATH "
  73. "is passed.\n"
  74. ""
  75. " <prefix>/XXX_SUBDIR for each <prefix> in CMAKE_PREFIX_PATH\n"
  76. " CMAKE_XXX_PATH\n"
  77. " CMAKE_XXX_MAC_PATH\n"
  78. "3. Search the standard system environment variables. "
  79. "This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.\n"
  80. " PATH\n"
  81. " XXX_SYSTEM\n" // replace with "", LIB, or INCLUDE
  82. "4. Search cmake variables defined in the Platform files "
  83. "for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH "
  84. "is passed.\n"
  85. " <prefix>/XXX_SUBDIR for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH\n"
  86. " CMAKE_SYSTEM_XXX_PATH\n"
  87. " CMAKE_SYSTEM_XXX_MAC_PATH\n"
  88. "5. Search the paths specified after PATHS or in the short-hand version "
  89. "of the command.\n"
  90. ;
  91. this->GenericDocumentation += this->GenericDocumentationMacPolicy;
  92. this->GenericDocumentation += this->GenericDocumentationRootPath;
  93. this->GenericDocumentation += this->GenericDocumentationPathsOrder;
  94. }
  95. bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
  96. {
  97. if(argsIn.size() < 2 )
  98. {
  99. this->SetError("called with incorrect number of arguments");
  100. return false;
  101. }
  102. // CMake versions below 2.3 did not search all these extra
  103. // locations. Preserve compatibility unless a modern argument is
  104. // passed.
  105. bool compatibility = this->Makefile->NeedBackwardsCompatibility(2,3);
  106. // copy argsIn into args so it can be modified,
  107. // in the process extract the DOC "documentation"
  108. size_t size = argsIn.size();
  109. std::vector<std::string> args;
  110. bool foundDoc = false;
  111. for(unsigned int j = 0; j < size; ++j)
  112. {
  113. if(foundDoc || argsIn[j] != "DOC" )
  114. {
  115. if(argsIn[j] == "ENV")
  116. {
  117. if(j+1 < size)
  118. {
  119. j++;
  120. cmSystemTools::GetPath(args, argsIn[j].c_str());
  121. }
  122. }
  123. else
  124. {
  125. args.push_back(argsIn[j]);
  126. }
  127. }
  128. else
  129. {
  130. if(j+1 < size)
  131. {
  132. foundDoc = true;
  133. this->VariableDocumentation = argsIn[j+1];
  134. j++;
  135. if(j >= size)
  136. {
  137. break;
  138. }
  139. }
  140. }
  141. }
  142. this->VariableName = args[0];
  143. if(this->CheckForVariableInCache())
  144. {
  145. this->AlreadyInCache = true;
  146. return true;
  147. }
  148. this->AlreadyInCache = false;
  149. // Find the current root path mode.
  150. this->SelectDefaultRootPathMode();
  151. // Find the current bundle/framework search policy.
  152. this->SelectDefaultMacMode();
  153. std::vector<std::string> userPaths;
  154. std::string doc;
  155. bool doingNames = true; // assume it starts with a name
  156. bool doingPaths = false;
  157. bool doingPathSuf = false;
  158. bool newStyle = false;
  159. for (unsigned int j = 1; j < args.size(); ++j)
  160. {
  161. if(args[j] == "NAMES")
  162. {
  163. doingNames = true;
  164. newStyle = true;
  165. doingPathSuf = false;
  166. doingPaths = false;
  167. }
  168. else if (args[j] == "PATHS")
  169. {
  170. doingPaths = true;
  171. newStyle = true;
  172. doingNames = false;
  173. doingPathSuf = false;
  174. }
  175. else if (args[j] == "PATH_SUFFIXES")
  176. {
  177. compatibility = false;
  178. doingPathSuf = true;
  179. newStyle = true;
  180. doingNames = false;
  181. doingPaths = false;
  182. }
  183. else if (args[j] == "NO_SYSTEM_PATH")
  184. {
  185. doingPaths = false;
  186. doingPathSuf = false;
  187. doingNames = false;
  188. this->NoDefaultPath = true;
  189. }
  190. else if (this->CheckCommonArgument(args[j]))
  191. {
  192. compatibility = false;
  193. doingPaths = false;
  194. doingPathSuf = false;
  195. doingNames = false;
  196. }
  197. else
  198. {
  199. if(doingNames)
  200. {
  201. this->Names.push_back(args[j]);
  202. }
  203. else if(doingPaths)
  204. {
  205. userPaths.push_back(args[j]);
  206. }
  207. else if(doingPathSuf)
  208. {
  209. this->AddPathSuffix(args[j]);
  210. }
  211. }
  212. }
  213. // Now that arguments have been parsed check the compatibility
  214. // setting. If we need to be compatible with CMake 2.2 and earlier
  215. // do not add the CMake system paths. It is safe to add the CMake
  216. // environment paths and system environment paths because that
  217. // existed in 2.2. It is safe to add the CMake user variable paths
  218. // because the user or project has explicitly set them.
  219. if(compatibility)
  220. {
  221. this->NoCMakeSystemPath = true;
  222. }
  223. if(this->VariableDocumentation.size() == 0)
  224. {
  225. this->VariableDocumentation = "Where can ";
  226. if(this->Names.size() == 0)
  227. {
  228. this->VariableDocumentation += "the (unknown) library be found";
  229. }
  230. else if(this->Names.size() == 1)
  231. {
  232. this->VariableDocumentation += "the "
  233. + this->Names[0] + " library be found";
  234. }
  235. else
  236. {
  237. this->VariableDocumentation += "one of the " + this->Names[0];
  238. for (unsigned int j = 1; j < this->Names.size() - 1; ++j)
  239. {
  240. this->VariableDocumentation += ", " + this->Names[j];
  241. }
  242. this->VariableDocumentation += " or "
  243. + this->Names[this->Names.size() - 1] + " libraries be found";
  244. }
  245. }
  246. // look for old style
  247. // FIND_*(VAR name path1 path2 ...)
  248. if(!newStyle)
  249. {
  250. this->Names.clear(); // clear out any values in Names
  251. this->Names.push_back(args[1]);
  252. for(unsigned int j = 2; j < args.size(); ++j)
  253. {
  254. userPaths.push_back(args[j]);
  255. }
  256. }
  257. this->ExpandPaths(userPaths);
  258. // Handle search root stuff.
  259. this->RerootPaths(this->SearchPaths);
  260. return true;
  261. }
  262. void cmFindBase::ExpandPaths(std::vector<std::string> userPaths)
  263. {
  264. // if NO Default paths was not specified add the
  265. // standard search paths.
  266. if(!this->NoDefaultPath)
  267. {
  268. if(this->SearchFrameworkFirst || this->SearchFrameworkOnly)
  269. {
  270. this->AddFrameWorkPaths();
  271. }
  272. if(this->SearchAppBundleFirst || this->SearchAppBundleOnly)
  273. {
  274. this->AddAppBundlePaths();
  275. }
  276. if(!this->NoCMakeEnvironmentPath &&
  277. !(this->SearchFrameworkOnly || this->SearchAppBundleOnly))
  278. {
  279. // Add CMAKE_*_PATH environment variables
  280. this->AddEnvironmentVariables();
  281. }
  282. if(!this->NoCMakePath &&
  283. !(this->SearchFrameworkOnly || this->SearchAppBundleOnly))
  284. {
  285. // Add CMake varibles of the same name as the previous environment
  286. // varibles CMAKE_*_PATH to be used most of the time with -D
  287. // command line options
  288. this->AddCMakeVariables();
  289. }
  290. if(!this->NoSystemEnvironmentPath &&
  291. !(this->SearchFrameworkOnly || this->SearchAppBundleOnly))
  292. {
  293. // add System environment PATH and (LIB or INCLUDE)
  294. this->AddSystemEnvironmentVariables();
  295. }
  296. if(!this->NoCMakeSystemPath &&
  297. !(this->SearchFrameworkOnly || this->SearchAppBundleOnly))
  298. {
  299. // Add CMAKE_SYSTEM_*_PATH variables which are defined in platform files
  300. this->AddCMakeSystemVariables();
  301. }
  302. if(this->SearchAppBundleLast)
  303. {
  304. this->AddAppBundlePaths();
  305. }
  306. if(this->SearchFrameworkLast)
  307. {
  308. this->AddFrameWorkPaths();
  309. }
  310. }
  311. std::vector<std::string> paths;
  312. // add the paths specified in the FIND_* call
  313. for(unsigned int i =0; i < userPaths.size(); ++i)
  314. {
  315. paths.push_back(userPaths[i]);
  316. }
  317. this->AddPaths(paths);
  318. }
  319. //----------------------------------------------------------------------------
  320. void cmFindBase::AddEnvironmentVariables()
  321. {
  322. std::vector<std::string> paths;
  323. std::vector<std::string> prefixPaths;
  324. cmSystemTools::GetPath(prefixPaths, "CMAKE_PREFIX_PATH");
  325. this->AddFindPrefix(paths, prefixPaths);
  326. std::string var = "CMAKE_";
  327. var += this->CMakePathName;
  328. var += "_PATH";
  329. cmSystemTools::GetPath(paths, var.c_str());
  330. this->AddPaths(paths);
  331. }
  332. void cmFindBase::AddFindPrefix(std::vector<std::string>& dest,
  333. const std::vector<std::string>& src)
  334. {
  335. // default for programs
  336. std::string subdir = "bin";
  337. if (this->CMakePathName == "INCLUDE")
  338. {
  339. subdir = "include";
  340. }
  341. else if (this->CMakePathName == "LIBRARY")
  342. {
  343. subdir = "lib";
  344. }
  345. else if (this->CMakePathName == "FRAMEWORK")
  346. {
  347. subdir = ""; // ? what to do for frameworks ?
  348. }
  349. for (std::vector<std::string>::const_iterator it = src.begin();
  350. it != src.end();
  351. ++it)
  352. {
  353. std::string dir = it->c_str();
  354. if(!subdir.empty() && !dir.empty() && dir[dir.size()-1] != '/')
  355. {
  356. dir += "/";
  357. }
  358. std::string add = dir + subdir;
  359. if(add != "/")
  360. {
  361. dest.push_back(add);
  362. }
  363. if (subdir == "bin")
  364. {
  365. dest.push_back(dir + "sbin");
  366. }
  367. if(!subdir.empty() && *it != "/")
  368. {
  369. dest.push_back(*it);
  370. }
  371. }
  372. }
  373. void cmFindBase::AddFrameWorkPaths()
  374. {
  375. std::vector<std::string> paths;
  376. this->GetFrameworkPaths(paths);
  377. this->AddPaths(paths);
  378. }
  379. void cmFindBase::AddPaths(std::vector<std::string> & paths)
  380. {
  381. // add suffixes and clean up paths
  382. this->ExpandRegistryAndCleanPath(paths);
  383. // add the paths to the search paths
  384. this->SearchPaths.insert(this->SearchPaths.end(),
  385. paths.begin(),
  386. paths.end());
  387. }
  388. void cmFindBase::AddAppBundlePaths()
  389. {
  390. std::vector<std::string> paths;
  391. this->GetAppBundlePaths(paths);
  392. this->AddPaths(paths);
  393. }
  394. void cmFindBase::AddCMakeVariables()
  395. {
  396. std::string var = "CMAKE_";
  397. var += this->CMakePathName;
  398. var += "_PATH";
  399. std::vector<std::string> paths;
  400. if(const char* prefixPath =
  401. this->Makefile->GetDefinition("CMAKE_PREFIX_PATH"))
  402. {
  403. std::vector<std::string> prefixPaths;
  404. cmSystemTools::ExpandListArgument(prefixPath, prefixPaths);
  405. this->AddFindPrefix(paths, prefixPaths);
  406. }
  407. if(const char* path = this->Makefile->GetDefinition(var.c_str()))
  408. {
  409. cmSystemTools::ExpandListArgument(path, paths);
  410. }
  411. this->AddPaths(paths);
  412. }
  413. void cmFindBase::AddSystemEnvironmentVariables()
  414. {
  415. // Add LIB or INCLUDE
  416. std::vector<std::string> paths;
  417. if(this->EnvironmentPath.size())
  418. {
  419. cmSystemTools::GetPath(paths, this->EnvironmentPath.c_str());
  420. }
  421. // Add PATH
  422. cmSystemTools::GetPath(paths);
  423. this->AddPaths(paths);
  424. }
  425. void cmFindBase::AddCMakeSystemVariables()
  426. {
  427. std::string var = "CMAKE_SYSTEM_";
  428. var += this->CMakePathName;
  429. var += "_PATH";
  430. std::vector<std::string> paths;
  431. if(const char* prefixPath =
  432. this->Makefile->GetDefinition("CMAKE_SYSTEM_PREFIX_PATH"))
  433. {
  434. std::vector<std::string> prefixPaths;
  435. cmSystemTools::ExpandListArgument(prefixPath, prefixPaths);
  436. this->AddFindPrefix(paths, prefixPaths);
  437. }
  438. if(const char* path = this->Makefile->GetDefinition(var.c_str()))
  439. {
  440. cmSystemTools::ExpandListArgument(path, paths);
  441. }
  442. this->AddPaths(paths);
  443. }
  444. void cmFindBase::ExpandRegistryAndCleanPath(std::vector<std::string>& paths)
  445. {
  446. // We should view the registry as the target application would view
  447. // it.
  448. cmSystemTools::KeyWOW64 view = cmSystemTools::KeyWOW64_Default;
  449. cmSystemTools::KeyWOW64 other_view = cmSystemTools::KeyWOW64_Default;
  450. {
  451. if(const char* psize =
  452. this->Makefile->GetDefinition("CMAKE_SIZEOF_VOID_P"))
  453. {
  454. switch(atoi(psize))
  455. {
  456. case 4:
  457. view = cmSystemTools::KeyWOW64_32;
  458. other_view = cmSystemTools::KeyWOW64_64;
  459. break;
  460. case 8:
  461. view = cmSystemTools::KeyWOW64_64;
  462. other_view = cmSystemTools::KeyWOW64_32;
  463. break;
  464. default: break;
  465. }
  466. }
  467. }
  468. std::vector<std::string> finalPath;
  469. std::vector<std::string>::iterator i;
  470. // glob and expand registry stuff from paths and put
  471. // into finalPath
  472. for(i = paths.begin();
  473. i != paths.end(); ++i)
  474. {
  475. std::string expanded = *i;
  476. cmSystemTools::ExpandRegistryValues(expanded, view);
  477. cmSystemTools::GlobDirs(expanded.c_str(), finalPath);
  478. if(view != other_view && expanded != *i &&
  479. this->CMakePathName == "PROGRAM")
  480. {
  481. // Executables can be either 32-bit or 64-bit.
  482. expanded = *i;
  483. cmSystemTools::ExpandRegistryValues(expanded, other_view);
  484. cmSystemTools::GlobDirs(expanded.c_str(), finalPath);
  485. }
  486. }
  487. // clear the path
  488. paths.clear();
  489. // convert all paths to unix slashes and add search path suffixes
  490. // if there are any
  491. for(i = finalPath.begin();
  492. i != finalPath.end(); ++i)
  493. {
  494. cmSystemTools::ConvertToUnixSlashes(*i);
  495. // copy each finalPath combined with SearchPathSuffixes
  496. // to the SearchPaths ivar
  497. for(std::vector<std::string>::iterator j =
  498. this->SearchPathSuffixes.begin();
  499. j != this->SearchPathSuffixes.end(); ++j)
  500. {
  501. // if *i is only / then do not add a //
  502. // this will get incorrectly considered a network
  503. // path on windows and cause huge delays.
  504. std::string p = *i;
  505. if(p.size() && p[p.size()-1] != '/')
  506. {
  507. p += std::string("/");
  508. }
  509. p += *j;
  510. // add to all paths because the search path may be modified
  511. // later with lib being replaced for lib64 which may exist
  512. paths.push_back(p);
  513. }
  514. }
  515. // now put the path without the path suffixes in the SearchPaths
  516. for(i = finalPath.begin();
  517. i != finalPath.end(); ++i)
  518. {
  519. // put all search paths in because it may later be replaced
  520. // by lib64 stuff fixes bug 4009
  521. paths.push_back(*i);
  522. }
  523. }
  524. void cmFindBase::PrintFindStuff()
  525. {
  526. std::cerr << "SearchFrameworkLast: " << this->SearchFrameworkLast << "\n";
  527. std::cerr << "SearchFrameworkOnly: " << this->SearchFrameworkOnly << "\n";
  528. std::cerr << "SearchFrameworkFirst: " << this->SearchFrameworkFirst << "\n";
  529. std::cerr << "SearchAppBundleLast: " << this->SearchAppBundleLast << "\n";
  530. std::cerr << "SearchAppBundleOnly: " << this->SearchAppBundleOnly << "\n";
  531. std::cerr << "SearchAppBundleFirst: " << this->SearchAppBundleFirst << "\n";
  532. std::cerr << "VariableName " << this->VariableName << "\n";
  533. std::cerr << "VariableDocumentation "
  534. << this->VariableDocumentation << "\n";
  535. std::cerr << "NoDefaultPath " << this->NoDefaultPath << "\n";
  536. std::cerr << "NoCMakeEnvironmentPath "
  537. << this->NoCMakeEnvironmentPath << "\n";
  538. std::cerr << "NoCMakePath " << this->NoCMakePath << "\n";
  539. std::cerr << "NoSystemEnvironmentPath "
  540. << this->NoSystemEnvironmentPath << "\n";
  541. std::cerr << "NoCMakeSystemPath " << this->NoCMakeSystemPath << "\n";
  542. std::cerr << "EnvironmentPath " << this->EnvironmentPath << "\n";
  543. std::cerr << "CMakePathName " << this->CMakePathName << "\n";
  544. std::cerr << "Names ";
  545. for(unsigned int i =0; i < this->Names.size(); ++i)
  546. {
  547. std::cerr << this->Names[i] << " ";
  548. }
  549. std::cerr << "\n";
  550. std::cerr << "\n";
  551. std::cerr << "SearchPathSuffixes ";
  552. for(unsigned int i =0; i < this->SearchPathSuffixes.size(); ++i)
  553. {
  554. std::cerr << this->SearchPathSuffixes[i] << "\n";
  555. }
  556. std::cerr << "\n";
  557. std::cerr << "SearchPaths\n";
  558. for(unsigned int i =0; i < this->SearchPaths.size(); ++i)
  559. {
  560. std::cerr << "[" << this->SearchPaths[i] << "]\n";
  561. }
  562. }
  563. bool cmFindBase::CheckForVariableInCache()
  564. {
  565. if(const char* cacheValue =
  566. this->Makefile->GetDefinition(this->VariableName.c_str()))
  567. {
  568. cmCacheManager::CacheIterator it =
  569. this->Makefile->GetCacheManager()->
  570. GetCacheIterator(this->VariableName.c_str());
  571. bool found = !cmSystemTools::IsNOTFOUND(cacheValue);
  572. bool cached = !it.IsAtEnd();
  573. if(found)
  574. {
  575. // If the user specifies the entry on the command line without a
  576. // type we should add the type and docstring but keep the
  577. // original value. Tell the subclass implementations to do
  578. // this.
  579. if(cached && it.GetType() == cmCacheManager::UNINITIALIZED)
  580. {
  581. this->AlreadyInCacheWithoutMetaInfo = true;
  582. }
  583. return true;
  584. }
  585. else if(cached)
  586. {
  587. const char* hs = it.GetProperty("HELPSTRING");
  588. this->VariableDocumentation = hs?hs:"(none)";
  589. }
  590. }
  591. return false;
  592. }