diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2022-09-03 00:31:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-03 00:31:29 (GMT) |
commit | c8fdd92cd4d53e5343b475b85c013de60ba13555 (patch) | |
tree | 6f852f5c3040bacbad3040fa00022955e78b63ee /CMakeLists.txt | |
parent | 6e8aaab1b43be06b4fde60ad5bd583a8a08f882a (diff) | |
download | hdf5-c8fdd92cd4d53e5343b475b85c013de60ba13555.zip hdf5-c8fdd92cd4d53e5343b475b85c013de60ba13555.tar.gz hdf5-c8fdd92cd4d53e5343b475b85c013de60ba13555.tar.bz2 |
Update CMake code to 3.18 minimum version (#2080)
* Update CMake code to 3.18 minimum version
* Updated release note
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 78 |
1 files changed, 18 insertions, 60 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c73597..0a0e4ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) project (HDF5 C) if (POLICY CMP0074) @@ -39,16 +39,6 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) ) endif () -# CMake version 3.14 added option --ignore-eol to compare files -# cmake -E compare_files --ignore-eol file1 file2 -set (CMAKE_IGNORE_EOL "--ignore-eol") -if (CMAKE_VERSION VERSION_LESS "3.14.0") - set (CMAKE_IGNORE_EOL "") - if (WIN32) - message (FATAL_ERROR "Windows builds require a minimum of CMake 3.14") - endif() -endif () - #----------------------------------------------------------------------------- # Instructions for use : Sub-Project Build # @@ -250,9 +240,7 @@ string (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$" "\\1" H5_VERS_RELEASE ${_h5public_h_contents}) string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._-]*)\".*$" "\\1" H5_VERS_SUBRELEASE ${_h5public_h_contents}) -if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (TRACE "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") -endif () +message (TRACE "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") #----------------------------------------------------------------------------- # parse the full soversion number from config/lt_vers.am and include in H5_SOVERS_INFO @@ -265,9 +253,7 @@ string (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" string (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_LIB_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_LIB_SOVERS_MAJOR ${H5_LIB_SOVERS_INTERFACE}-${H5_LIB_SOVERS_RELEASE}) -if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "SOVERSION: ${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") -endif () +message (VERBOSE "SOVERSION: ${H5_LIB_SOVERS_MAJOR}.${H5_LIB_SOVERS_RELEASE}.${H5_LIB_SOVERS_MINOR}") string (REGEX MATCH ".*LT_TOOLS_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_TOOLS_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_TOOLS_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_TOOLS_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" @@ -277,9 +263,7 @@ if (H5_TOOLS_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_TOOLS_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_TOOLS_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_TOOLS_SOVERS_MAJOR ${H5_TOOLS_SOVERS_INTERFACE}-${H5_TOOLS_SOVERS_RELEASE}) - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "SOVERSION_TOOLS: ${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}") - endif () + message (VERBOSE "SOVERSION_TOOLS: ${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}") endif () string (REGEX MATCH ".*LT_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_CXX_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_CXX_SOVERS_EXISTS) @@ -290,9 +274,7 @@ if (H5_CXX_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_CXX_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_CXX_SOVERS_MAJOR ${H5_CXX_SOVERS_INTERFACE}-${H5_CXX_SOVERS_RELEASE}) - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "SOVERSION_CXX: ${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}") - endif () + message (VERBOSE "SOVERSION_CXX: ${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}") endif () string (REGEX MATCH ".*LT_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_F_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_F_SOVERS_EXISTS) @@ -303,9 +285,7 @@ if (H5_F_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_F_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_F_SOVERS_MAJOR ${H5_F_SOVERS_INTERFACE}-${H5_F_SOVERS_RELEASE}) - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "SOVERSION_F: ${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}") - endif () + message (VERBOSE "SOVERSION_F: ${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}") endif () string (REGEX MATCH ".*LT_HL_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_HL_SOVERS_EXISTS) @@ -316,9 +296,7 @@ if (H5_HL_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_HL_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_HL_SOVERS_MAJOR ${H5_HL_SOVERS_INTERFACE}-${H5_HL_SOVERS_RELEASE}) - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "SOVERSION_HL: ${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}") - endif () + message (VERBOSE "SOVERSION_HL: ${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}") endif () string (REGEX MATCH ".*LT_HL_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_CXX_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_HL_CXX_SOVERS_EXISTS) @@ -329,9 +307,7 @@ if (H5_HL_CXX_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_HL_CXX_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_CXX_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_HL_CXX_SOVERS_MAJOR ${H5_HL_CXX_SOVERS_INTERFACE}-${H5_HL_CXX_SOVERS_RELEASE}) - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "SOVERSION_HL_CXX: ${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}") - endif () + message (VERBOSE "SOVERSION_HL_CXX: ${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}") endif () string (REGEX MATCH ".*LT_HL_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_F_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_HL_F_SOVERS_EXISTS) @@ -342,9 +318,7 @@ if (H5_HL_F_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_HL_F_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_F_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_HL_F_SOVERS_MAJOR ${H5_HL_F_SOVERS_INTERFACE}-${H5_HL_F_SOVERS_RELEASE}) - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "SOVERSION_HL_F: ${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}") - endif () + message (VERBOSE "SOVERSION_HL_F: ${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}") endif () string (REGEX MATCH ".*LT_JAVA_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_JAVA_SOVERS_EXISTS ${_lt_vers_am_contents}) if(H5_JAVA_SOVERS_EXISTS) @@ -355,9 +329,7 @@ if(H5_JAVA_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_JAVA_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_JAVA_SOVERS_RELEASE ${_lt_vers_am_contents}) math (EXPR H5_JAVA_SOVERS_MAJOR ${H5_JAVA_SOVERS_INTERFACE}-${H5_JAVA_SOVERS_RELEASE}) - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "SOVERSION_JAVA: ${H5_JAVA_SOVERS_MAJOR}.${H5_JAVA_SOVERS_RELEASE}.${H5_JAVA_SOVERS_MINOR}") - endif () + message (VERBOSE "SOVERSION_JAVA: ${H5_JAVA_SOVERS_MAJOR}.${H5_JAVA_SOVERS_RELEASE}.${H5_JAVA_SOVERS_MINOR}") endif () #----------------------------------------------------------------------------- @@ -880,42 +852,32 @@ option (HDF5_ENABLE_THREADSAFE "Enable thread-safety" OFF) if (HDF5_ENABLE_THREADSAFE) # check for unsupported options if (WIN32) - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE " **** thread-safety option not supported with static library **** ") - message (VERBOSE " **** thread-safety option will not be used building static library **** ") - endif () + message (VERBOSE " **** thread-safety option not supported with static library **** ") + message (VERBOSE " **** thread-safety option will not be used building static library **** ") endif () if (HDF5_BUILD_FORTRAN) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** Fortran and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ") else () - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE " **** Allowing unsupported Fortran and thread-safety options **** ") - endif () + message (VERBOSE " **** Allowing unsupported Fortran and thread-safety options **** ") endif () endif () if (HDF5_BUILD_CPP_LIB) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** C++ and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ") else () - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE " **** Allowing unsupported C++ and thread-safety options **** ") - endif () + message (VERBOSE " **** Allowing unsupported C++ and thread-safety options **** ") endif () endif () if (HDF5_BUILD_HL_LIB) if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** HL and thread-safety options are not supported, override with ALLOW_UNSUPPORTED option **** ") else () - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE " **** Allowing unsupported HL and thread-safety options **** ") - endif () + message (VERBOSE " **** Allowing unsupported HL and thread-safety options **** ") endif () endif () if (H5_HAVE_IOEO) - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") - endif () + message (VERBOSE " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") set (H5_HAVE_WIN_THREADS 1) else () if (NOT H5_HAVE_PTHREAD_H) @@ -1149,9 +1111,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for if (HDF5_BUILD_FORTRAN) include (${HDF_RESOURCES_DIR}/HDFUseFortran.cmake) - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}") - endif () + message (VERBOSE "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}") include (${HDF_RESOURCES_DIR}/HDFFortranCompilerFlags.cmake) include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake) set (LINK_Fortran_LIBS ${LINK_LIBS}) @@ -1200,9 +1160,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") if (NOT ALLOW_UNSUPPORTED) message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive, override with ALLOW_UNSUPPORTED option **** ") else () - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE " **** Allowing unsupported Parallel and C++ options **** ") - endif () + message (VERBOSE " **** Allowing unsupported Parallel and C++ options **** ") endif () endif () |