summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-01-18 22:54:55 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-01-18 22:55:01 (GMT)
commit0f5ada2e0819bc107b2da0fc7d9a93bc4cd5b200 (patch)
tree1cad6f42c10dba605cdc5e51ab1d45143ef7c9ca
parenta2fbe6c7d835bb88645940c3f6191669d2df75eb (diff)
downloadhdf5-0f5ada2e0819bc107b2da0fc7d9a93bc4cd5b200.zip
hdf5-0f5ada2e0819bc107b2da0fc7d9a93bc4cd5b200.tar.gz
hdf5-0f5ada2e0819bc107b2da0fc7d9a93bc4cd5b200.tar.bz2
HDFFV-10385 Refactor out CMAKE_BUILD_TYPE usage
-rw-r--r--CMakeLists.txt2
-rw-r--r--config/cmake/HDFCompilerFlags.cmake4
-rw-r--r--config/cmake_ext_mod/HDFMacros.cmake19
-rw-r--r--test/CMakeTests.cmake2
4 files changed, 10 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cb01cd4..1663df4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -584,7 +584,7 @@ option (HDF5_BUILD_GENERATORS "Build Test Generators" OFF)
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF)
mark_as_advanced (HDF5_ENABLE_TRACE)
-if (CMAKE_BUILD_TYPE MATCHES Debug)
+if (${HDF5_CFG_NAME} MATCHES "Debug")
add_definitions (-DDEBUG)
# Enable tracing of the API
if (HDF5_ENABLE_TRACE)
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index 72d320c..c126b24 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -13,7 +13,7 @@
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
- if (CMAKE_BUILD_TYPE MATCHES Debug)
+ if (${HDF5_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")
@@ -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_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_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake
index 2813de6..d7d256f 100644
--- a/config/cmake_ext_mod/HDFMacros.cmake
+++ b/config/cmake_ext_mod/HDFMacros.cmake
@@ -104,35 +104,28 @@ endmacro ()
#-------------------------------------------------------------------------------
macro (HDF_SET_LIB_OPTIONS libtarget libname libtype)
- set (LIB_DEBUG_PREFIX "")
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_DEBUG_PREFIX "lib")
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_DEBUG_PREFIX}${libname}$<$<CONFIG:Debug>:${LIB_DEBUG_SUFFIX}>
+# ${LIB_RELEASE_NAME}$<$<CONFIG:Debug>:${LIB_DEBUG_SUFFIX}>
OUTPUT_NAME_DEBUG
${LIB_DEBUG_NAME}
OUTPUT_NAME_RELEASE
@@ -173,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 (${CMAKE_BUILD_TYPE} MATCHES "Debug")
+ if (${HDF5_CFG_NAME} MATCHES "Debug")
set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME})
else ()
set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME})
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index 165b6d8..dd92065 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -1133,7 +1133,7 @@ if (HDF5_TEST_VFD)
macro (CHECK_VFD_TEST vfdtest vfdname resultcode)
if ("${vfdtest}" STREQUAL "flush1" OR "${vfdtest}" STREQUAL "flush2")
if ("${vfdname}" STREQUAL "multi" OR "${vfdname}" STREQUAL "split")
- if (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug)
+ if (NOT BUILD_SHARED_LIBS AND NOT ${HDF5_CFG_NAME} MATCHES "Debug")
add_test (NAME VFD-${vfdname}-${vfdtest}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>"