summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-01-28 19:14:59 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-01-28 19:14:59 (GMT)
commit527aaa32b24d46e870794a44e8f803711dcea128 (patch)
tree0f8bf7f6ceda6210e73028a09c8c82a3f479530e /CMakeLists.txt
parentc8e9e105938766459b6ae6a02e9800bd6abea1cc (diff)
downloadhdf5-527aaa32b24d46e870794a44e8f803711dcea128.zip
hdf5-527aaa32b24d46e870794a44e8f803711dcea128.tar.gz
hdf5-527aaa32b24d46e870794a44e8f803711dcea128.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 ()