From b2550abd83f598030a7dc3dc49f0e321658c9aa8 Mon Sep 17 00:00:00 2001 From: xiota Date: Wed, 10 Apr 2024 13:44:09 +0000 Subject: [PATCH] Add cmake option WITH_JXL ON = Force required OFF = Optional --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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()