fixed classic cmake builds without logging
@@ -388,18 +388,6 @@ IF(ENABLE_DISKLESS)
SET(USE_DISKLESS ON)
ENDIF()
-# Option Logging, only valid for netcdf4.
-OPTION(ENABLE_LOGGING "Enable Logging." OFF)
-IF(ENABLE_LOGGING)
- ADD_DEFINITIONS(-DLOGGING)
- ADD_DEFINITIONS(-DENABLE_SET_LOG_LEVEL)
- SET(LOGGING ON)
-ENDIF()
-OPTION(ENABLE_SET_LOG_LEVEL_FUNC "Enable definition of nc_set_log_level()." ON)
-IF((NOT ENABLE_LOGGING AND ENABLE_SET_LOG_LEVEL_FUNC) OR ENABLE_LOGGING)
- ADD_DEFINITIONS(-DENABLE_SET_LOG_LEVEL)
-ENDIF()
-
# Option to automatically build netcdf-fortran.
IF(NOT MSVC)
OPTION(ENABLE_REMOTE_FORTRAN_BOOTSTRAP "Download and build netcdf-fortran automatically (EXPERIMENTAL)." OFF)
@@ -538,6 +526,18 @@ ELSE()
SET(ENABLE_HDF4 OFF)
ENDIF()
+# Option Logging, only valid for netcdf4.
+OPTION(ENABLE_LOGGING "Enable Logging." OFF)
+IF(ENABLE_LOGGING)
+ ADD_DEFINITIONS(-DLOGGING)
+ ADD_DEFINITIONS(-DENABLE_SET_LOG_LEVEL)
+ SET(LOGGING ON)
+ENDIF()
+OPTION(ENABLE_SET_LOG_LEVEL_FUNC "Enable definition of nc_set_log_level()." ON)
+IF(ENABLE_NETCDF_$ AND (NOT ENABLE_LOGGING AND ENABLE_SET_LOG_LEVEL_FUNC) OR ENABLE_LOGGING)
+ ADD_DEFINITIONS(-DENABLE_SET_LOG_LEVEL)
+ENDIF()
+
# Option to allow for strict null file padding.
# See https://github.com/Unidata/netcdf-c/issues/657 for more information
OPTION(ENABLE_STRICT_NULL_BYTE_HEADER_PADDING "Enable strict null byte header padding." OFF)
