On 20/08/14 22:50, Alexander Neundorf wrote: > On Tuesday, August 12, 2014 09:06:13 Brad King wrote: > ... >> FYI, the only intended use case for setting a policy to OLD is to >> quiet warnings in a maintenance branch of an existing release. >> Some day support for OLD behavior of some policies may be dropped, >> so all project development moving forward should set the policy >> to NEW. > Fixing a warning may make the project require the newer cmake version. > E.g. if MyProject requires cmake 2.8.10, and there is a new policy in 3.0.0, > which generates a warning, a developer using cmake 3.0.0 may see the warning > and fix it, but by that he may have broken the build for the required 2.8.10 > and actually now 3.0.0 is required. > > Alex That's exactly the problem I keep running into. I want my project to be compatible with any CMake 2.8.x, but also want it to run warning-free with newer CMake versions, without having to resort to -Wno-dev. AFAIK that can only be accomplished by setting some policies temporarily to OLD. However, wrapping target_link_libraries() in a macro that temporarily sets CMP0022 to OLD failed, due to scoping issues :(
Cheers, Marcel
<<attachment: loose.vcf>>
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake