diff --git a/dumux/io/format/fmt/format.cc b/dumux/io/format/fmt/format.cc
index 95d367287e99c92a1a3607fcf19ecf4718895734..f5ab5c6d6338c0780335dda99051f721ebc3e206 100644
--- a/dumux/io/format/fmt/format.cc
+++ b/dumux/io/format/fmt/format.cc
@@ -9,6 +9,10 @@
 //
 // For the license information refer to format.h.
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "format-inl.h"
 
 FMT_BEGIN_NAMESPACE
diff --git a/python/dumux/common/_common.cc b/python/dumux/common/_common.cc
index 19e51e09a81098e9cecf02315ea3ef076d292be3..64c8c6ef31b25d6d740e3b6b8bf6f24a29a5c6ab 100644
--- a/python/dumux/common/_common.cc
+++ b/python/dumux/common/_common.cc
@@ -5,6 +5,10 @@
 // SPDX-License-Identifier: GPL-3.0-or-later
 //
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <dune/python/pybind11/pybind11.h>
 #include <dune/python/pybind11/stl.h>
 
diff --git a/test/common/propertysystem/test_propertysystem.cc b/test/common/propertysystem/test_propertysystem.cc
index 47acac0631f17146016f70ac951022ab22cb6660..ee62a5b0f30887c90c403b8fe7506b3c1ba19176 100644
--- a/test/common/propertysystem/test_propertysystem.cc
+++ b/test/common/propertysystem/test_propertysystem.cc
@@ -11,6 +11,10 @@
  * \brief Testing the Dumux property system
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 #include <type_traits>
 
diff --git a/test/common/propertysystem/test_propertysystem_aliases.cc b/test/common/propertysystem/test_propertysystem_aliases.cc
index 1689f8388ca828fc0812e1f97f7bde6428403efa..63de24678654922b48ce6309837f0ef29ddac16b 100644
--- a/test/common/propertysystem/test_propertysystem_aliases.cc
+++ b/test/common/propertysystem/test_propertysystem_aliases.cc
@@ -11,6 +11,10 @@
  * \brief Testing the Dumux property system
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 #include <type_traits>
 
diff --git a/test/common/propertysystem/test_propertysystem_example.cc b/test/common/propertysystem/test_propertysystem_example.cc
index d264eaa8a6c9ac0123948fe4fa9beb8908acade0..7a3107e939f9886e9db7977d307540b527d1eaff 100644
--- a/test/common/propertysystem/test_propertysystem_example.cc
+++ b/test/common/propertysystem/test_propertysystem_example.cc
@@ -10,6 +10,11 @@
  * \ingroup Tests
  * \brief A property system example using property type aliases
  */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 #include <type_traits>
 #include <dumux/common/properties/propertysystem.hh>
diff --git a/test/io/chrono/test_chrono.cc b/test/io/chrono/test_chrono.cc
index b1cb2593aac50238f00bcda402b75a8403316fe6..6726db3c8a1c1628e507da21eb67e4ebb45cd9ef 100644
--- a/test/io/chrono/test_chrono.cc
+++ b/test/io/chrono/test_chrono.cc
@@ -2,6 +2,11 @@
 // SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
 // SPDX-License-Identifier: GPL-3.0-or-later
 //
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <dune/common/exceptions.hh>