<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi David,<br>
      <br>
      See my remarks inline.<br>
      <br>
      On 15/12/12 16:47, David Cole wrote:<br>
    </div>
    <blockquote
cite="mid:CAAdwe9X3PgSVmVuhb2z-5S9yCJXJOC7UOPMeKKdbzgRderARuw@mail.gmail.com"
      type="cite">
      <div class="gmail_extra">
        <div class="gmail_quote">On Sat, Dec 15, 2012 at 10:33 AM,
          Marcel Loose <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:marcel.loose@zonnet.nl" target="_blank">marcel.loose@zonnet.nl</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF">
              <div>Thanks, that seems to work.<br>
                <br>
                Is the idiom <br>
                <blockquote><tt>if(POLICY CMP&lt;NNNN&gt;)</tt><tt><br>
                  </tt><tt>&nbsp; cmake_policy(PUSH)</tt><tt><br>
                  </tt><tt>&nbsp; cmake_policy(SET </tt><tt><tt>CMP&lt;NNNN&gt;</tt>
                    OLD)</tt><tt><br>
                  </tt><tt>&nbsp; cmake_policy(POP)</tt><tt><br>
                  </tt><tt>endif()</tt><tt><br>
                  </tt></blockquote>
                one that you also need to use with newer CMakes? Or does
                it then suffice to do<tt><br>
                </tt>
                <blockquote><tt>cmake_policy(SET </tt><tt><tt>CMP&lt;NNNN&gt;</tt>
                    OLD)</tt></blockquote>
              </div>
            </div>
          </blockquote>
          <div><br>
          </div>
          <div>I assume you really mean:</div>
          <tt>
            <div class="gmail_quote"><tt><br>
              </tt></div>
            if(POLICY CMP&lt;NNNN&gt;)</tt><tt><br>
          </tt><tt>&nbsp; cmake_policy(PUSH)</tt><tt><br>
          </tt><tt>&nbsp; cmake_policy(SET&nbsp;</tt><tt><tt>CMP&lt;NNNN&gt;</tt>&nbsp;OLD)</tt></div>
        <div class="gmail_quote"><tt>endif()<br>
          </tt></div>
        <div class="gmail_quote"><tt><br>
          </tt></div>
        <div class="gmail_quote"><tt>...</tt></div>
        <div class="gmail_quote">
          <tt>other code where the policy is set to OLD</tt></div>
        <div class="gmail_quote"><tt>...</tt></div>
        <div class="gmail_quote"><tt><br>
          </tt><tt>if(POLICY CMP&lt;NNNN&gt;)</tt><tt><br>
          </tt><tt>&nbsp; cmake_policy(POP)</tt></div>
        <div class="gmail_quote">
          <tt>endif()</tt><tt><br>
          </tt>
          <div><br>
          </div>
        </div>
      </div>
    </blockquote>
    Yes, you're right. I was oversimplifying. <br>
    <blockquote
cite="mid:CAAdwe9X3PgSVmVuhb2z-5S9yCJXJOC7UOPMeKKdbzgRderARuw@mail.gmail.com"
      type="cite">
      <div class="gmail_extra">
        <div class="gmail_quote">
          <div><br>
          </div>
          <div>The policies are tightly tied to the minimum required
            version of CMake. So if you use cmake_minimum_required with
            a certain version number, you can write code without
            if(POLICY assuming that all the policies you need to set are
            known as of that minimum version. If they are not (and they
            must not be in this particular case), then you'll need the
            if(POLICY construct.</div>
          <div><br>
          </div>
        </div>
      </div>
    </blockquote>
    So, that basically means that you need to use if(POLICY...) for all
    policies that are not part of the minimum required version? Is there
    a way to find out which policies exist for which version of CMake?<br>
    <br>
    I was hoping for a more forward compatible solution. In other words,
    I was hoping that I could always use CMAKE_POLICY(SET...)
    unconditionally. It's a bit of a shame that I have to clutter my
    CMakeLists.txt and *.cmake files with these extra conditionals; and
    have to remove them (or should I say: clean up) whenever I bump the
    minimum required version. <br>
    <br>
    What's the reason that cmake doesn't silently ignore a
    CMAKE_POLICY(SET...) for a policy it doesn't know about? <br>
    <br>
    <blockquote
cite="mid:CAAdwe9X3PgSVmVuhb2z-5S9yCJXJOC7UOPMeKKdbzgRderARuw@mail.gmail.com"
      type="cite">
      <div class="gmail_extra">
        <div class="gmail_quote">
          <div>The other option is to bump up your minimum required
            version.</div>
        </div>
      </div>
    </blockquote>
    Sure, but that defeats the whole purpose of setting a minimum
    required version. I need to be compatible with version 2.6.2.<br>
    <br>
    Best regards,<br>
    Marcel Loose.<br>
    <br>
  </body>
</html>