Hi,

  With version 3.1.3, I have to define policy CMP0054 to NEW to avoid lots of 
warnings. My original approach was to define it at the top level CMakeLists.txt 
file hoping this will be inherited by all sub_directories of the project. 
Beware that some of the sub_directories contain a cmake_minimum_required() 
command because they can also be standalone projects with a project() command. 
To my surprise this does not work for policy CMP0054 and it works for others 
like for example CMP0005. Is there any reason for it?

  To test this behaviour is as simple cmaking the following CMakeLists.txt file:

cmake_policy(SET CMP0005 NEW)
cmake_policy(SET CMP0054 NEW)

cmake_policy(GET CMP0005 cmp0005)
cmake_policy(GET CMP0054 cmp0054)
message("Policy CMP0005 before version ${cmp0005}")
message("Policy CMP0054 before version ${cmp0054}")

cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)

cmake_policy(GET CMP0005 _cmp0005)
cmake_policy(GET CMP0054 _cmp0054)
message("Policy CMP0005 after version ${_cmp0005}")
message("Policy CMP0054 after version ${_cmp0054}")


The output is:

Policy CMP0005 before version NEW
Policy CMP0054 before version NEW
Policy CMP0005 after version NEW
Policy CMP0054 after version

so, CMP0054 is undefined after the  cmake_minimum_required()

Cheers,

Pere

-------------------------------------------------------------
Pere Mato  CERN, PH Department, CH 1211 Geneva 23, Switzerland
e-mail: [email protected]<mailto:[email protected]> tel:   +41 22 76 78696
fax:  +41 22 76 68792 gsm: +41 76 48 70855

-- 

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

Reply via email to