libjxl icon indicating copy to clipboard operation
libjxl copied to clipboard

CMake <3.19 configure error with lcms2

Open alvinhochun opened this issue 2 years ago • 0 comments

Describe the bug

When using an older version of CMake, you can get this error:

CMake Error at cmake/FindLCMS2.cmake:40 (add_library):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "INCLUDE_DIRECTORIES" is not allowed.
Call Stack (most recent call first):
  third_party/CMakeLists.txt:149 (find_package)

To Reproduce

  • Use a CMake version before 3.19
  • Build lcms2 and install it to a prefix, then attempt to build libjxl

Expected behavior

The CMake configure should succeed.

Screenshots

n/a

Environment

  • OS: Windows
  • Compiler version: clang 14.0.0 (llvm-mingw)
  • CMake: 3.17.0
  • CPU type: x86_64
  • cjxl/djxl version string: n/a (commit ea6a190cd777b61662bd0470db24163a1a63bdab)

Additional context

Someone else also reported this to happen on Ubuntu 20.04 (CMake is 3.16.3).

This specific use of property on INTERFACE_LIBRARY seems to be allowed only starting from CMake 3.19 after commit https://gitlab.kitware.com/cmake/cmake/-/commit/afb998704e67d3d3ce5b24c112cb06e770fca78d .

Full configure output on Windows (Click to expand)
-- The C compiler identification is Clang 14.0.0
-- The CXX compiler identification is Clang 14.0.0
-- Check for working C compiler: C:/deps/llvm-mingw/bin/clang.exe
-- Check for working C compiler: C:/deps/llvm-mingw/bin/clang.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/deps/llvm-mingw/bin/clang++.exe
-- Check for working CXX compiler: C:/deps/llvm-mingw/bin/clang++.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test JPEGXL_EMSCRIPTEN
-- Performing Test JPEGXL_EMSCRIPTEN - Failed
-- CMAKE_SYSTEM_PROCESSOR is AMD64
-- Performing Test CXX_FUZZERS_SUPPORTED
-- Performing Test CXX_FUZZERS_SUPPORTED - Failed
-- Performing Test CXX_CONSTRUCTOR_ALIASES_SUPPORTED
-- Performing Test CXX_CONSTRUCTOR_ALIASES_SUPPORTED - Success
-- Performing Test CXX_MACRO_PREFIX_MAP
-- Performing Test CXX_MACRO_PREFIX_MAP - Success
-- Performing Test CXX_NO_RTTI_SUPPORTED
-- Performing Test CXX_NO_RTTI_SUPPORTED - Success
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Compiled IDs C:Clang, C++:Clang
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Found HWY: C:/dev/env-9/i/lib/libhwy.a (found suitable version "0.16.0", minimum required is "0.15.0")
-- Found Brotli: C:/dev/env-9/i/include
-- Found LCMS2: C:/dev/env-9/i/lib/liblcms2.dll.a (found suitable version "2.13", minimum required is "2.10")
-- Found ZLIB: C:/dev/env-9/i/lib/libzlib.dll.a (found version "1.2.12")
-- Found PNG: C:/dev/env-9/i/lib/libpng.dll.a (found version "1.6.37")
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Performing Test LINKER_SUPPORT_EXCLUDE_LIBS
-- Performing Test LINKER_SUPPORT_EXCLUDE_LIBS - Failed
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
CMake Warning at CMakeLists.txt:421 (message):
  asciidoc was not found, the man pages will not be installed.


-- Building with JPEGXL_VERSION=0.6.1
-- Building tools:
-- Configuring done
CMake Error at cmake/FindLCMS2.cmake:40 (add_library):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "INCLUDE_DIRECTORIES" is not allowed.
Call Stack (most recent call first):
  third_party/CMakeLists.txt:149 (find_package)


CMake Error at cmake/FindLCMS2.cmake:40 (add_library):
  INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "INCLUDE_DIRECTORIES" is not allowed.
Call Stack (most recent call first):
  third_party/CMakeLists.txt:149 (find_package)


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

alvinhochun avatar May 17 '22 15:05 alvinhochun