summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-02-27 22:54:52 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-02-27 22:54:52 (GMT)
commit467b5d565cc6bb0a75f10ac0807c38ee0a0939a9 (patch)
treec2d87fcc51f380a2306949753c40cebd9e9aa796 /CMakeLists.txt
parentf1aca8780ea647e705760149ceb925e363c31763 (diff)
downloadhdf5-467b5d565cc6bb0a75f10ac0807c38ee0a0939a9.zip
hdf5-467b5d565cc6bb0a75f10ac0807c38ee0a0939a9.tar.gz
hdf5-467b5d565cc6bb0a75f10ac0807c38ee0a0939a9.tar.bz2
Merge CMake and tools changes from develop
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt30
1 files changed, 14 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0127bcb..8e83ca7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,10 +1,14 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required (VERSION 3.12)
project (HDF5 C)
if (POLICY CMP0074)
cmake_policy (SET CMP0074 NEW)
endif ()
+if (POLICY CMP0083)
+ cmake_policy (SET CMP0083 NEW)
+endif ()
+
#-----------------------------------------------------------------------------
# Instructions for use : Normal Build
#
@@ -34,9 +38,14 @@ endif ()
# CMake version 3.14 added option --ignore-eol to compare files
# cmake -E compare_files --ignore-eol file1 file2
-#if(CMAKE_VERSION VERSION_LESS "3.14.0" AND WIN32)
-# MESSAGE(FATAL_ERROR "Windows builds requires a minimum of CMake 3.14")
-#endif()
+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 requires a minimum of CMake 3.14")
+ endif()
+else ()
+endif ()
#-----------------------------------------------------------------------------
# Instructions for use : Sub-Project Build
@@ -394,9 +403,6 @@ HDF_DIR_PATHS(${HDF5_PACKAGE_NAME})
include (${HDF_RESOURCES_EXT_DIR}/HDFLibMacros.cmake)
include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake)
-if (HDF5_ENABLE_SANITIZERS)
- include (${HDF5_SOURCE_DIR}/config/sanitizer/sanitizers.cmake)
-endif ()
#-----------------------------------------------------------------------------
# Targets built within this project are exported at Install time for use
@@ -558,9 +564,7 @@ endif ()
set (EXE_EXT "")
if (WIN32 OR MINGW)
set (EXE_EXT ".exe")
- add_definitions (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1)
- add_definitions (-D_CRT_SECURE_NO_WARNINGS)
- add_definitions (-D_CONSOLE)
+ add_compile_definitions (_BIND_TO_CURRENT_VCLIBS_VERSION=1 _CRT_SECURE_NO_WARNINGS _CONSOLE)
endif ()
if (MSVC)
@@ -926,12 +930,6 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for
include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake)
message (STATUS "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}")
- # Building with PGI requires CMake 3.3 or greater because previous versions
- # of CMake add the wrong compiler flag for the PGI Fortran compiler.
- if (CMAKE_Fortran_COMPILER_ID MATCHES "PGI" AND CMAKE_VERSION VERSION_LESS "3.3")
- message (FATAL_ERROR " **** PGI FORTRAN REQUIRES CMAKE VERSION 3.3 OR GREATER **** ")
- endif ()
-
include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake)
set (LINK_Fortran_LIBS ${LINK_LIBS})