summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-01-28 19:14:59 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-05-20 14:31:53 (GMT)
commitb44b3d136d70d29adc36b22673a19aaf52114c94 (patch)
tree46a2bb6baab46a6a69365c5e8fb3c39d97752f8e /CMakeLists.txt
parent2e962dc49b0b0ec27cb8e2bbc2b1436b2f192bd5 (diff)
downloadhdf5-b44b3d136d70d29adc36b22673a19aaf52114c94.zip
hdf5-b44b3d136d70d29adc36b22673a19aaf52114c94.tar.gz
hdf5-b44b3d136d70d29adc36b22673a19aaf52114c94.tar.bz2
HDFFV-11011 correct issues with target file extension
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 1466865..dbbf55f 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")
@@ -795,8 +802,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 ()