diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 50041aa..703dc4f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -73,7 +73,12 @@ endif() if(WITH_TURBOJPEG) target_sources(timg PUBLIC jpeg-source.h jpeg-source.cc) + include(CheckIncludeFileCXX) + CHECK_INCLUDE_FILE_CXX(jconfig.h JCONFIG_H_AVAILABLE) target_compile_definitions(timg PUBLIC WITH_TIMG_JPEG) + if (JCONFIG_H_AVAILABLE) + target_compile_definitions(timg PUBLIC HAVE_JCONFIG_H) + endif() target_link_libraries(timg PkgConfig::TURBOJPEG PkgConfig::EXIF) diff --git a/src/timg-print-version.cc b/src/timg-print-version.cc index 9abf77a..36d4f98 100644 --- a/src/timg-print-version.cc +++ b/src/timg-print-version.cc @@ -39,7 +39,7 @@ #include #endif -#ifdef WITH_TIMG_JPEG +#if defined(WITH_TIMG_JPEG) && defined(HAVE_JCONFIG_H) #include #endif #include