summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-01-10 17:27:41 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-01-10 17:27:41 (GMT)
commite994a90cdf664113b443aa93a83b8bed0159d2f3 (patch)
treec22fa3642fea7126c93186928559b9a65c0c8846 /config
parent7bd06dccb543a35763a967e3f84f3c8d89f0c538 (diff)
downloadhdf5-e994a90cdf664113b443aa93a83b8bed0159d2f3.zip
hdf5-e994a90cdf664113b443aa93a83b8bed0159d2f3.tar.gz
hdf5-e994a90cdf664113b443aa93a83b8bed0159d2f3.tar.bz2
HDFFV-10385 fix CMAKE_BUILD_TYPE usage
Diffstat (limited to 'config')
-rw-r--r--config/cmake/HDFCompilerFlags.cmake6
-rw-r--r--config/cmake/hdf5-config.cmake.in14
-rw-r--r--config/cmake/libhdf5.settings.cmake.in2
-rw-r--r--config/cmake_ext_mod/HDFMacros.cmake25
4 files changed, 31 insertions, 16 deletions
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index 5f71f33..eeb4b97 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 (CMAKE_BUILD_TYPE MATCHES Debug)
+ if (HDF5_BUILD_TYPE 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 (CMAKE_BUILD_TYPE MATCHES Debug)
+ else (HDF5_BUILD_TYPE 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} -fstdarg-opt")
@@ -26,7 +26,7 @@ if (CMAKE_COMPILER_IS_GNUCC)
endif ()
endif ()
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
- if (CMAKE_BUILD_TYPE MATCHES Debug)
+ if (HDF5_BUILD_TYPE 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/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in
index 14859c1..4bb5616 100644
--- a/config/cmake/hdf5-config.cmake.in
+++ b/config/cmake/hdf5-config.cmake.in
@@ -49,14 +49,18 @@ set (${HDF5_PACKAGE_NAME}_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
# Dependencies
#-----------------------------------------------------------------------------
if (${HDF5_PACKAGE_NAME}_ENABLE_PARALLEL)
- set (${HDF5_PACKAGE_NAME}_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_PATH@")
+ set (${HDF5_PACKAGE_NAME}_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_DIRS@")
set (${HDF5_PACKAGE_NAME}_MPI_C_LIBRARIES "@MPI_C_LIBRARIES@")
+ if (${HDF5_PACKAGE_NAME}_BUILD_FORTRAN)
+ set (${HDF5_PACKAGE_NAME}_MPI_Fortran_INCLUDE_PATH "@MPI_Fortran_INCLUDE_DIRS@")
+ set (${HDF5_PACKAGE_NAME}_MPI_Fortran_LIBRARIES "@MPI_Fortran_LIBRARIES@")
+ endif ()
endif ()
#-----------------------------------------------------------------------------
# Directories
#-----------------------------------------------------------------------------
-set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@" "${${HDF5_PACKAGE_NAME}_MPI_C_INCLUDE_PATH}")
+set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@" "${${HDF5_PACKAGE_NAME}_MPI_C_INCLUDE_DIRS}")
set (${HDF5_PACKAGE_NAME}_SHARE_DIR "@PACKAGE_SHARE_INSTALL_DIR@")
set_and_check (${HDF5_PACKAGE_NAME}_BUILD_DIR "@PACKAGE_CURRENT_BUILD_DIR@")
@@ -90,12 +94,6 @@ set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@)
# project which has already built hdf5 as a subproject
#-----------------------------------------------------------------------------
if (NOT TARGET "@HDF5_PACKAGE@")
- if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
- include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
- endif ()
- if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "szip")
- include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
- endif ()
include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
endif ()
diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in
index 8ef67a5..e9b1a39 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: @CMAKE_BUILD_TYPE@
+ Compilation Mode: @HDF5_BUILD_TYPE@
C Compiler: @CMAKE_C_COMPILER@
CFLAGS: @CMAKE_C_FLAGS@
H5_CFLAGS: @H5_CFLAGS@
diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake
index 192a5c8..4c2aeb9 100644
--- a/config/cmake_ext_mod/HDFMacros.cmake
+++ b/config/cmake_ext_mod/HDFMacros.cmake
@@ -9,6 +9,23 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
+
+#-------------------------------------------------------------------------------
+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})
+ else()
+ if(CMAKE_BUILD_TYPE)
+ set(HDF5_BUILD_TYPE ${CMAKE_BUILD_TYPE})
+ set(HDF5_CFG_BUILD_TYPE ${CMAKE_BUILD_TYPE})
+ else()
+ set(HDF5_BUILD_TYPE "Release")
+ set(HDF5_CFG_BUILD_TYPE "Release")
+ endif()
+ endif()
+endmacro ()
+
#-------------------------------------------------------------------------------
macro (SET_GLOBAL_VARIABLE name value)
set (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE)
@@ -145,7 +162,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion)
if (${importtype} MATCHES "IMPORT")
set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}")
endif ()
- if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
+ if (${HDF5_BUILD_TYPE} MATCHES "Debug")
set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME})
else ()
set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME})
@@ -160,8 +177,8 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion)
)
else ()
set_target_properties (${libtarget} PROPERTIES
- IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
- IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}"
+ 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}"
)
endif ()
else ()
@@ -181,7 +198,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}/${CMAKE_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${HDF5_BUILD_TYPE}/${IMPORT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
)
else ()