Pass JPEG_INCLUDE_DIR to try_run while trying to determine the libjpeg version

Review Request #126598 - Created Jan. 2, 2016 and submitted

Tobias Berner

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

Build locally.

Albert Astals Cid
Tobias Berner
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit ba67ff9492e7386789f0bab192e416bac4f92a23 by Albert Astals Cid on behalf of Tobias Berner to branch Applications/16.08.