diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09c40dab22892a3a690f20c669cb3f50019d9cb2..1d292a9084f0749f5f778cbbfa447ba4b957dd32 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -559,7 +559,7 @@ else (NOT CHAMELEON_SIMULATION)
         "   else set CHAMELEON_USE_CUDA=OFF. The same idea is applicable with MAGMA."
         "${ColourReset}")
     endif()
-    if(NOT CHAMELEON_USE_MAGMA)
+    if(NOT DEFINED CHAMELEON_USE_MAGMA)
         message(WARNING "${BoldBlue}"
         "In simulation mode CHAMELEON_USE_CUDA and CHAMELEON_USE_MAGMA should be set to"
         "   ensure that the user is aware of the version to be used. If Chameleon's"