--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -573,6 +573,7 @@
   PATHS ${LEVMAR_ROOT}/lib ${LEVMAR_ROOT}/lib64 /opt/levmar/lib
   DOC "Location of the levmar library"
 )
+include(CheckIncludeFile)
 check_include_file("levmar.h" LEVMAR_HEADER_FOUND)
 if(LEVMAR_LIBRARY AND LEVMAR_HEADER_FOUND)
   target_link_libraries(abinit ${LEVMAR_LIBRARY})
