diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-02-11 20:28:56 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-02-11 20:28:56 (GMT) |
commit | 4ec2df9ac08f0c28eb32211c3cb0139a73f82981 (patch) | |
tree | 5fd3daa9f8168cfb46902bd62ad070c6639796de /CMakeLists.txt | |
parent | bd5d6e4e772fe557ab52f881df17f73a4028184b (diff) | |
download | hdf5-4ec2df9ac08f0c28eb32211c3cb0139a73f82981.zip hdf5-4ec2df9ac08f0c28eb32211c3cb0139a73f82981.tar.gz hdf5-4ec2df9ac08f0c28eb32211c3cb0139a73f82981.tar.bz2 |
Merge from dev, sanitizer, fortran, warnings and tools ids
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index faeac44..0127bcb 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") @@ -776,8 +783,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 () |