Re: [CMake] How to use CMAKE_POLICY?

2012-12-19 Thread Marcel Loose
Op 18-12-12 13:46, David Cole schreef: On Mon, Dec 17, 2012 at 11:57 AM, Alexander Neundorf a.neundorf-w...@gmx.net mailto:a.neundorf-w...@gmx.net wrote: On Monday 17 December 2012, David Cole wrote: I thought we wanted them to switch to the new behavior... Isn't that the

Re: [CMake] How to use CMAKE_POLICY?

2012-12-19 Thread Marcel Loose
Hi David, I need to set a policy to OLD, because I have wrapped a few existing Find*.cmake files to overcome some bugs or shortcomings. However, since CMake 2.8.4 (or 2.8.3, I'm not sure), this triggers a policy warning CMP0017 with newer versions of CMake, because some macros are now

Re: [CMake] How to use CMAKE_POLICY?

2012-12-19 Thread David Cole
No need for specific examples. Just wanted to understand the context better. One good way to avoid this warning would be to get your Find* script changes into CMake itself, and then eliminate your need for the custom copies of them when using a new-enough CMake. Is it feasible for you to propose

Re: [CMake] How to use CMAKE_POLICY?

2012-12-19 Thread Alexander Neundorf
On Wednesday 19 December 2012, Marcel Loose wrote: Hi David, I need to set a policy to OLD, because I have wrapped a few existing Find*.cmake files to overcome some bugs or shortcomings. However, since CMake 2.8.4 (or 2.8.3, I'm not sure), this triggers a policy warning CMP0017 with newer

Re: [CMake] How to use CMAKE_POLICY?

2012-12-19 Thread David Cole
I think the safest/wisest thing to do in this case is to update your minimum required version to CMake 2.8.4, and then adjust your custom code to eliminate the warning if it still occurs. 2.8.4 is more than 18 months old at this point. Is there a reason why 2.6.2 is still required for some? On

Re: [CMake] How to use CMAKE_POLICY?

2012-12-19 Thread Marcel Loose
On 19/12/12 17:56, David Cole wrote: I think the safest/wisest thing to do in this case is to update your minimum required version to CMake 2.8.4, and then adjust your custom code to eliminate the warning if it still occurs. 2.8.4 is more than 18 months old at this point. Is there a reason

Re: [CMake] How to use CMAKE_POLICY?

2012-12-19 Thread Marcel Loose
On 19/12/12 16:21, David Cole wrote: No need for specific examples. Just wanted to understand the context better. One good way to avoid this warning would be to get your Find* script changes into CMake itself, and then eliminate your need for the custom copies of them when using a new-enough

Re: [CMake] How to use CMAKE_POLICY?

2012-12-18 Thread Johannes Zarl
Sorry if I add to the confusion, but shouldn't set cmake_minimum_required automatically set all policies newer than the specified version to old? Johannes On Monday, 17. December 2012, 17:57:18, Alexander Neundorf wrote: On Monday 17 December 2012, David Cole wrote: I thought we wanted

Re: [CMake] How to use CMAKE_POLICY?

2012-12-18 Thread David Cole
The question in this thread is about what previous versions of CMake do with cmake_policy(SET ... OLD) commands where they do not know about the policy By default, policies introduced after the minimum required are UNSET, not set to OLD. From

Re: [CMake] How to use CMAKE_POLICY?

2012-12-18 Thread David Cole
On Mon, Dec 17, 2012 at 11:57 AM, Alexander Neundorf a.neundorf-w...@gmx.net wrote: On Monday 17 December 2012, David Cole wrote: I thought we wanted them to switch to the new behavior... Isn't that the goal of emitting warnings from policy implementations...? ...but not as long as the

Re: [CMake] How to use CMAKE_POLICY?

2012-12-17 Thread Marcel Loose
Hi David, See my remarks inline. On 15/12/12 16:47, David Cole wrote: On Sat, Dec 15, 2012 at 10:33 AM, Marcel Loose marcel.lo...@zonnet.nl mailto:marcel.lo...@zonnet.nl wrote: Thanks, that seems to work. Is the idiom if(POLICY CMP) cmake_policy(PUSH)

Re: [CMake] How to use CMAKE_POLICY?

2012-12-17 Thread David Cole
If you need to set a policy to OLD, then we have failed... Why do you need to set a policy to OLD? How can we make it work so that you don't need to do that? On Mon, Dec 17, 2012 at 3:58 AM, Marcel Loose lo...@astron.nl wrote: Hi David, See my remarks inline. On 15/12/12 16:47, David

Re: [CMake] How to use CMAKE_POLICY?

2012-12-17 Thread Alexander Neundorf
On Monday 17 December 2012, David Cole wrote: If you need to set a policy to OLD, then we have failed... Why do you need to set a policy to OLD? To get the old behaviour, and to silence warnings, which could lead developers to change the cmake code and switch to the NEW behaviour, I think.

Re: [CMake] How to use CMAKE_POLICY?

2012-12-17 Thread David Cole
I thought we wanted them to switch to the new behavior... Isn't that the goal of emitting warnings from policy implementations...? On Mon, Dec 17, 2012 at 11:45 AM, Alexander Neundorf a.neundorf-w...@gmx.net wrote: On Monday 17 December 2012, David Cole wrote: If you need to set a policy

Re: [CMake] How to use CMAKE_POLICY?

2012-12-17 Thread Alexander Neundorf
On Monday 17 December 2012, David Cole wrote: I thought we wanted them to switch to the new behavior... Isn't that the goal of emitting warnings from policy implementations...? ...but not as long as the project still wants to keep the old minimum required cmake version (or am I mixing things

Re: [CMake] How to use CMAKE_POLICY?

2012-12-15 Thread Marcel Loose
Thanks, that seems to work. Is the idiom if(POLICY CMP) cmake_policy(PUSH) cmake_policy(SET CMP OLD) cmake_policy(POP) endif() one that you also need to use with newer CMakes? Or does it then suffice to do cmake_policy(SET CMP OLD) Best regards,

Re: [CMake] How to use CMAKE_POLICY?

2012-12-15 Thread David Cole
On Sat, Dec 15, 2012 at 10:33 AM, Marcel Loose marcel.lo...@zonnet.nlwrote: Thanks, that seems to work. Is the idiom if(POLICY CMP) cmake_policy(PUSH) cmake_policy(SET CMP OLD) cmake_policy(POP) endif() one that you also need to use with newer CMakes? Or does it then

[CMake] How to use CMAKE_POLICY?

2012-12-13 Thread Marcel Loose
Hi all, I'm trying to figure out how to use the CMAKE_POLICY() command. I want to get rid of the warning on CMP0017. I've strategically placed cmake_policy(PUSH), cmake_policy(SET CMP0017 OLD), and cmake_policy(POP) which solves the problem when configuring with CMake 2.8.9. However, our

Re: [CMake] How to use CMAKE_POLICY?

2012-12-13 Thread David Cole
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. On Thu, Dec 13, 2012 at 6:31 AM, Marcel Loose lo...@astron.nl wrote: Hi all, I'm trying to figure out how to use the CMAKE_POLICY() command. I want to get