diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 94725a70c5836175de1034418d85e88eabdafc28..94312aeb9bf60acbcb11a9aa2e01d2ae93aba906 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -149,10 +149,10 @@ if(ROOT_mathmore_FOUND)
 endif()
 
 #--stressMathCore----------------------------------------------------------------------------------
-if(ROOT_mathcore_FOUND)
-  ROOT_EXECUTABLE(stressMathCore stressMathCore.cxx LIBRARIES MathCore)
-  ROOT_ADD_TEST(test-stressmathcore COMMAND stressMathCore FAILREGEX "FAILED")  
-endif()
+ROOT_GENERATE_DICTIONARY(TrackMathCoreDictionary ${CMAKE_CURRENT_SOURCE_DIR}/TrackMathCore.h MODULE TrackMathCoreDictionary LINKDEF TrackMathCoreLinkDef.h)
+ROOT_LINKER_LIBRARY(TrackMathCoreDict TrackMathCoreDictionary.cxx LIBRARIES Core MathCore RIO GenVector)
+ROOT_EXECUTABLE(stressMathCore stressMathCore.cxx LIBRARIES MathCore Hist RIO Tree GenVector)
+ROOT_ADD_TEST(test-stressmathcore COMMAND stressMathCore FAILREGEX "FAILED")  
 
 #--stressRooFit----------------------------------------------------------------------------------
 if(ROOT_roofit_FOUND)