summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-01-30 20:33:47 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-01-30 20:33:47 (GMT)
commita29f9e8451ffa391c8395db1142bd003f40f3aaa (patch)
treecbd191c05f7339d1fa502ed8efe880abd772fd1e /CMakeLists.txt
parent1531c49730e33e897cdfbdd0bf88267dd7f7c0f4 (diff)
downloadhdf5-a29f9e8451ffa391c8395db1142bd003f40f3aaa.zip
hdf5-a29f9e8451ffa391c8395db1142bd003f40f3aaa.tar.gz
hdf5-a29f9e8451ffa391c8395db1142bd003f40f3aaa.tar.bz2
Merge changes from develop to fix various issues
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 15 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 41e1359..6f17f2d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,9 +1,9 @@
cmake_minimum_required (VERSION 3.10)
project (HDF5 C)
-if(POLICY CMP0074)
- cmake_policy(SET CMP0074 NEW)
-endif()
+if (POLICY CMP0074)
+ cmake_policy (SET CMP0074 NEW)
+endif ()
#-----------------------------------------------------------------------------
# Instructions for use : Normal Build
@@ -15,7 +15,7 @@ endif()
# Make install can be used to install all components for system-wide use.
#
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
- MESSAGE(FATAL_ERROR "\nERROR! ${PROJECT_NAME} DOES NOT SUPPORT IN SOURCE BUILDS!\n"
+ message (FATAL_ERROR "\nERROR! ${PROJECT_NAME} DOES NOT SUPPORT IN SOURCE BUILDS!\n"
"CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
" == CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}\n"
"NEXT STEPS:\n"
@@ -100,7 +100,7 @@ mark_as_advanced (HDF5_EXTERNAL_LIB_PREFIX)
# # Add the sub project
# add_subdirectory (Utilities/hdf5-1.8)
#-----------------------------------------------------------------------------
-string(TIMESTAMP CONFIG_DATE "%Y-%m-%d")
+string (TIMESTAMP CONFIG_DATE "%Y-%m-%d")
#-----------------------------------------------------------------------------
# Allow Visual Studio solution directories
@@ -440,6 +440,7 @@ set (H5_ENABLE_STATIC_LIB NO)
option (BUILD_SHARED_LIBS "Build Shared Libraries" ON)
set (H5_ENABLE_SHARED_LIB NO)
option (ONLY_SHARED_LIBS "Only Build Shared Libraries" OFF)
+mark_as_advanced (ONLY_SHARED_LIBS)
if (BUILD_STATIC_LIBS)
set (H5_ENABLE_STATIC_LIB YES)
@@ -460,6 +461,12 @@ endif ()
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
+if (NOT BUILD_SHARED_LIBS)
+ set (tgt_file_ext "")
+else ()
+ set (tgt_file_ext "-shared")
+endif ()
+
#-----------------------------------------------------------------------------
# Option to Build Static executables
#-----------------------------------------------------------------------------
@@ -485,7 +492,7 @@ option (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" O
if (HDF5_ENABLE_COVERAGE)
include (${HDF5_SOURCE_DIR}/config/sanitizer/code-coverage.cmake)
if(CODE_COVERAGE AND CODE_COVERAGE_ADDED)
- add_code_coverage() # Adds instrumentation to all targets
+ add_code_coverage () # Adds instrumentation to all targets
else ()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g --coverage -O0 -fprofile-arcs -ftest-coverage")
@@ -784,8 +791,8 @@ if (HDF5_ENABLE_THREADSAFE)
message (FATAL_ERROR " **** thread-safe option requires Win32 threads or Pthreads **** ")
endif ()
endif ()
- set(THREADS_PREFER_PTHREAD_FLAG ON)
- find_package(Threads REQUIRED)
+ set (THREADS_PREFER_PTHREAD_FLAG ON)
+ find_package (Threads REQUIRED)
if (Threads_FOUND)
set (H5_HAVE_THREADSAFE 1)
endif ()