diff --git a/src/cmake/SociBackend.cmake b/src/cmake/SociBackend.cmake
index d6557de..0f0980d 100644
--- a/src/cmake/SociBackend.cmake
+++ b/src/cmake/SociBackend.cmake
@@ -70,12 +70,12 @@ macro(soci_backend NAME)
     colormsg(_RED_ "WARNING:")
     colormsg(RED "Some required dependencies of ${NAME} backend not found:")
 
-    if (${CMAKE_VERSION} VERSION_LESS "2.8.0")
+    if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
       foreach(dep ${DEPENDS_NOT_FOUND})
         colormsg(RED "   ${dep}")
       endforeach()
     else()
-      foreach(dep IN LIST DEPENDS_NOT_FOUND)
+      foreach(dep IN LISTS DEPENDS_NOT_FOUND)
         colormsg(RED "   ${dep}")
       endforeach()
     endif()
diff --git a/src/cmake/SociUtilities.cmake b/src/cmake/SociUtilities.cmake
index 5555ef7..c0402ac 100644
--- a/src/cmake/SociUtilities.cmake
+++ b/src/cmake/SociUtilities.cmake
@@ -325,7 +325,7 @@ endfunction()
 #
 macro(dependency_check ARG)
   trace(ARG)
-  if (NOT ("${ARG}" STREQUAL ""))
+  if (NOT "${ARG}" STREQUAL "")
     get_target_property(deptype ${ARG} TYPE)
     if(NOT deptype MATCHES ".*_LIBRARY$")
       set(DEPENDENCY_OKAY FALSE)
