diff --git a/cmake/corsikaConfig.cmake.in b/cmake/corsikaConfig.cmake.in
index 5aadf213c332922f892a312efade3a477aa30589..81a499c04bb861e6a660d90bee533b461b30f694 100644
--- a/cmake/corsikaConfig.cmake.in
+++ b/cmake/corsikaConfig.cmake.in
@@ -8,6 +8,24 @@ set (CORSIKA8_VERSION @c8_version@)
 option (WITH_HISTORY "Flag to switch on/off HISTORY" ON)
 
 
+#+++++++++++++++++++++++++++++
+# Build types settings
+#
+# setup coverage build type
+set (CMAKE_CXX_FLAGS_COVERAGE "-g --coverage")
+set (CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage")
+set (CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage")
+# set a flag to inform code that we are in debug mode
+set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
+set (ALLOWED_BUILD_TYPES Debug Release MinSizeRel RelWithDebInfo Coverage)
+set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${ALLOWED_BUILD_TYPES})
+set (DEFAULT_BUILD_TYPE "Release")
+if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+  set (CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE
+    STRING "Choose the type of build." FORCE)
+endif (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+  
+
 #++++++++++++++++++++++++++++
 # General config and flags
 #
@@ -49,7 +67,11 @@ check_required_components (corsika)
 # add further definitions / options
 #
 if (WITH_HISTORY)
-  target_compile_definitions (CORSIKA8::CORSIKA8 INTERFACE "WITH_HISTORY")    
+  set_property (
+    TARGET CORSIKA8::CORSIKA8
+    APPEND PROPERTY
+    INTERFACE_COMPILE_DEFINITIONS "WITH_HISTORY"
+  )
 endif (WITH_HISTORY)