<div class="gmail_extra"><div class="gmail_quote">On Sat, Dec 15, 2012 at 10:33 AM, Marcel Loose <span dir="ltr">&lt;<a 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>  cmake_policy(PUSH)</tt><tt><br>
        </tt><tt>  cmake_policy(SET </tt><tt><tt>CMP&lt;NNNN&gt;</tt>
          OLD)</tt><tt><br>
        </tt><tt>  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>  cmake_policy(PUSH)</tt><tt><br>
</tt><tt>  cmake_policy(SET </tt><tt><tt>CMP&lt;NNNN&gt;</tt> 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>  cmake_policy(POP)</tt></div><div class="gmail_quote">
<tt>endif()</tt><tt><br></tt><div><br></div><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&#39;ll need the if(POLICY construct.</div>
<div><br></div><div>The other option is to bump up your minimum required version.</div><div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br></div><div> <br></div><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><blockquote><br>
      </blockquote>
      <tt>
      </tt>Best regards,<br>
      Marcel Loose.<br>
      <br>
      <br>
      Op 13-12-12 14:00, David Cole schreef:<br>
    </div><div><div class="h5">
    <blockquote type="cite">You could use if(POLICY (if 2.6.2 supports that... I
      think it does, but it was very long ago......) to avoid the call
      on older CMakes.
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Thu, Dec 13, 2012 at 6:31 AM, Marcel
          Loose <span dir="ltr">&lt;<a href="mailto:loose@astron.nl" target="_blank">loose@astron.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">Hi all,<br>
            <br>
            I&#39;m trying to figure out how to use the CMAKE_POLICY()
            command. I want to get rid of the warning on CMP0017. I&#39;ve
            strategically placed &quot;cmake_policy(PUSH)&quot;, &quot;cmake_policy(SET
            CMP0017 OLD)&quot;, and &quot;cmake_policy(POP)&quot; which solves the
            problem when configuring with CMake 2.8.9.<br>
            <br>
            However, our project also needs to be compatible with CMake
            2.6.2. The problem is that this older CMake now bails out
            with an error message:<br>
            <br>
            CMake Error at CMake/FindLAPACK.cmake:44 (cmake_policy):<br>
              Policy &quot;CMP0017&quot; is not known to this version of CMake.<br>
            <br>
            This sounds like a catch-22. I&#39;ve fixed the warning for the
            new CMake, but get an error in return for the old CMake.
            What am I doing wrong??<br>
            <br>
            Best regards,<br>
            Marcel Loose.<br>
            <br>
            <br>
            --<br>
            <br>
            Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
            <br>
            Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
            <br>
            Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
            <br>
            Follow this link to subscribe/unsubscribe:<br>
            <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </div></div></div>

</blockquote></div><br></div>