diff --git a/CMakeLists.txt b/CMakeLists.txt
index db60f336d0..34ea0ed19d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,9 +65,16 @@ if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) # single-configuration ge
 endif()
 
 # enable extended messages of many OCCT algorithms
-set (BUILD_WITH_DEBUG OFF CACHE BOOL "${BUILD_WITH_DEBUG_DESCR}")
+if ((SINGLE_GENERATOR AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") OR NOT SINGLE_GENERATOR)
+  if (NOT BUILD_WITH_DEBUG)
+    set (BUILD_WITH_DEBUG OFF CACHE BOOL "${BUILD_WITH_DEBUG_DESCR}")
+  endif()
+else()
+  OCCT_CHECK_AND_UNSET (BUILD_WITH_DEBUG)
+endif()
+
 if (BUILD_WITH_DEBUG)
-  add_definitions (-DOCCT_DEBUG)
+  set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:DEBUG>:OCCT_DEBUG>)
 endif()
 
 # copy samples to install directory
diff --git a/adm/cmake/vardescr.cmake b/adm/cmake/vardescr.cmake
index 0c49d40c5a..baa6481770 100644
--- a/adm/cmake/vardescr.cmake
+++ b/adm/cmake/vardescr.cmake
@@ -19,8 +19,9 @@ ExprIntrp functionality are generated automatically with Flex/Bison. Checking th
 leads to automatic search of Flex/Bison binaries and regeneration of the mentioned files")
 
 set (BUILD_WITH_DEBUG_DESCR
-"Enables extended messages of many OCCT algorithms, usually printed to cout. 
-These include messages on internal errors and special cases encountered, timing etc")
+"Enables extended messages of many OCCT algorithms, usually printed to cout.
+These include messages on internal errors and special cases encountered, timing etc.
+Applies only for Debug configuration.")
 
 set (BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR
 "Append the postfix to names of output libraries")