<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div>I’m trying out my project on 3.3.0-rc1, but currently I’m using 2.8.11 and 2.8.12.  I got  a couple errors from CMP0046.  Most of them are correct: I’ve fixed a couple places where a non-existent dependency was used, and I want to set this policy to NEW
so that more do not sneak in.  </div>
<div> </div>
<div>However there is a problem. I have a test that dynamically loads a bunch of .so’s, as configured by a .xml file to ensure they are compatible.  Some of the .so’s are in the same project and some are from a different project and installed into the system
at build time.  We are running tests as part of the make all target, (easy to do with a few add_custom_command/add_custom_target).  The obvious problem is this test needs to have all the .so’s built before the test runs, but it doesn’t link them.  This was
easy enough – I just parsed the .xml for the name of the .so and place that name into an add_dependencies. That works great in cmake 2.8.11.</div>
<div> </div>
<div>In cmake 3.3.0-rc1 it doesn’t work.  Some of the .so’s are installed on the system and not built in the project.  Obviously no target exists for them. What I want to do to solve this is:</div>
<div> </div>
<div style="padding-left:36pt;">cmake_policy(PUSH)</div>
<div style="padding-left:36pt;">   if(POLICY CMP0046)</div>
<div style="padding-left:36pt;">      CMAKE_POLICY(SET CMP0046 OLD)</div>
<div style="padding-left:36pt;">    endif()</div>
<div style="padding-left:36pt;">       add_dependencies(${MyTestRunTarget} ${XML_PARSED_DEPENDENCIES})</div>
<div style="padding-left:36pt;">cmake_policy(POP)</div>
<div style="padding-left:36pt;"> </div>
<div>This does not work.  It appears that the policy is not actually checked until long after the add_dependencies line is done processing, and the fact that I want to suppress the policy for just these is not carried along.</div>
<div> </div>
<div>Is there some way to achieve changing this policy for just a few select targets?  </div>
<div> </div>
<div> </div>
</span></font>
</body>
</html>