Re: [CMake] How to use CMAKE_POLICY?
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 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 up) ? Alex No, you're not mixing things up. You're correct. If somebody wants to use minimum required 2.6.2 *and* they don't like warnings emitted by newer versions of CMake about new policies, then they have to change their code, or use the -D CMAKE_POLICY_DEFAULT_CMP technique. Now if they're going to change their code anyway, why not make a change that is compatible with the new policy introduced rather than adding a bunch of code to keep things in the OLD state. With many policies it is possible to write CMake code that honors the NEW state of the policy, but still works with older CMakes. I would ask for specific advice regarding the particulars of the policy violation to see if there is such a way to re-write the code to work with older AND newer CMakes before I would ever consider setting a policy to OLD in my own CMakeLists files. HTH, David I can send specific examples if you want. I'm not sure I can send attachments to the mailing list, though. Regards, Marcel Loose. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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 included from my CMAKE_MODULE_PATH and some from CMAKE_CURRENT_LIST_DIR, which expands to somewhere inside CMAKE_ROOT. Best regards, Marcel Loose. Op 17-12-12 15:30, David Cole schreef: 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 mailto:lo...@astron.nl wrote: 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) 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) I assume you really mean: if(POLICY CMP) cmake_policy(PUSH) cmake_policy(SET CMP OLD) endif() ... other code where the policy is set to OLD ... if(POLICY CMP) cmake_policy(POP) endif() Yes, you're right. I was oversimplifying. 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. 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? 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. What's the reason that cmake doesn't silently ignore a CMAKE_POLICY(SET...) for a policy it doesn't know about? The other option is to bump up your minimum required version. Sure, but that defeats the whole purpose of setting a minimum required version. I need to be compatible with version 2.6.2. Best regards, Marcel Loose. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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 a patch series that fixes the problems you speak of in the Find* modules, or are they controversial or somehow non-public, and you can't do that...? Thanks, D On Wed, Dec 19, 2012 at 8:55 AM, Marcel Loose marcel.lo...@zonnet.nlwrote: 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 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 project still wants to keep the old minimum required cmake version (or am I mixing things up) ? Alex No, you're not mixing things up. You're correct. If somebody wants to use minimum required 2.6.2 *and* they don't like warnings emitted by newer versions of CMake about new policies, then they have to change their code, or use the -D CMAKE_POLICY_DEFAULT_CMP technique. Now if they're going to change their code anyway, why not make a change that is compatible with the new policy introduced rather than adding a bunch of code to keep things in the OLD state. With many policies it is possible to write CMake code that honors the NEW state of the policy, but still works with older CMakes. I would ask for specific advice regarding the particulars of the policy violation to see if there is such a way to re-write the code to work with older AND newer CMakes before I would ever consider setting a policy to OLD in my own CMakeLists files. HTH, David I can send specific examples if you want. I'm not sure I can send attachments to the mailing list, though. Regards, Marcel Loose. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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 versions of CMake, because some macros are now included from my CMAKE_MODULE_PATH and some from CMAKE_CURRENT_LIST_DIR, which expands to somewhere inside CMAKE_ROOT. you get this warning if a module from CMake/Modules/ includes a module from outside CMake/Modules/, if the same module exists also inside CMake/Modules/. This is a serious warning, because the including module expects the module from the same cmake version as itself, having the features as they are in this version, and by getting a different file it may not get what it expects. Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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 Wed, Dec 19, 2012 at 11:24 AM, Alexander Neundorf a.neundorf-w...@gmx.net wrote: 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 versions of CMake, because some macros are now included from my CMAKE_MODULE_PATH and some from CMAKE_CURRENT_LIST_DIR, which expands to somewhere inside CMAKE_ROOT. you get this warning if a module from CMake/Modules/ includes a module from outside CMake/Modules/, if the same module exists also inside CMake/Modules/. This is a serious warning, because the including module expects the module from the same cmake version as itself, having the features as they are in this version, and by getting a different file it may not get what it expects. Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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 why 2.6.2 is still required for some? Yep. Old machines running old software that nobody wants to touch, adhering to the principle Don't fix anything that ain't broke. On Wed, Dec 19, 2012 at 11:24 AM, Alexander Neundorf a.neundorf-w...@gmx.net mailto:a.neundorf-w...@gmx.net wrote: 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 versions of CMake, because some macros are now included from my CMAKE_MODULE_PATH and some from CMAKE_CURRENT_LIST_DIR, which expands to somewhere inside CMAKE_ROOT. you get this warning if a module from CMake/Modules/ includes a module from outside CMake/Modules/, if the same module exists also inside CMake/Modules/. This is a serious warning, because the including module expects the module from the same cmake version as itself, having the features as they are in this version, and by getting a different file it may not get what it expects. Alex -- Powered by www.kitware.com http://www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake attachment: loose.vcf-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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 CMake. Is it feasible for you to propose a patch series that fixes the problems you speak of in the Find* modules, or are they controversial or somehow non-public, and you can't do that...? It depends. Some changes are generic enough, I think. Others are probably too specific for my use cases. To make things a bit more concrete, I wrapped four Find modules: BLAS, Boost, JNI, and LAPACK. The BLAS and LAPACK changes are closely related and fix a problem with setting the Fortran compiler if it hasn't been set yet. The changes for JNI are only needed for older versions of CMake. Finally, the changes I made for Boost are probably the most controversial and likely not generic enough. For one thing I define all uppercase variables for all the relevant Boost-variables that are set. Should I file an issue in Mantis for BLAS and LAPACK? Best regards, Marcel Loose. attachment: loose.vcf-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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 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 up) ? Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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 http://cmake.org/cmake/help/v2.8.10/cmake.html#command:cmake_policy: All policies introduced after the specified version will be unset (unless variable CMAKE_POLICY_DEFAULT_CMP sets a default). This effectively requests behavior preferred as of a given CMake version and tells newer CMake versions to warn about their new policies. The policy version specified must be at least 2.4 or the command will report an error. In order to get compatibility features supporting versions earlier than 2.4 see documentation of policy CMP0001. cmake_policy(SET CMP NEW) cmake_policy(SET CMP OLD) Tell CMake to use the OLD or NEW behavior for a given policy. Projects depending on the old behavior of a given policy may silence a policy warning by setting the policy state to OLD. Alternatively one may fix the project to work with the new behavior and set the policy state to NEW. On Tue, Dec 18, 2012 at 7:20 AM, Johannes Zarl johannes.z...@jku.at wrote: 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 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 up) ? Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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 project still wants to keep the old minimum required cmake version (or am I mixing things up) ? Alex No, you're not mixing things up. You're correct. If somebody wants to use minimum required 2.6.2 *and* they don't like warnings emitted by newer versions of CMake about new policies, then they have to change their code, or use the -D CMAKE_POLICY_DEFAULT_CMP technique. Now if they're going to change their code anyway, why not make a change that is compatible with the new policy introduced rather than adding a bunch of code to keep things in the OLD state. With many policies it is possible to write CMake code that honors the NEW state of the policy, but still works with older CMakes. I would ask for specific advice regarding the particulars of the policy violation to see if there is such a way to re-write the code to work with older AND newer CMakes before I would ever consider setting a policy to OLD in my own CMakeLists files. HTH, David -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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) 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) I assume you really mean: if(POLICY CMP) cmake_policy(PUSH) cmake_policy(SET CMP OLD) endif() ... other code where the policy is set to OLD ... if(POLICY CMP) cmake_policy(POP) endif() Yes, you're right. I was oversimplifying. 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. 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? 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. What's the reason that cmake doesn't silently ignore a CMAKE_POLICY(SET...) for a policy it doesn't know about? The other option is to bump up your minimum required version. Sure, but that defeats the whole purpose of setting a minimum required version. I need to be compatible with version 2.6.2. Best regards, Marcel Loose. attachment: loose.vcf-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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 Cole wrote: 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 suffice to do cmake_policy(SET CMP OLD) I assume you really mean: if(POLICY CMP) cmake_policy(PUSH) cmake_policy(SET CMP OLD) endif() ... other code where the policy is set to OLD ... if(POLICY CMP) cmake_policy(POP) endif() Yes, you're right. I was oversimplifying. 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. 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? 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. What's the reason that cmake doesn't silently ignore a CMAKE_POLICY(SET...) for a policy it doesn't know about? The other option is to bump up your minimum required version. Sure, but that defeats the whole purpose of setting a minimum required version. I need to be compatible with version 2.6.2. Best regards, Marcel Loose. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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. Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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 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. Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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 up) ? Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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, Marcel Loose. Op 13-12-12 14:00, David Cole schreef: 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 mailto:lo...@astron.nl wrote: 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 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: CMake Error at CMake/FindLAPACK.cmake:44 (cmake_policy): Policy CMP0017 is not known to this version of CMake. This sounds like a catch-22. I've fixed the warning for the new CMake, but get an error in return for the old CMake. What am I doing wrong?? Best regards, Marcel Loose. -- Powered by www.kitware.com http://www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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 suffice to do cmake_policy(SET CMP OLD) I assume you really mean: if(POLICY CMP) cmake_policy(PUSH) cmake_policy(SET CMP OLD) endif() ... other code where the policy is set to OLD ... if(POLICY CMP) cmake_policy(POP) endif() 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. The other option is to bump up your minimum required version. HTH, David Best regards, Marcel Loose. Op 13-12-12 14:00, David Cole schreef: 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 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 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: CMake Error at CMake/FindLAPACK.cmake:44 (cmake_policy): Policy CMP0017 is not known to this version of CMake. This sounds like a catch-22. I've fixed the warning for the new CMake, but get an error in return for the old CMake. What am I doing wrong?? Best regards, Marcel Loose. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] How to use CMAKE_POLICY?
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 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: CMake Error at CMake/FindLAPACK.cmake:44 (cmake_policy): Policy CMP0017 is not known to this version of CMake. This sounds like a catch-22. I've fixed the warning for the new CMake, but get an error in return for the old CMake. What am I doing wrong?? Best regards, Marcel Loose. attachment: loose.vcf-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to use CMAKE_POLICY?
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 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 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: CMake Error at CMake/FindLAPACK.cmake:44 (cmake_policy): Policy CMP0017 is not known to this version of CMake. This sounds like a catch-22. I've fixed the warning for the new CMake, but get an error in return for the old CMake. What am I doing wrong?? Best regards, Marcel Loose. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake