Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake <3.19 configure error with lcms2 #1425

Open
alvinhochun opened this issue May 17, 2022 · 0 comments
Open

CMake <3.19 configure error with lcms2 #1425

alvinhochun opened this issue May 17, 2022 · 0 comments
Labels
building/portability Platform-specific issues, build issues unrelated to 1.0 Things that need not be done before the 1.0 version milestone

Comments

@alvinhochun
Copy link

alvinhochun commented May 17, 2022

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 ea6a190)

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.
@mo271 mo271 added the building/portability Platform-specific issues, build issues label May 18, 2022
@mo271 mo271 added the unrelated to 1.0 Things that need not be done before the 1.0 version milestone label Sep 14, 2022
arnout pushed a commit to buildroot/buildroot that referenced this issue Jun 6, 2023
libjxl requires cmake 3.19 since version v0.7 due to the
new behavior of cmake [1].

-- 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:114 (find_package)

The portability issue has already been reported upstream [2].

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/4322819095

[1] https://gitlab.kitware.com/cmake/cmake/-/commit/afb998704e67d3d3ce5b24c112cb06e770fca78d
[2] libjxl/libjxl#1425

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Julien Olivain <ju.o@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
arnout pushed a commit to buildroot/buildroot that referenced this issue Jun 14, 2023
libjxl requires cmake 3.19 since version v0.7 due to the
new behavior of cmake [1].

-- 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:114 (find_package)

The portability issue has already been reported upstream [2].

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/4322819095

[1] https://gitlab.kitware.com/cmake/cmake/-/commit/afb998704e67d3d3ce5b24c112cb06e770fca78d
[2] libjxl/libjxl#1425

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Julien Olivain <ju.o@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
(cherry picked from commit a4fec34)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
citral23 pushed a commit to citral23/buildroot that referenced this issue Sep 18, 2023
libjxl requires cmake 3.19 since version v0.7 due to the
new behavior of cmake [1].

-- 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:114 (find_package)

The portability issue has already been reported upstream [2].

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/4322819095

[1] https://gitlab.kitware.com/cmake/cmake/-/commit/afb998704e67d3d3ce5b24c112cb06e770fca78d
[2] libjxl/libjxl#1425

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Julien Olivain <ju.o@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building/portability Platform-specific issues, build issues unrelated to 1.0 Things that need not be done before the 1.0 version milestone
Projects
None yet
Development

No branches or pull requests

2 participants