[CMake] CMake 2.8.1 RC 3 is ready to try

Brad King brad.king at kitware.com
Thu Feb 25 14:14:14 EST 2010


Philip Schwartz wrote:
> Currently when setting CMP0015 to old, the warnings are still displayed.
> As the policy is only a warning policy at this time there is no breakage
> of the configure step other then a lot of unneeded warnings.

Use cmake_policy(GET) to check the policy value right before the call
to link_directories.  The code in question looks like this:

    switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0015))
      {
      case cmPolicies::WARN:
        e << policies->GetPolicyWarning(cmPolicies::CMP0015);
        this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
      case cmPolicies::OLD:
        // OLD behavior does not convert
        break;
      ...
      }

so if it is warning then we can be fairly sure the command does not
see your setting.

Note that any call to cmake_minimum_required(VERSION ...) will reset
all policies to the defaults for the specified version.  If that comes
after your call to cmake_policy(SET) then it will erase your setting.

-Brad


More information about the CMake mailing list