diff --git a/Code/Mantid/Framework/Algorithms/test/CMakeLists.txt b/Code/Mantid/Framework/Algorithms/test/CMakeLists.txt
index 1e888c8f85ad23bd98ee52648b18a1351984c1fd..ecd712c4a33069322355abb380177fdfe45ab308 100644
--- a/Code/Mantid/Framework/Algorithms/test/CMakeLists.txt
+++ b/Code/Mantid/Framework/Algorithms/test/CMakeLists.txt
@@ -1,5 +1,14 @@
 if ( CXXTEST_FOUND )
   include_directories ( SYSTEM ${CXXTEST_INCLUDE_DIR} ${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR} )
+  check_include_files ( stdint.h stdint )
+  if ( stdint )
+     add_definitions ( -DHAVE_STDINT_H )
+   endif ()
+  check_include_files ( cstdint.hpp boost_stdint)
+  if ( boost_stdint )
+    add_definitions ( -DBOOST_CSTDINT_HPP )
+  endif ()
+
 
   # Generate the MultiplyTest.h and DivideTest.h
   set ( MULTIPLYDIVIDETEST_CLASS MultiplyTest )
diff --git a/Code/Mantid/Framework/CMakeLists.txt b/Code/Mantid/Framework/CMakeLists.txt
index a0216b8b62ec4077a05ec89a4156ffb816fb29b4..759609e457c71197ae7f176b31f9c4a97c45e755 100644
--- a/Code/Mantid/Framework/CMakeLists.txt
+++ b/Code/Mantid/Framework/CMakeLists.txt
@@ -37,6 +37,15 @@ if ( OPENMP_FOUND )
   set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
 endif ()
 
+check_include_files ( stdint.h stdint )
+if ( stdint )
+  add_definitions ( -DHAVE_STDINT_H )
+endif ()
+check_include_files ( cstdint.hpp boost_stdint)
+if ( boost_stdint )
+  add_definitions ( -DBOOST_CSTDINT_HPP )
+endif ()
+
 ###########################################################################
 # MPI-enable build setup
 ###########################################################################
diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/DateAndTime.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/DateAndTime.h
index b531300155d752c434794da6dd72800950fc15eb..811dab2711301aa3b2935f3687a2118517ce5456 100644
--- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/DateAndTime.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/DateAndTime.h
@@ -3,6 +3,7 @@
 
 #include "MantidKernel/DllConfig.h"
 #include "MantidKernel/Logger.h"
+#include "MantidKernel/System.h"
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <ctime>
 #include <ostream>