FS#73540 - [waylandpp] Invalid CMake-package-config, in 0.2.8-1

Attached to Project: Community Packages
Opened by John Eivind Helset (jehelset) - Friday, 28 January 2022, 12:30 GMT
Last edited by Toolybird (Toolybird) - Wednesday, 17 May 2023, 04:34 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Ike Devolder (BlackEagle)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

CMake-package-config of 0.2.8-1 has wrong include paths in it. See f.ex. waylandpp-targets.cmake:66.

Steps to reproduce:

Create a CMake-config, find_pacakge(waylandpp)
This task depends upon

Closed by  Toolybird (Toolybird)
Wednesday, 17 May 2023, 04:34 GMT
Reason for closing:  None
Additional comments about closing:  Doesn't seem like an Arch packaging problem. If still an issue, please report upstream
Comment by Ike Devolder (BlackEagle) - Saturday, 19 February 2022, 10:09 GMT
Does this line not mean that it can be found in the build dir, or in /usr/include ?:

"/build/waylandpp/src/waylandpp-0.2.9/;${_IMPORT_PREFIX}/include"
Comment by Ike Devolder (BlackEagle) - Saturday, 19 February 2022, 10:14 GMT
If I create a CMakeList.txt file like this:

```
project(testwaylandpp)
find_package(waylandpp REQUIRED)
```

It does not complain, so that would mean it finds waylandpp just fine?
Comment by John Eivind Helset (jehelset) - Saturday, 19 February 2022, 10:22 GMT
well... it refers to "a build dir", but there shouldn't be any traces of the build dirs in the package config. if there are any non-existent paths in the package-config CMake will error out. are you trying this in the same environment where you built the package, or in a "clean" environment where you just installed the package?

see: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#creating-relocatable-packages
Comment by Ike Devolder (BlackEagle) - Saturday, 19 February 2022, 15:49 GMT
This is on my machine, all packages are built in chroot so the build paths don't exist on my machine.

do you have an example project that uses waylandpp where it errors out? since I don't have any issue building kodi with this waylandpp package, but maybe they assume the libs to be present in /usr/include without the use of the find_package since I don't seem to see that in the kodi source
Comment by John Eivind Helset (jehelset) - Saturday, 19 February 2022, 17:14 GMT
ya, i guess one actually needs to try and use a target from the package with a non-existing path to produce an error, my bad. if it's not using `find_package` and the targets exported from the package it wont fail. this will fail:

```
cmake_minimum_required(VERSION 3.22 FATAL_ERROR)

project(waylandapp LANGUAGES CXX)

find_package(waylandpp)

add_executable(executable executable.cpp)
target_link_libraries(executable PUBLIC Waylandpp::wayland-client++)
```

where `executable.cpp` is some dummy file, and with `cmake -S . -B build`:

```
CMake Error in CMakeLists.txt:
Imported target "Waylandpp::wayland-client++" includes non-existent path

"/build/waylandpp/src/waylandpp-0.2.8/"

in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:

* The path was deleted, renamed, or moved to another location.

* An install or uninstall procedure did not complete successfully.

* The installation package was faulty and references files it does not
provide.

```
Comment by John Eivind Helset (jehelset) - Saturday, 19 February 2022, 17:22 GMT
i dunno kodi, but from a google, if it's this https://github.com/xbmc/xbmc, then from a quick look it seems to be using the pkgconfig package-config, and not the CMake package-config: https://github.com/xbmc/xbmc/blob/master/cmake/modules/FindWaylandpp.cmake#L13

typically i'd use pkgconfig if there was no CMake-package available (or the provided one doesn't work).

Loading...