diff --git a/CMakeLists.txt b/CMakeLists.txt index 23a3dbc0c..f26112cd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -222,6 +222,7 @@ option(USE_EXPERIMENTAL_LANG_VERSIONS "Build with -std=c++0x" OFF) option(BUILD_SHARED "Build with shared libraries" OFF) option(WITH_BENCHMARK "Build with benchmark code" OFF) option(WITH_MYFILE_MMAP "Build using memory mapped file" ON) +option(WITH_JXL "Build with JPEG XL import support" OFF) option(WITH_LTO "Build with link-time optimizations" OFF) option(WITH_SAN "Build with run-time sanitizer" OFF) option(WITH_PROF "Build with profiling instrumentation" OFF) @@ -552,7 +553,12 @@ if(WITH_SYSTEM_KLT) find_package(KLT REQUIRED) endif() -pkg_check_modules(JXL IMPORTED_TARGET libjxl libjxl_threads) +set(JXL_LIBS "libjxl libjxl_threads") +if(WITH_JXL) + pkg_check_modules(JXL REQUIRED IMPORTED_TARGET ${JXL_LIBS}) +else() + pkg_check_modules(JXL IMPORTED_TARGET ${JXL_LIBS}) +endif() if(JXL_FOUND) add_definitions(-DLIBJXL) endif()