Global handling of CMake policies

We declare 
  cmake_minimum_required(VERSION 2.6.2)
but we also use
  cmake_policy(VERSION 2.8.4)
to declare that our CMake scripts are OK with all the defaults of CMake policies
as of CMake-2.8.4. That shuts down the warnings of CMake-2.8.4.

That way, we no longer need any declaration of specific policies.
This commit is contained in:
Laurent Rineau 2011-04-28 10:33:17 +00:00
parent 5229c33964
commit 4b795c56f4
5 changed files with 20 additions and 40 deletions

View File

@ -1,6 +1,10 @@
project (CGAL_ImageIO)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2 FATAL_ERROR)
# Minimal version of CMake:
cmake_minimum_required(VERSION 2.6.2)
# Tested version:
cmake_policy(VERSION 2.8.4)
if ( NOT CGAL_FOUND )
find_package(CGAL REQUIRED)

View File

@ -1,6 +1,10 @@
project (CGAL_Qt4)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2 FATAL_ERROR)
# Minimal version of CMake:
cmake_minimum_required(VERSION 2.6.2)
# Tested version:
cmake_policy(VERSION 2.8.4)
if ( NOT CGAL_FOUND )
find_package(CGAL REQUIRED)

View File

@ -5,15 +5,11 @@
# ${CMAKE_BINARY_DIR} or ${CMAKE_BINARY_DIR}.
project(CGAL)
cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
# Minimal version of CMake:
cmake_minimum_required(VERSION 2.6.2)
# This allows else(), endif(), etc... (without repeating the expression)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
if ( COMMAND cmake_policy )
# Libraries linked via full path no longer produce linker search paths.
cmake_policy( SET CMP0003 NEW )
endif( COMMAND cmake_policy )
# Tested version:
cmake_policy(VERSION 2.8.4)
#--------------------------------------------------------------------------------------------------
#

View File

@ -25,34 +25,6 @@ if( NOT CGAL_COMMON_FILE_INCLUDED )
set( CMAKE_2_6_3_OR_ABOVE FALSE )
endif()
if ( COMMAND cmake_policy )
# CMP0007 OLD means: list command ignores empty elements
cmake_policy( SET CMP0007 OLD )
if ( CMAKE_2_6_3_OR_ABOVE )
# CMP0011 OLD means: Included scripts do NOT automatic cmake_policy
# PUSH and POP.
# We set that policy to OLD to avoid a warning. We probably could
# have set to the NEW policy.
cmake_policy( SET CMP0011 OLD )
endif()
if(POLICY CMP0017)
# New policy since CMake 2.8.4
if(NOT RUNNING_CGAL_AUTO_TEST)
# We do not set this in the testsuite, to see the warnings.
cmake_policy( SET CMP0017 OLD )
endif()
# CMP0017 OLD means: we want to be able to override CMake modules
# that are shipped with CMake.
# For the moment, we override:
# FindBLAS.cmake
# FindBoost.cmake
# FindLAPACK.cmake
# FindOpenGL.cmake
# FindPackageMessage.cmake
# Laurent Rineau, 2011/03/09
endif()
endif()
if ( "${BUILD_SHARED_LIBS}" STREQUAL "" )
if ( WIN32 )
set(BUILD_SHARED_LIBS OFF)

View File

@ -1,6 +1,10 @@
project (CGAL_Qt3)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2 FATAL_ERROR)
# Minimal version of CMake:
cmake_minimum_required(VERSION 2.6.2)
# Tested version:
cmake_policy(VERSION 2.8.4)
if ( NOT CGAL_FOUND )
find_package(CGAL REQUIRED)