diff --git a/CMakeLists.txt b/CMakeLists.txt index 41dc253f8..89c6fd9b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1718,7 +1718,7 @@ message(STATUS ${LIBNETCDF_SETTINGS}) ### if(DEFINED DEPR_OPT) - message(STATUS ${DEPR_OPT}) + message(WARNING "Warning! Deprecated Options used. Please migrate your build system as follows:\n${DEPR_OPT}" ) endif() # Install libnetcdf.settings file into same location # as the libraries. diff --git a/cmake/deprecated.cmake b/cmake/deprecated.cmake index 350970cff..caa4c61c7 100644 --- a/cmake/deprecated.cmake +++ b/cmake/deprecated.cmake @@ -12,20 +12,16 @@ function(check_depr_opt arg) if(DEFINED ${arg}) - if(NOT DEFINED DEPR_OPT) - set(DEPR_OPT "Warning! Deprecated Options used. Please migrate your build system as follows:" CACHE INTERNAL "" FORCE) - endif() - #message(STATUS "arg: ${arg} - ${${arg}}") + set(val ${${arg}}) - #MESSAGE("val: ${val}") message(WARNING "${arg} is deprecated and will be removed. Please use NETCDF_${arg} in the future") - set(NETCDF_${arg} ${val} CACHE INTERNAL "" FORCE) + set(NETCDF_${arg} ${val} PARENT_SCOPE) set(DEPR_OPT "${DEPR_OPT}\n\to ${arg} --> NETCDF_${arg}" PARENT_SCOPE) endif() endfunction() -MESSAGE(STATUS "Checking for Deprecated Options") +message(STATUS "Checking for Deprecated Options") list(APPEND opts BUILD_UTILITIES ENABLE_BENCHMARKS ENABLE_BYTERANGE ENABLE_CDF5 ENABLE_CONVERSION_WARNINGS) list(APPEND opts ENABLE_DAP ENABLE_DAP2 ENABLE_DAP4 ENABLE_DISKLESS ENABLE_DOXYGEN ENABLE_ERANGE_FILL) list(APPEND opts ENABLE_EXAMPLES ENABLE_EXAMPLES_TESTS ENABLE_EXTREME_NUMBERS ENABLE_FFIO ENABLE_FILTER_BLOSC)