[CMake] How to use CMAKE_POLICY?

Alexander Neundorf a.neundorf-work at gmx.net
Wed Dec 19 11:24:42 EST 2012


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


More information about the CMake mailing list