Set cmake minimum version in a centralized place

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/102/head
Michele Calgaro 9 months ago
parent 620a9aa9f9
commit a8c01019d7
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -14,7 +14,13 @@ if( "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}" )
##### general package setup ##################### ##### general package setup #####################
cmake_minimum_required( VERSION 3.5 ) # building tde-cmake requires reading the minimum required version
# from the source files, because there may be a different version
# of tde-cmake already installed in the system. Trying to build
# tde-cmake with a lower minimum version would not be allowed then.
include( ${CMAKE_SOURCE_DIR}/modules/TDEVersion.cmake )
cmake_minimum_required( VERSION ${TDE_CMAKE_MINIMUM_VERSION} )
project( tde-cmake-rules ) project( tde-cmake-rules )

@ -16,13 +16,20 @@
################################################# #################################################
#################################################
#####
##### Need cmake minimum version
include( TDEVersion )
################################################# #################################################
##### #####
##### initialization... ##### initialization...
if( NOT TDE_CMAKE_ROOT ) if( NOT TDE_CMAKE_ROOT )
if( "${CMAKE_VERSION}" VERSION_LESS "3.5" ) if( "${CMAKE_VERSION}" VERSION_LESS "${TDE_CMAKE_MINIMUM_VERSION}" )
message( FATAL_ERROR "CMake >= 3.5.0 required" ) message( FATAL_ERROR "CMake >= ${TDE_CMAKE_MINIMUM_VERSION} required" )
endif() endif()
if( ${CMAKE_CURRENT_LIST_DIR} STREQUAL ${CMAKE_ROOT}/Modules ) if( ${CMAKE_CURRENT_LIST_DIR} STREQUAL ${CMAKE_ROOT}/Modules )
@ -83,7 +90,6 @@ include( CheckCXXSourceCompiles )
include( CheckLinkerFlag OPTIONAL ) include( CheckLinkerFlag OPTIONAL )
include( CheckSymbolExists ) include( CheckSymbolExists )
include( CheckTypeSize ) include( CheckTypeSize )
include( TDEVersion )
################################################# #################################################

@ -9,6 +9,11 @@
# #
################################################# #################################################
# Centralized place where to set the minimum cmake version required in TDE
set( TDE_CMAKE_MINIMUM_VERSION 3.5 )
################################################# #################################################
##### #####
##### tde_set_project_version ##### tde_set_project_version

Loading…
Cancel
Save