From 81a3f228824058849368f9c3a8e318c02fa03097 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 7 May 2014 15:41:18 +0200 Subject: Do not change minimum required version in modules Some modules change CMake minimum required version when they are included. For example: cmake_minimum_required(VERSION 2.8.12) message("${CMAKE_MINIMUM_REQUIRED_VERSION}") include(CheckTypeSize) message("${CMAKE_MINIMUM_REQUIRED_VERSION}") will produce the following output: 2.8.12 2.6 This patch ensures that when you include a CMake module the minimum required version and the policies set are left unchanged. Fixes Issue #14864 --- Modules/CheckTypeSize.cmake | 2 +- Modules/FindCUDA.cmake | 5 ----- Modules/FindGTK2.cmake | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index ad3b6b5..8ce6b88 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -79,7 +79,7 @@ include(CheckIncludeFile) include(CheckIncludeFileCXX) cmake_policy(PUSH) -cmake_minimum_required(VERSION 2.6 FATAL_ERROR) +cmake_policy(VERSION 3.0) get_filename_component(__check_type_size_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index d1c31a4..d9809ad 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -330,11 +330,6 @@ # FindCUDA.cmake -# We need to have at least this version to support the VERSION_LESS argument to 'if' (2.6.2) and unset (2.6.3) -cmake_policy(PUSH) -cmake_minimum_required(VERSION 2.6.3) -cmake_policy(POP) - # This macro helps us find the location of helper files we will need the full path to macro(CUDA_FIND_HELPER_FILE _name _extension) set(_full_name "${_name}.${_extension}") diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake index 15bcab8..eaa5e55 100644 --- a/Modules/FindGTK2.cmake +++ b/Modules/FindGTK2.cmake @@ -572,7 +572,6 @@ endif() # If specified, enforce version number # if(GTK2_FIND_VERSION) - cmake_minimum_required(VERSION 2.6.2) set(GTK2_FAILED_VERSION_CHECK true) if(GTK2_DEBUG) message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] " -- cgit v0.12