diff --git a/MathLib/CMakeLists.txt b/MathLib/CMakeLists.txt
index ca6bd559cd447321031ca2f1b2183efd2316093a..5b2627c59b2ecd83a3a6614f35af7252a2420ef1 100644
--- a/MathLib/CMakeLists.txt
+++ b/MathLib/CMakeLists.txt
@@ -57,8 +57,13 @@ target_compile_definitions(
         $<$<BOOL:${OGS_EIGEN_INITIALIZE_MATRICES_BY_NAN}>:EIGEN_INITIALIZE_MATRICES_BY_NAN>
         $<$<CONFIG:Debug>:EIGEN_INITIALIZE_MATRICES_BY_NAN>
         $<$<AND:$<BOOL:${OGS_USE_MKL}>,$<BOOL:${OGS_EIGEN_USE_MKL}>>:EIGEN_USE_MKL_ALL>
-    PRIVATE $<$<BOOL:${OGS_USE_MKL}>:USE_MKL>
 )
+if(OGS_USE_MKL)
+    set_source_files_properties(
+        LinAlg/Eigen/EigenLinearSolver.cpp PROPERTIES COMPILE_DEFINITIONS
+                                                      USE_MKL
+    )
+endif()
 
 target_precompile_headers(
     MathLib PRIVATE [["BaseLib/Error.h"]] [["BaseLib/ConfigTree.h"]]