summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-01-22 17:56:54 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-01-22 17:56:54 (GMT)
commitef4aa562dd3af4b104cc3551d12fd5583f09ca1a (patch)
treeade5507502a71f97b70674f2195016ad27d7a78c /config
parent775fdbe92711de5e6929d825045f4ad63d01d51d (diff)
downloadhdf5-ef4aa562dd3af4b104cc3551d12fd5583f09ca1a.zip
hdf5-ef4aa562dd3af4b104cc3551d12fd5583f09ca1a.tar.gz
hdf5-ef4aa562dd3af4b104cc3551d12fd5583f09ca1a.tar.bz2
HDFFV-10392,10393,01385 merge from develop
Diffstat (limited to 'config')
-rw-r--r--config/cmake/HDFCompilerFlags.cmake6
-rw-r--r--config/cmake/libhdf5.settings.cmake.in2
-rwxr-xr-xconfig/cmake/scripts/HDF5config.cmake2
-rw-r--r--config/cmake_ext_mod/HDFMacros.cmake69
4 files changed, 42 insertions, 37 deletions
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index eeb4b97..a414cea 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -13,12 +13,12 @@
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
- if (HDF5_BUILD_TYPE MATCHES Debug)
+ if (${HDF_CFG_NAME} MATCHES "Debug")
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99")
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common")
endif ()
- else (HDF5_BUILD_TYPE MATCHES Debug)
+ else ()
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99")
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt")
@@ -26,7 +26,7 @@ if (CMAKE_COMPILER_IS_GNUCC)
endif ()
endif ()
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- if (HDF5_BUILD_TYPE MATCHES Debug)
+ if (${HDF_CFG_NAME} MATCHES "Debug")
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common")
diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in
index e9b1a39..5d97172 100644
--- a/config/cmake/libhdf5.settings.cmake.in
+++ b/config/cmake/libhdf5.settings.cmake.in
@@ -15,7 +15,7 @@ General Information:
Compiling Options:
------------------
- Compilation Mode: @HDF5_BUILD_TYPE@
+ Compilation Mode: @HDF_BUILD_TYPE@
C Compiler: @CMAKE_C_COMPILER@
CFLAGS: @CMAKE_C_FLAGS@
H5_CFLAGS: @H5_CFLAGS@
diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake
index 724d4f0..e6e0936 100755
--- a/config/cmake/scripts/HDF5config.cmake
+++ b/config/cmake/scripts/HDF5config.cmake
@@ -8,7 +8,7 @@
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
-
+#
#############################################################################################
### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ###
### BUILD_GENERATOR required [Unix, VS2017, VS201764, VS2015, VS201564, VS2013, VS201364] ###
diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake
index 96febde..1326420 100644
--- a/config/cmake_ext_mod/HDFMacros.cmake
+++ b/config/cmake_ext_mod/HDFMacros.cmake
@@ -11,18 +11,25 @@
#
#-------------------------------------------------------------------------------
-macro (SET_HDF5_BUILD_TYPE)
- if(CMAKE_CONFIGURATION_TYPES)
- set(HDF5_BUILD_TYPE ${CMAKE_CFG_INTDIR})
- set(HDF5_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME})
+macro (SET_HDF_BUILD_TYPE)
+ get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+ if(_isMultiConfig)
+ set(HDF_CFG_NAME ${CTEST_CONFIGURATION_TYPE})
+ set(HDF_BUILD_TYPE ${CMAKE_CFG_INTDIR})
+ set(HDF_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME})
else()
- set(HDF5_CFG_BUILD_TYPE ".")
+ set(HDF_CFG_BUILD_TYPE ".")
if(CMAKE_BUILD_TYPE)
- set(HDF5_BUILD_TYPE ${CMAKE_BUILD_TYPE})
+ set(HDF_CFG_NAME ${CMAKE_BUILD_TYPE})
+ set(HDF_BUILD_TYPE ${CMAKE_BUILD_TYPE})
else()
- set(HDF5_BUILD_TYPE "Release")
+ set(HDF_CFG_NAME "Release")
+ set(HDF_BUILD_TYPE "Release")
endif()
endif()
+ if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE "Release")
+ endif()
endmacro ()
#-------------------------------------------------------------------------------
@@ -61,13 +68,6 @@ macro (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES)
endmacro ()
#-------------------------------------------------------------------------------
-macro (TARGET_NAMING libtarget libtype)
- if (${libtype} MATCHES "SHARED")
- set_target_properties (${libtarget} PROPERTIES OUTPUT_NAME "${libtarget}${ARGN}")
- endif ()
-endmacro ()
-
-#-------------------------------------------------------------------------------
macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent)
if (WIN32 AND MSVC)
get_target_property (target_type ${libtarget} TYPE)
@@ -104,31 +104,36 @@ endmacro ()
#-------------------------------------------------------------------------------
macro (HDF_SET_LIB_OPTIONS libtarget libname libtype)
+ if (WIN32)
+ set (LIB_DEBUG_SUFFIX "_D")
+ else ()
+ set (LIB_DEBUG_SUFFIX "_debug")
+ endif ()
if (${libtype} MATCHES "SHARED")
- if (WIN32)
- set (LIB_RELEASE_NAME "${libname}")
- set (LIB_DEBUG_NAME "${libname}_D")
- else ()
- set (LIB_RELEASE_NAME "${libname}")
- set (LIB_DEBUG_NAME "${libname}_debug")
- endif ()
+ set (LIB_RELEASE_NAME "${libname}")
+ set (LIB_DEBUG_NAME "${libname}${LIB_DEBUG_SUFFIX}")
else ()
if (WIN32)
set (LIB_RELEASE_NAME "lib${libname}")
- set (LIB_DEBUG_NAME "lib${libname}_D")
+ set (LIB_DEBUG_NAME "lib${libname}${LIB_DEBUG_SUFFIX}")
else ()
set (LIB_RELEASE_NAME "${libname}")
- set (LIB_DEBUG_NAME "${libname}_debug")
+ set (LIB_DEBUG_NAME "${libname}${LIB_DEBUG_SUFFIX}")
endif ()
endif ()
set_target_properties (${libtarget}
PROPERTIES
- OUTPUT_NAME ${LIB_RELEASE_NAME}
- OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME}
- OUTPUT_NAME_RELEASE ${LIB_RELEASE_NAME}
- OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME}
- OUTPUT_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME}
+ OUTPUT_NAME
+ ${LIB_RELEASE_NAME}
+ OUTPUT_NAME_DEBUG
+ ${LIB_DEBUG_NAME}
+ OUTPUT_NAME_RELEASE
+ ${LIB_RELEASE_NAME}
+ OUTPUT_NAME_MINSIZEREL
+ ${LIB_RELEASE_NAME}
+ OUTPUT_NAME_RELWITHDEBINFO
+ ${LIB_RELEASE_NAME}
)
if (${libtype} MATCHES "STATIC")
if (WIN32)
@@ -161,7 +166,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion)
if (${importtype} MATCHES "IMPORT")
set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}")
endif ()
- if (${HDF5_BUILD_TYPE} MATCHES "Debug")
+ if (${HDF_CFG_NAME} MATCHES "Debug")
set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME})
else ()
set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME})
@@ -176,8 +181,8 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion)
)
else ()
set_target_properties (${libtarget} PROPERTIES
- IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
- IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}"
+ IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}"
)
endif ()
else ()
@@ -197,7 +202,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion)
else ()
if (WIN32 AND NOT MINGW)
set_target_properties (${libtarget} PROPERTIES
- IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
)
else ()