summaryrefslogtreecommitdiffstats
path: root/config/cmake/HDFCompilerFlags.cmake
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-09-17 20:44:14 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-09-17 20:44:14 (GMT)
commit00aa36a6905f2fef640b862f679e12bb98cb93b4 (patch)
treeee5b214f4d1fb35d9aa3b51828c140773ff3aa61 /config/cmake/HDFCompilerFlags.cmake
parent7449e6a2c62ca5b7e38b4ba522f91cf117f4e027 (diff)
downloadhdf5-00aa36a6905f2fef640b862f679e12bb98cb93b4.zip
hdf5-00aa36a6905f2fef640b862f679e12bb98cb93b4.tar.gz
hdf5-00aa36a6905f2fef640b862f679e12bb98cb93b4.tar.bz2
Correct HDF5 options to tristate values
Diffstat (limited to 'config/cmake/HDFCompilerFlags.cmake')
-rw-r--r--config/cmake/HDFCompilerFlags.cmake16
1 files changed, 10 insertions, 6 deletions
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index 37ddcbb..adace89 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -346,10 +346,12 @@ endif ()
# By default, CMake adds NDEBUG to CMAKE_${lang}_FLAGS for Release build types
# This option will force/override the default setting for all configurations
#-----------------------------------------------------------------------------
-option (HDF5_ENABLE_ASSERTS "Determines whether NDEBUG is defined to control assertions." OFF)
-if (HDF5_ENABLE_ASSERTS)
+#option (HDF5_ENABLE_ASSERTS "Determines whether NDEBUG is defined to control assertions." OFF)
+set (HDF5_ENABLE_ASSERTS "OFF" CACHE STRING "Determines whether NDEBUG is defined to control assertions (OFF NO YES)")
+set_property (CACHE HDF5_ENABLE_ASSERTS PROPERTY STRINGS OFF NO YES)
+if (HDF5_ENABLE_ASSERTS MATCHES "YES")
add_compile_options ("-UNDEBUG")
-else ()
+elseif (HDF5_ENABLE_ASSERTS MATCHES "NO")
add_compile_options ("-DNDEBUG")
endif ()
MARK_AS_ADVANCED (HDF5_ENABLE_ASSERTS)
@@ -358,8 +360,10 @@ MARK_AS_ADVANCED (HDF5_ENABLE_ASSERTS)
# Option for --enable-symbols
# This option will force/override the default setting for all configurations
#-----------------------------------------------------------------------------
-option (HDF5_ENABLE_SYMBOLS "Add debug symbols to the library independent of the build mode and optimization level." OFF)
-if (HDF5_ENABLE_SYMBOLS)
+#option (HDF5_ENABLE_SYMBOLS "Add debug symbols to the library independent of the build mode and optimization level." OFF)
+set (HDF5_ENABLE_SYMBOLS "OFF" CACHE STRING "Add debug symbols to the library independent of the build mode and optimization level (OFF NO YES)")
+set_property (CACHE HDF5_ENABLE_SYMBOLS PROPERTY STRINGS OFF NO YES)
+if (HDF5_ENABLE_SYMBOLS MATCHES "YES")
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
@@ -372,7 +376,7 @@ if (HDF5_ENABLE_SYMBOLS)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
endif ()
endif ()
-else ()
+elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO")
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-s")
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")