]> source.dussan.org Git - tigervnc.git/commitdiff
If JPEG_INCLUDE_DIR or JPEG_LIBRARY have been overridden on the CMake command line...
authorDRC <dcommander@users.sourceforge.net>
Tue, 7 Jun 2011 01:47:38 +0000 (01:47 +0000)
committerDRC <dcommander@users.sourceforge.net>
Tue, 7 Jun 2011 01:47:38 +0000 (01:47 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4466 3789f03b-4d11-0410-bbf8-ca57d06f2519

CMakeLists.txt

index 84a74d7c1434f03e7419b263b7f25cab6a16f4ca..15b458b973ce49dc403a2a24e541bbddbd184753 100644 (file)
@@ -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()