~ubuntu-branches/ubuntu/lucid/cmake/lucid

« back to all changes in this revision

Viewing changes to Source/cmPolicies.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2009-12-16 11:11:54 UTC
  • mfrom: (3.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20091216111154-6accvv6yq86h2hkc
Tags: 2.8.0-5ubuntu1
* Merge from debian testing (LP: #497349). Remaining changes:
  - Keep the Replaces: on cmake-data to cover the Kubuntu version from
    Jaunty in case someone decides to do an (unsupported) Jaunty->Lucid
    upgrade.

Show diffs side-by-side

added added

removed removed

Lines of Context:
355
355
    "The NEW behavior for this policy is to allow the commands to do their "
356
356
    "default cmake_policy PUSH and POP.",
357
357
    2,6,3, cmPolicies::WARN);
 
358
 
 
359
    this->DefinePolicy(
 
360
    CMP0012, "CMP0012",
 
361
    "if() recognizes numbers and boolean constants.",
 
362
    "In CMake versions 2.6.4 and lower the if() command implicitly "
 
363
    "dereferenced arguments corresponding to variables, even those named "
 
364
    "like numbers or boolean constants, except for 0 and 1.  "
 
365
    "Numbers and boolean constants such as true, false, yes, no, "
 
366
    "on, off, y, n, notfound, ignore (all case insensitive) were recognized "
 
367
    "in some cases but not all.  "
 
368
    "For example, the code \"if(TRUE)\" might have evaluated as false.  "
 
369
    "Numbers such as 2 were recognized only in "
 
370
    "boolean expressions like \"if(NOT 2)\" (leading to false) "
 
371
    "but not as a single-argument like \"if(2)\" (also leading to false). "
 
372
    "Later versions of CMake prefer to treat numbers and boolean constants "
 
373
    "literally, so they should not be used as variable names."
 
374
    "\n"
 
375
    "The OLD behavior for this policy is to implicitly dereference variables "
 
376
    "named like numbers and boolean constants. "
 
377
    "The NEW behavior for this policy is to recognize numbers and "
 
378
    "boolean constants without dereferencing variables with such names.",
 
379
    2,8,0, cmPolicies::WARN);
 
380
 
 
381
    this->DefinePolicy(
 
382
    CMP0013, "CMP0013",
 
383
    "Duplicate binary directories are not allowed.",
 
384
    "CMake 2.6.3 and below silently permitted add_subdirectory() calls "
 
385
    "to create the same binary directory multiple times.  "
 
386
    "During build system generation files would be written and then "
 
387
    "overwritten in the build tree and could lead to strange behavior.  "
 
388
    "CMake 2.6.4 and above explicitly detect duplicate binary directories.  "
 
389
    "CMake 2.6.4 always considers this case an error.  "
 
390
    "In CMake 2.8.0 and above this policy determines whether or not "
 
391
    "the case is an error.  "
 
392
    "The OLD behavior for this policy is to allow duplicate binary "
 
393
    "directories.  "
 
394
    "The NEW behavior for this policy is to disallow duplicate binary "
 
395
    "directories with an error.",
 
396
    2,8,0, cmPolicies::WARN);
 
397
 
 
398
    this->DefinePolicy(
 
399
    CMP0014, "CMP0014",
 
400
    "Input directories must have CMakeLists.txt.",
 
401
    "CMake versions before 2.8 silently ignored missing CMakeLists.txt "
 
402
    "files in directories referenced by add_subdirectory() or subdirs(), "
 
403
    "treating them as if present but empty.  "
 
404
    "In CMake 2.8.0 and above this policy determines whether or not "
 
405
    "the case is an error.  "
 
406
    "The OLD behavior for this policy is to silently ignore the problem.  "
 
407
    "The NEW behavior for this policy is to report an error.",
 
408
    2,8,0, cmPolicies::WARN);
358
409
}
359
410
 
360
411
cmPolicies::~cmPolicies()
422
473
    }
423
474
  
424
475
  // it is an error if the policy version is less than 2.4
425
 
  if (majorVer < 2 || majorVer == 2 && minorVer < 4)
 
476
  if (majorVer < 2 || (majorVer == 2 && minorVer < 4))
426
477
    {
427
478
    mf->IssueMessage(cmake::FATAL_ERROR,
428
479
      "An attempt was made to set the policy version of CMake to something "
604
655
    if(i->first != cmPolicies::CMP0000)
605
656
      {
606
657
      full << "  "
607
 
           << "CMake version " << cmVersion::GetMajorVersion()
608
 
           << "." << cmVersion::GetMinorVersion() << " ";
 
658
           << "CMake version " << cmVersion::GetCMakeVersion() << " ";
609
659
      // add in some more text here based on status
610
660
      switch (i->second->Status)
611
661
        {
667
717
  cmOStringStream e;
668
718
  e << "The project requests behavior compatible with CMake version \""
669
719
    << majorVer << "." << minorVer << "." << patchVer
670
 
    << "\", which requires OLD the behavior for some policies:\n";
 
720
    << "\", which requires the OLD behavior for some policies:\n";
671
721
  for(std::vector<PolicyID>::const_iterator
672
722
        i = ancient.begin(); i != ancient.end(); ++i)
673
723
    {