aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDRC <dcommander@users.sourceforge.net>2011-06-07 01:47:38 +0000
committerDRC <dcommander@users.sourceforge.net>2011-06-07 01:47:38 +0000
commit63b40b75a7053aa7860aafe8adddb4f860bc07b7 (patch)
tree8152b2d39ab0118824966a86812600f6f90fd94d
parent4abf75462107adffabc38a908428441445cae7ae (diff)
downloadtigervnc-63b40b75a7053aa7860aafe8adddb4f860bc07b7.tar.gz
tigervnc-63b40b75a7053aa7860aafe8adddb4f860bc07b7.zip
If JPEG_INCLUDE_DIR or JPEG_LIBRARY have been overridden on the CMake command line (necessary when building against the libjpeg-turbo SDK, which is installed in /opt/libjpeg-turbo), then use the overridden values when performing the test to determine whether or not the JPEG library is libjpeg-turbo.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4466 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 84a74d7c..15b458b9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -166,7 +166,13 @@ endif()
find_package(JPEG REQUIRED)
# Warn if it doesn't seem to be the accelerated libjpeg that's found
+set(CMAKE_REQUIRED_LIBRARIES_OLD ${CMAKE_REQUIRED_LIBRARIES})
+set(CMAKE_REQUIRED_FLAGS_OLD ${CMAKE_REQUIRED_FLAGS})
+set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARIES})
+set(CMAKE_REQUIRED_FLAGS -I${JPEG_INCLUDE_DIR})
check_c_source_compiles("#include <stdio.h>\n#include <jpeglib.h>\nint main(int c, char** v) { return JCS_EXT_RGBX; }" FOUND_JPEG_TURBO)
+set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_OLD})
+set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_OLD})
if(NOT FOUND_JPEG_TURBO)
message(STATUS "WARNING: You are not using libjpeg-turbo. Performance will suffer.")
endif()