diff options
author | DRC <dcommander@users.sourceforge.net> | 2011-07-28 08:06:39 +0000 |
---|---|---|
committer | DRC <dcommander@users.sourceforge.net> | 2011-07-28 08:06:39 +0000 |
commit | 4e326a0b8cf816b3205171e0bbce5d6d4973d90e (patch) | |
tree | 638cb0a5064dbb54ed3eed8efeda07ffd7683a71 /CMakeLists.txt | |
parent | 231ee4217a2fad28707eb00361b8febfdf0a2971 (diff) | |
download | tigervnc-4e326a0b8cf816b3205171e0bbce5d6d4973d90e.tar.gz tigervnc-4e326a0b8cf816b3205171e0bbce5d6d4973d90e.zip |
Actually link and run the libjpeg-turbo test program to ensure that JPEG_LIBRARY is set correctly
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4602 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ba72c992..e2d33f6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ include(CheckLibraryExists) include(CheckTypeSize) include(CheckCSourceCompiles) include(CheckCXXSourceCompiles) +include(CheckCSourceRuns) include(CMakeMacroLibtoolFile) @@ -176,11 +177,28 @@ find_package(JPEG REQUIRED) # Warn if it doesn't seem to be the accelerated libjpeg that's found set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARIES}) set(CMAKE_REQUIRED_FLAGS -I${JPEG_INCLUDE_DIR}) +if(MSVC) + set(CMAKE_REQUIRED_DEFINITIONS -MT) +endif() -check_c_source_compiles("#include <stdio.h>\n#include <jpeglib.h>\nint main(int c, char** v) { return JCS_EXT_RGBX; }" FOUND_LIBJPEG_TURBO) +check_c_source_runs("\n + #include <stdio.h>\n + #include <jpeglib.h>\n + int main(void) {\n + struct jpeg_compress_struct cinfo;\n + struct jpeg_error_mgr jerr;\n + cinfo.err=jpeg_std_error(&jerr);\n + jpeg_create_compress(&cinfo);\n + cinfo.input_components = 3;\n + jpeg_set_defaults(&cinfo);\n + cinfo.in_color_space = JCS_EXT_RGB;\n + jpeg_default_colorspace(&cinfo);\n + return 0;\n + }" FOUND_LIBJPEG_TURBO) set(CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_FLAGS) +set(CMAKE_REQUIRED_DEFINITIONS) if(NOT FOUND_LIBJPEG_TURBO) message(STATUS "WARNING: You are not using libjpeg-turbo. Performance will suffer.") |