--- a/CMakeModules/FindJPEG.cmake
+++ b/CMakeModules/FindJPEG.cmake
@@ -9,7 +9,7 @@
 # to locate include and library files
 #
 include(CheckLibraryExists)
-include(CheckIncludeFile)
+include(CheckIncludeFiles)
 
 set(JPEG_INCLUDE_DIR CACHE STRING "Location of JPEG include files")
 set(JPEG_LIBRARY_DIR CACHE STRING "Location of JPEG library files")
@@ -18,7 +18,7 @@ if(JPEG_INCLUDE_DIR)
   set(CMAKE_REQUIRED_INCLUDES ${JPEG_INCLUDE_DIR})
 endif(JPEG_INCLUDE_DIR)
 
-check_include_file(jpeglib.h HAVE_JPEGLIB_H)
+check_include_files("stdio.h;jpeglib.h" HAVE_JPEGLIB_H)
 
 find_library(JPEG_LIBRARY NAMES jpeg libjpeg PATHS ${JPEG_LIBRARY_DIR})
 if(JPEG_LIBRARY)
@@ -37,4 +37,4 @@ endif(JPEG_DLL)
 endif(WIN32 AND HAVE_JPEG_LIBRARY)
 
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(JPEG DEFAULT_MSG HAVE_JPEG_LIBRARY HAVE_LIBJPEG_H)
+find_package_handle_standard_args(JPEG DEFAULT_MSG HAVE_JPEG_LIBRARY HAVE_JPEGLIB_H)
