summaryrefslogtreecommitdiffstats
path: root/Tests/FindJPEG
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2018-11-06 18:20:36 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2018-11-06 21:45:52 (GMT)
commit1c4c4be509ab548d9e848a8850c30e3dbbb7f8bc (patch)
tree11b337d3933fccf5dc0ae47a0829244f427cdda4 /Tests/FindJPEG
parentbfdd1ba604a31b3bb9f0baa29ce6fce467ee2e47 (diff)
downloadCMake-1c4c4be509ab548d9e848a8850c30e3dbbb7f8bc.zip
CMake-1c4c4be509ab548d9e848a8850c30e3dbbb7f8bc.tar.gz
CMake-1c4c4be509ab548d9e848a8850c30e3dbbb7f8bc.tar.bz2
FindJPEG: handle multiarch installs of libjpeg-turbo
Fedora installs a `jconfig-32.h` and `jconfig-64.h` which were not searched. Instead, glob up all `jconfig` headers and bail once we've found a version number.
Diffstat (limited to 'Tests/FindJPEG')
-rw-r--r--Tests/FindJPEG/Test/CMakeLists.txt2
-rw-r--r--Tests/FindJPEG/Test/main.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/Tests/FindJPEG/Test/CMakeLists.txt b/Tests/FindJPEG/Test/CMakeLists.txt
index a744f85..912c7a1 100644
--- a/Tests/FindJPEG/Test/CMakeLists.txt
+++ b/Tests/FindJPEG/Test/CMakeLists.txt
@@ -4,6 +4,8 @@ include(CTest)
find_package(JPEG)
+add_definitions(-DCMAKE_EXPECTED_JPEG_VERSION=${JPEG_VERSION})
+
add_executable(test_jpeg_tgt main.c)
target_link_libraries(test_jpeg_tgt JPEG::JPEG)
add_test(NAME test_jpeg_tgt COMMAND test_jpeg_tgt)
diff --git a/Tests/FindJPEG/Test/main.c b/Tests/FindJPEG/Test/main.c
index c6e48f0..0e23eff 100644
--- a/Tests/FindJPEG/Test/main.c
+++ b/Tests/FindJPEG/Test/main.c
@@ -12,5 +12,5 @@ int main()
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_decompress(&cinfo);
- return 0;
+ return (JPEG_LIB_VERSION != CMAKE_EXPECTED_JPEG_VERSION);
}