[cmake-developers] policies in CMake builtin modules
Adam Strzelecki
ono at java.pl
Thu Sep 18 13:00:52 EDT 2014
If I understand correctly all modules included via include/find_package have implicit POLICY PUSH and POP at the EOF. Wouldn't it be reasonable to require all internal .cmake files to begin with:
cmake_policy(VERSION 3.1) # or whatever version the module was tested against
Then before next release all of these should be checked against new policies and upgraded to:
cmake_policy(VERSION 3.2) # next release version
Then we can safely drop all these fancy if("x${var}" STREQUAL "xVALUE") in favor of if(var STREQUAL "VALUE") and improve scripts readability, rather that do PUSHes and POPs in various places. Of course I am aware that such task needs lot of work, however I think this should be consequence of introducing CMP0054.
--Adam
More information about the cmake-developers
mailing list