diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index 7c31f3a1b70f76ec73a70b9883a4ad63ccb012b2..2672730e88ea259814886e9e9f7a1972cd3ec5a0 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -88,6 +88,15 @@ typedef int siginfo_t;
 #  include <ifaddrs.h>
 #  define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN
 # endif
+# if defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE)
+#  include <execinfo.h>
+#  if defined(KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE)
+#    include <cxxabi.h>
+#  endif
+#  if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP)
+#    include <dlfcn.h>
+#  endif
+# endif
 #endif
 
 #if defined(__OpenBSD__) || defined(__NetBSD__)