<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 08-Nov-16 23:33, Nils Gladitz wrote:<br>
    </div>
    <blockquote
      cite="mid:2a0e1f85-6129-abe1-12d1-e85f2b8d16ce@gmail.com"
      type="cite">On 11/08/2016 04:17 PM, Ruslan Baratov wrote:
      <br>
      <br>
      <blockquote type="cite">On 08-Nov-16 22:22, Nils Gladitz wrote:
        <br>
        <blockquote type="cite">Strictly speaking
          cmake_minimum_required(VERSION) is not about command
          <br>
          availability but rather about behavior (cmake policies).
          <br>
        </blockquote>
        Except it's exactly opposite :) `cmake_minimum_required` is
        about new
        <br>
        features/commands, and policies is about behavior.
        <br>
      </blockquote>
      <br>
      I don't agree and you can not separate the two.
      <br>
      cmake_minimum_required() initializes the policies based on the
      given version.<br>
    </blockquote>
    <tt>So what? From the user's perspective the "initialization of
      policies" is like a syntactic sugar so you don't have to write
      endless `</tt><tt><span class="hll"><span class="nb">cmake_policy</span><span
          class="p">(</span><span class="s">SET</span> <span class="s">CMP00xx</span>
        NEW<span class="p">)`. Nothing to do how to deal with them
          further.</span></span></tt><br>
    <br>
    <blockquote
      cite="mid:2a0e1f85-6129-abe1-12d1-e85f2b8d16ce@gmail.com"
      type="cite">
      <br>
      <blockquote type="cite">  If you have command
        <br>
        `if(IN_LIST)` since 3.3 you can't manipulate policies in such
        way that
        <br>
        it will work with CMake 2.8. However if you have warning about
        policy
        <br>
        CMP0054 (since CMake 3.2) you can set policy to old without
        changing
        <br>
        `cmake_minimum_required` (hence without forcing your CMake 2.8
        users to
        <br>
        upgrade to CMake 3.2).
        <br>
      </blockquote>
      <br>
      Coincidentally I implemented both of those policies :)
      <br>
      <br>
      Given your second example you likely shouldn't be touching the
      policy at all.<br>
    </blockquote>
    I have to. If my code use features from CMake 2.8 I do set
    `cmake_minimum_required(VERSION 2.8)`. But some users may have CMake
    3.2 installed. Do they must downgrade CMake? Of course not. But if
    I'm not touching policies there will be warnings around. If I'm good
    developer I will investigate the root of the warnings and fix them.
    Actually most of them will be about bugs in my code or dangerous
    behavior, so it does improve 2.8 too.<br>
    <br>
    <blockquote
      cite="mid:2a0e1f85-6129-abe1-12d1-e85f2b8d16ce@gmail.com"
      type="cite">
      <br>
      A policy warning does not force your users to use a new CMake
      version.<br>
    </blockquote>
    Well that's what I said.<br>
    <br>
    <blockquote
      cite="mid:2a0e1f85-6129-abe1-12d1-e85f2b8d16ce@gmail.com"
      type="cite">In fact all that setting it to OLD does is suppress
      the warning.<br>
    </blockquote>
    It's better than emitting zillion of warnings to the output, right?
    You can suppress one type and fix another, set TODOs, etc.<br>
    <br>
    <blockquote
      cite="mid:2a0e1f85-6129-abe1-12d1-e85f2b8d16ce@gmail.com"
      type="cite">CMake will use the old behavior in either case.
      <br>
      <br>
      The warnings guide developers when they do bump their
      cmake_minimum_required(VERSION).
      <br>
      By just suppressing it behavior changes might go unnoticed when
      the bump does happen.<br>
    </blockquote>
    There are 3 components in the equation: the **real** CMake version,
    the version in `cmake_minimum_required` and the default policies for
    such version. Can you provide an example of what you mean?<br>
    <br>
    Ruslo<br>
  </body>
</html>