Pass JPEG_INCLUDE_DIR to try_run while trying to determine the libjpeg version
Review Request #126598 - Created Jan. 2, 2016 and submitted
On FreeBSD JPEG_INCLUDE_DIR is correctly set to /usr/local/include, yet it
is not passed to try_run. Which makes the configure process fail with
| -- Looking for libjpeg version in /usr/local/include/jpeglib.h
| CMake Error at lib/CMakeLists.txt:27 (message):
| Could not find jpeglib.h. This file comes with libjpeg.
This patch passes it via INCLUDE_DIRECTORIES to try_run, fixing the configure.
Note, this is similar to the abandoned request #125082