cmPolicies.cxx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. #include "cmPolicies.h"
  2. #include "cmake.h"
  3. #include "cmMakefile.h"
  4. #include "cmSourceFile.h"
  5. #include "cmVersion.h"
  6. #include "cmVersionMacros.h"
  7. #include <map>
  8. #include <set>
  9. #include <queue>
  10. #include <assert.h>
  11. const char* cmPolicies::PolicyStatusNames[] = {
  12. "OLD", "WARN", "NEW", "REQUIRED_IF_USED", "REQUIRED_ALWAYS"
  13. };
  14. class cmPolicy
  15. {
  16. public:
  17. cmPolicy(cmPolicies::PolicyID iD,
  18. const char *idString,
  19. const char *shortDescription,
  20. unsigned int majorVersionIntroduced,
  21. unsigned int minorVersionIntroduced,
  22. unsigned int patchVersionIntroduced,
  23. unsigned int tweakVersionIntroduced,
  24. cmPolicies::PolicyStatus status)
  25. {
  26. if (!idString || !shortDescription)
  27. {
  28. cmSystemTools::Error("Attempt to define a policy without "
  29. "all parameters being specified!");
  30. return;
  31. }
  32. this->ID = iD;
  33. this->IDString = idString;
  34. this->ShortDescription = shortDescription;
  35. this->MajorVersionIntroduced = majorVersionIntroduced;
  36. this->MinorVersionIntroduced = minorVersionIntroduced;
  37. this->PatchVersionIntroduced = patchVersionIntroduced;
  38. this->TweakVersionIntroduced = tweakVersionIntroduced;
  39. this->Status = status;
  40. }
  41. std::string GetVersionString()
  42. {
  43. cmOStringStream v;
  44. v << this->MajorVersionIntroduced << "." << this->MinorVersionIntroduced;
  45. v << "." << this->PatchVersionIntroduced;
  46. if(this->TweakVersionIntroduced > 0)
  47. {
  48. v << "." << this->TweakVersionIntroduced;
  49. }
  50. return v.str();
  51. }
  52. bool IsPolicyNewerThan(unsigned int majorV,
  53. unsigned int minorV,
  54. unsigned int patchV,
  55. unsigned int tweakV)
  56. {
  57. if (majorV < this->MajorVersionIntroduced)
  58. {
  59. return true;
  60. }
  61. if (majorV > this->MajorVersionIntroduced)
  62. {
  63. return false;
  64. }
  65. if (minorV < this->MinorVersionIntroduced)
  66. {
  67. return true;
  68. }
  69. if (minorV > this->MinorVersionIntroduced)
  70. {
  71. return false;
  72. }
  73. if (patchV < this->PatchVersionIntroduced)
  74. {
  75. return true;
  76. }
  77. if (patchV > this->PatchVersionIntroduced)
  78. {
  79. return false;
  80. }
  81. return (tweakV < this->TweakVersionIntroduced);
  82. }
  83. cmPolicies::PolicyID ID;
  84. std::string IDString;
  85. std::string ShortDescription;
  86. unsigned int MajorVersionIntroduced;
  87. unsigned int MinorVersionIntroduced;
  88. unsigned int PatchVersionIntroduced;
  89. unsigned int TweakVersionIntroduced;
  90. cmPolicies::PolicyStatus Status;
  91. };
  92. cmPolicies::cmPolicies()
  93. {
  94. // define all the policies
  95. this->DefinePolicy(
  96. CMP0000, "CMP0000",
  97. "A minimum required CMake version must be specified.",
  98. 2,6,0,0, cmPolicies::WARN
  99. );
  100. this->DefinePolicy(
  101. CMP0001, "CMP0001",
  102. "CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.",
  103. 2,6,0,0, cmPolicies::WARN
  104. );
  105. this->DefinePolicy(
  106. CMP0002, "CMP0002",
  107. "Logical target names must be globally unique.",
  108. 2,6,0,0, cmPolicies::WARN
  109. );
  110. this->DefinePolicy(
  111. CMP0003, "CMP0003",
  112. "Libraries linked via full path no longer produce linker search paths.",
  113. 2,6,0,0, cmPolicies::WARN);
  114. this->DefinePolicy(
  115. CMP0004, "CMP0004",
  116. "Libraries linked may not have leading or trailing whitespace.",
  117. 2,6,0,0, cmPolicies::WARN);
  118. this->DefinePolicy(
  119. CMP0005, "CMP0005",
  120. "Preprocessor definition values are now escaped automatically.",
  121. 2,6,0,0, cmPolicies::WARN);
  122. this->DefinePolicy(
  123. CMP0006, "CMP0006",
  124. "Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION.",
  125. 2,6,0,0, cmPolicies::WARN);
  126. this->DefinePolicy(
  127. CMP0007, "CMP0007",
  128. "list command no longer ignores empty elements.",
  129. 2,6,0,0, cmPolicies::WARN);
  130. this->DefinePolicy(
  131. CMP0008, "CMP0008",
  132. "Libraries linked by full-path must have a valid library file name.",
  133. 2,6,1,0, cmPolicies::WARN);
  134. this->DefinePolicy(
  135. CMP0009, "CMP0009",
  136. "FILE GLOB_RECURSE calls should not follow symlinks by default.",
  137. 2,6,2,0, cmPolicies::WARN);
  138. this->DefinePolicy(
  139. CMP0010, "CMP0010",
  140. "Bad variable reference syntax is an error.",
  141. 2,6,3,0, cmPolicies::WARN);
  142. this->DefinePolicy(
  143. CMP0011, "CMP0011",
  144. "Included scripts do automatic cmake_policy PUSH and POP.",
  145. 2,6,3,0, cmPolicies::WARN);
  146. this->DefinePolicy(
  147. CMP0012, "CMP0012",
  148. "if() recognizes numbers and boolean constants.",
  149. 2,8,0,0, cmPolicies::WARN);
  150. this->DefinePolicy(
  151. CMP0013, "CMP0013",
  152. "Duplicate binary directories are not allowed.",
  153. 2,8,0,0, cmPolicies::WARN);
  154. this->DefinePolicy(
  155. CMP0014, "CMP0014",
  156. "Input directories must have CMakeLists.txt.",
  157. 2,8,0,0, cmPolicies::WARN);
  158. this->DefinePolicy(
  159. CMP0015, "CMP0015",
  160. "link_directories() treats paths relative to the source dir.",
  161. 2,8,1,0, cmPolicies::WARN);
  162. this->DefinePolicy(
  163. CMP0016, "CMP0016",
  164. "target_link_libraries() reports error if its only argument "
  165. "is not a target.",
  166. 2,8,3,0, cmPolicies::WARN);
  167. this->DefinePolicy(
  168. CMP0017, "CMP0017",
  169. "Prefer files from the CMake module directory when including from there.",
  170. 2,8,4,0, cmPolicies::WARN);
  171. this->DefinePolicy(
  172. CMP0018, "CMP0018",
  173. "Ignore CMAKE_SHARED_LIBRARY_<Lang>_FLAGS variable.",
  174. 2,8,9,0, cmPolicies::WARN);
  175. this->DefinePolicy(
  176. CMP0019, "CMP0019",
  177. "Do not re-expand variables in include and link information.",
  178. 2,8,11,0, cmPolicies::WARN);
  179. this->DefinePolicy(
  180. CMP0020, "CMP0020",
  181. "Automatically link Qt executables to qtmain target on Windows.",
  182. 2,8,11,0, cmPolicies::WARN);
  183. this->DefinePolicy(
  184. CMP0021, "CMP0021",
  185. "Fatal error on relative paths in INCLUDE_DIRECTORIES target property.",
  186. 2,8,12,0, cmPolicies::WARN);
  187. this->DefinePolicy(
  188. CMP0022, "CMP0022",
  189. "INTERFACE_LINK_LIBRARIES defines the link interface.",
  190. 2,8,12,0, cmPolicies::WARN);
  191. this->DefinePolicy(
  192. CMP0023, "CMP0023",
  193. "Plain and keyword target_link_libraries signatures cannot be mixed.",
  194. 2,8,12,0, cmPolicies::WARN);
  195. this->DefinePolicy(
  196. CMP0024, "CMP0024",
  197. "Disallow include export result.",
  198. 3,0,0,0, cmPolicies::WARN);
  199. this->DefinePolicy(
  200. CMP0025, "CMP0025",
  201. "Compiler id for Apple Clang is now AppleClang.",
  202. 3,0,0,0, cmPolicies::WARN);
  203. this->DefinePolicy(
  204. CMP0026, "CMP0026",
  205. "Disallow use of the LOCATION target property.",
  206. 3,0,0,0, cmPolicies::WARN);
  207. this->DefinePolicy(
  208. CMP0027, "CMP0027",
  209. "Conditionally linked imported targets with missing include directories.",
  210. 3,0,0,0, cmPolicies::WARN);
  211. this->DefinePolicy(
  212. CMP0028, "CMP0028",
  213. "Double colon in target name means ALIAS or IMPORTED target.",
  214. 3,0,0,0, cmPolicies::WARN);
  215. this->DefinePolicy(
  216. CMP0029, "CMP0029",
  217. "The subdir_depends command should not be called.",
  218. 3,0,0,0, cmPolicies::WARN);
  219. this->DefinePolicy(
  220. CMP0030, "CMP0030",
  221. "The use_mangled_mesa command should not be called.",
  222. 3,0,0,0, cmPolicies::WARN);
  223. this->DefinePolicy(
  224. CMP0031, "CMP0031",
  225. "The load_command command should not be called.",
  226. 3,0,0,0, cmPolicies::WARN);
  227. this->DefinePolicy(
  228. CMP0032, "CMP0032",
  229. "The output_required_files command should not be called.",
  230. 3,0,0,0, cmPolicies::WARN);
  231. this->DefinePolicy(
  232. CMP0033, "CMP0033",
  233. "The export_library_dependencies command should not be called.",
  234. 3,0,0,0, cmPolicies::WARN);
  235. this->DefinePolicy(
  236. CMP0034, "CMP0034",
  237. "The utility_source command should not be called.",
  238. 3,0,0,0, cmPolicies::WARN);
  239. this->DefinePolicy(
  240. CMP0035, "CMP0035",
  241. "The variable_requires command should not be called.",
  242. 3,0,0,0, cmPolicies::WARN);
  243. this->DefinePolicy(
  244. CMP0036, "CMP0036",
  245. "The build_name command should not be called.",
  246. 3,0,0,0, cmPolicies::WARN);
  247. this->DefinePolicy(
  248. CMP0037, "CMP0037",
  249. "Target names should not be reserved and should match a validity pattern.",
  250. 3,0,0,0, cmPolicies::WARN);
  251. this->DefinePolicy(
  252. CMP0038, "CMP0038",
  253. "Targets may not link directly to themselves.",
  254. 3,0,0,0, cmPolicies::WARN);
  255. this->DefinePolicy(
  256. CMP0039, "CMP0039",
  257. "Utility targets may not have link dependencies.",
  258. 3,0,0,0, cmPolicies::WARN);
  259. this->DefinePolicy(
  260. CMP0040, "CMP0040",
  261. "The target in the TARGET signature of add_custom_command() must exist.",
  262. 3,0,0,0, cmPolicies::WARN);
  263. this->DefinePolicy(
  264. CMP0041, "CMP0041",
  265. "Error on relative include with generator expression.",
  266. 3,0,0,0, cmPolicies::WARN);
  267. this->DefinePolicy(
  268. CMP0042, "CMP0042",
  269. "MACOSX_RPATH is enabled by default.",
  270. 3,0,0,0, cmPolicies::WARN);
  271. this->DefinePolicy(
  272. CMP0043, "CMP0043",
  273. "Ignore COMPILE_DEFINITIONS_<Config> properties.",
  274. 3,0,0,0, cmPolicies::WARN);
  275. this->DefinePolicy(
  276. CMP0044, "CMP0044",
  277. "Case sensitive <LANG>_COMPILER_ID generator expressions.",
  278. 3,0,0,0, cmPolicies::WARN);
  279. }
  280. cmPolicies::~cmPolicies()
  281. {
  282. // free the policies
  283. std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
  284. = this->Policies.begin();
  285. for (;i != this->Policies.end(); ++i)
  286. {
  287. delete i->second;
  288. }
  289. }
  290. void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD,
  291. const char *idString,
  292. const char *shortDescription,
  293. unsigned int majorVersionIntroduced,
  294. unsigned int minorVersionIntroduced,
  295. unsigned int patchVersionIntroduced,
  296. unsigned int tweakVersionIntroduced,
  297. cmPolicies::PolicyStatus status)
  298. {
  299. // a policy must be unique and can only be defined once
  300. if (this->Policies.find(iD) != this->Policies.end())
  301. {
  302. cmSystemTools::Error("Attempt to redefine a CMake policy for policy "
  303. "ID ", this->GetPolicyIDString(iD).c_str());
  304. return;
  305. }
  306. this->Policies[iD] = new cmPolicy(iD, idString,
  307. shortDescription,
  308. majorVersionIntroduced,
  309. minorVersionIntroduced,
  310. patchVersionIntroduced,
  311. tweakVersionIntroduced,
  312. status);
  313. this->PolicyStringMap[idString] = iD;
  314. }
  315. //----------------------------------------------------------------------------
  316. bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
  317. const char *version)
  318. {
  319. std::string ver = "2.4.0";
  320. if (version && strlen(version) > 0)
  321. {
  322. ver = version;
  323. }
  324. unsigned int majorVer = 2;
  325. unsigned int minorVer = 0;
  326. unsigned int patchVer = 0;
  327. unsigned int tweakVer = 0;
  328. // parse the string
  329. if(sscanf(ver.c_str(), "%u.%u.%u.%u",
  330. &majorVer, &minorVer, &patchVer, &tweakVer) < 2)
  331. {
  332. cmOStringStream e;
  333. e << "Invalid policy version value \"" << ver << "\". "
  334. << "A numeric major.minor[.patch[.tweak]] must be given.";
  335. mf->IssueMessage(cmake::FATAL_ERROR, e.str());
  336. return false;
  337. }
  338. // it is an error if the policy version is less than 2.4
  339. if (majorVer < 2 || (majorVer == 2 && minorVer < 4))
  340. {
  341. mf->IssueMessage(cmake::FATAL_ERROR,
  342. "Compatibility with CMake < 2.4 is not supported by CMake >= 3.0. "
  343. "For compatibility with older versions please use any CMake 2.8.x "
  344. "release or lower.");
  345. return false;
  346. }
  347. // It is an error if the policy version is greater than the running
  348. // CMake.
  349. if (majorVer > cmVersion::GetMajorVersion() ||
  350. (majorVer == cmVersion::GetMajorVersion() &&
  351. minorVer > cmVersion::GetMinorVersion()) ||
  352. (majorVer == cmVersion::GetMajorVersion() &&
  353. minorVer == cmVersion::GetMinorVersion() &&
  354. patchVer > cmVersion::GetPatchVersion()) ||
  355. (majorVer == cmVersion::GetMajorVersion() &&
  356. minorVer == cmVersion::GetMinorVersion() &&
  357. patchVer == cmVersion::GetPatchVersion() &&
  358. tweakVer > cmVersion::GetTweakVersion()))
  359. {
  360. cmOStringStream e;
  361. e << "An attempt was made to set the policy version of CMake to \""
  362. << version << "\" which is greater than this version of CMake. "
  363. << "This is not allowed because the greater version may have new "
  364. << "policies not known to this CMake. "
  365. << "You may need a newer CMake version to build this project.";
  366. mf->IssueMessage(cmake::FATAL_ERROR, e.str());
  367. return false;
  368. }
  369. // now loop over all the policies and set them as appropriate
  370. std::vector<cmPolicies::PolicyID> ancientPolicies;
  371. for(std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
  372. = this->Policies.begin(); i != this->Policies.end(); ++i)
  373. {
  374. if (i->second->IsPolicyNewerThan(majorVer,minorVer,patchVer,tweakVer))
  375. {
  376. if(i->second->Status == cmPolicies::REQUIRED_ALWAYS)
  377. {
  378. ancientPolicies.push_back(i->first);
  379. }
  380. else
  381. {
  382. cmPolicies::PolicyStatus status = cmPolicies::WARN;
  383. if(!this->GetPolicyDefault(mf, i->second->IDString, &status) ||
  384. !mf->SetPolicy(i->second->ID, status))
  385. {
  386. return false;
  387. }
  388. }
  389. }
  390. else
  391. {
  392. if (!mf->SetPolicy(i->second->ID, cmPolicies::NEW))
  393. {
  394. return false;
  395. }
  396. }
  397. }
  398. // Make sure the project does not use any ancient policies.
  399. if(!ancientPolicies.empty())
  400. {
  401. this->DiagnoseAncientPolicies(ancientPolicies,
  402. majorVer, minorVer, patchVer, mf);
  403. cmSystemTools::SetFatalErrorOccured();
  404. return false;
  405. }
  406. return true;
  407. }
  408. //----------------------------------------------------------------------------
  409. bool cmPolicies::GetPolicyDefault(cmMakefile* mf, std::string const& policy,
  410. cmPolicies::PolicyStatus* defaultSetting)
  411. {
  412. std::string defaultVar = "CMAKE_POLICY_DEFAULT_" + policy;
  413. std::string defaultValue = mf->GetSafeDefinition(defaultVar.c_str());
  414. if(defaultValue == "NEW")
  415. {
  416. *defaultSetting = cmPolicies::NEW;
  417. }
  418. else if(defaultValue == "OLD")
  419. {
  420. *defaultSetting = cmPolicies::OLD;
  421. }
  422. else if(defaultValue == "")
  423. {
  424. *defaultSetting = cmPolicies::WARN;
  425. }
  426. else
  427. {
  428. cmOStringStream e;
  429. e << defaultVar << " has value \"" << defaultValue
  430. << "\" but must be \"OLD\", \"NEW\", or \"\" (empty).";
  431. mf->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
  432. return false;
  433. }
  434. return true;
  435. }
  436. bool cmPolicies::GetPolicyID(const char *id, cmPolicies::PolicyID &pid)
  437. {
  438. if (!id || strlen(id) < 1)
  439. {
  440. return false;
  441. }
  442. std::map<std::string,cmPolicies::PolicyID>::iterator pos =
  443. this->PolicyStringMap.find(id);
  444. if (pos == this->PolicyStringMap.end())
  445. {
  446. return false;
  447. }
  448. pid = pos->second;
  449. return true;
  450. }
  451. std::string cmPolicies::GetPolicyIDString(cmPolicies::PolicyID pid)
  452. {
  453. std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
  454. this->Policies.find(pid);
  455. if (pos == this->Policies.end())
  456. {
  457. return "";
  458. }
  459. return pos->second->IDString;
  460. }
  461. ///! return a warning string for a given policy
  462. std::string cmPolicies::GetPolicyWarning(cmPolicies::PolicyID id)
  463. {
  464. std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
  465. this->Policies.find(id);
  466. if (pos == this->Policies.end())
  467. {
  468. cmSystemTools::Error(
  469. "Request for warning text for undefined policy!");
  470. return "Request for warning text for undefined policy!";
  471. }
  472. cmOStringStream msg;
  473. msg <<
  474. "Policy " << pos->second->IDString << " is not set: "
  475. "" << pos->second->ShortDescription << " "
  476. "Run \"cmake --help-policy " << pos->second->IDString << "\" for "
  477. "policy details. "
  478. "Use the cmake_policy command to set the policy "
  479. "and suppress this warning.";
  480. return msg.str();
  481. }
  482. ///! return an error string for when a required policy is unspecified
  483. std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id)
  484. {
  485. std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
  486. this->Policies.find(id);
  487. if (pos == this->Policies.end())
  488. {
  489. cmSystemTools::Error(
  490. "Request for error text for undefined policy!");
  491. return "Request for error text for undefined policy!";
  492. }
  493. cmOStringStream error;
  494. error <<
  495. "Policy " << pos->second->IDString << " is not set to NEW: "
  496. "" << pos->second->ShortDescription << " "
  497. "Run \"cmake --help-policy " << pos->second->IDString << "\" for "
  498. "policy details. "
  499. "CMake now requires this policy to be set to NEW by the project. "
  500. "The policy may be set explicitly using the code\n"
  501. " cmake_policy(SET " << pos->second->IDString << " NEW)\n"
  502. "or by upgrading all policies with the code\n"
  503. " cmake_policy(VERSION " << pos->second->GetVersionString() <<
  504. ") # or later\n"
  505. "Run \"cmake --help-command cmake_policy\" for more information.";
  506. return error.str();
  507. }
  508. ///! Get the default status for a policy
  509. cmPolicies::PolicyStatus
  510. cmPolicies::GetPolicyStatus(cmPolicies::PolicyID id)
  511. {
  512. // if the policy is not know then what?
  513. std::map<cmPolicies::PolicyID,cmPolicy *>::iterator pos =
  514. this->Policies.find(id);
  515. if (pos == this->Policies.end())
  516. {
  517. // TODO is this right?
  518. return cmPolicies::WARN;
  519. }
  520. return pos->second->Status;
  521. }
  522. //----------------------------------------------------------------------------
  523. std::string
  524. cmPolicies::GetRequiredAlwaysPolicyError(cmPolicies::PolicyID id)
  525. {
  526. std::string pid = this->GetPolicyIDString(id);
  527. cmOStringStream e;
  528. e << "Policy " << pid << " may not be set to OLD behavior because this "
  529. << "version of CMake no longer supports it. "
  530. << "The policy was introduced in "
  531. << "CMake version " << this->Policies[id]->GetVersionString()
  532. << ", and use of NEW behavior is now required."
  533. << "\n"
  534. << "Please either update your CMakeLists.txt files to conform to "
  535. << "the new behavior or use an older version of CMake that still "
  536. << "supports the old behavior. "
  537. << "Run cmake --help-policy " << pid << " for more information.";
  538. return e.str();
  539. }
  540. //----------------------------------------------------------------------------
  541. void
  542. cmPolicies::DiagnoseAncientPolicies(std::vector<PolicyID> const& ancient,
  543. unsigned int majorVer,
  544. unsigned int minorVer,
  545. unsigned int patchVer,
  546. cmMakefile* mf)
  547. {
  548. cmOStringStream e;
  549. e << "The project requests behavior compatible with CMake version \""
  550. << majorVer << "." << minorVer << "." << patchVer
  551. << "\", which requires the OLD behavior for some policies:\n";
  552. for(std::vector<PolicyID>::const_iterator
  553. i = ancient.begin(); i != ancient.end(); ++i)
  554. {
  555. cmPolicy const* policy = this->Policies[*i];
  556. e << " " << policy->IDString << ": " << policy->ShortDescription << "\n";
  557. }
  558. e << "However, this version of CMake no longer supports the OLD "
  559. << "behavior for these policies. "
  560. << "Please either update your CMakeLists.txt files to conform to "
  561. << "the new behavior or use an older version of CMake that still "
  562. << "supports the old behavior.";
  563. mf->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
  564. }