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

[wayland] Add ECM naming to aliases #19412

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions recipes/wayland/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def package_info(self):

if self.options.enable_libraries:
self.cpp_info.components["wayland-server"].libs = ["wayland-server"]
self.cpp_info.components["wayland-server"].set_property("cmake_target_aliases", ["Wayland::Server"])
self.cpp_info.components["wayland-server"].set_property("pkg_config_name", "wayland-server")
self.cpp_info.components["wayland-server"].requires = ["libffi::libffi"]
self.cpp_info.components["wayland-server"].system_libs = ["pthread", "m"]
Expand All @@ -147,6 +148,7 @@ def package_info(self):
"\n".join(f"{key}={value}" for key, value in pkgconfig_variables.items()))

self.cpp_info.components["wayland-client"].libs = ["wayland-client"]
self.cpp_info.components["wayland-client"].set_property("cmake_target_aliases", ["Wayland::Client"])
self.cpp_info.components["wayland-client"].set_property("pkg_config_name", "wayland-client")
self.cpp_info.components["wayland-client"].requires = ["libffi::libffi"]
self.cpp_info.components["wayland-client"].system_libs = ["pthread", "m"]
Expand All @@ -164,15 +166,18 @@ def package_info(self):

self.cpp_info.components["wayland-cursor"].libs = ["wayland-cursor"]
self.cpp_info.components["wayland-cursor"].set_property("pkg_config_name", "wayland-cursor")
self.cpp_info.components["wayland-cursor"].set_property("cmake_target_aliases", ["Wayland::Cursor"])
self.cpp_info.components["wayland-cursor"].requires = ["wayland-client"]
self.cpp_info.components["wayland-cursor"].set_property("component_version", self.version)

self.cpp_info.components["wayland-egl"].libs = ["wayland-egl"]
self.cpp_info.components["wayland-egl"].set_property("pkg_config_name", "wayland-egl")
self.cpp_info.components["wayland-egl"].set_property("cmake_target_aliases", "Wayland::Egl")
self.cpp_info.components["wayland-egl"].requires = ["wayland-client"]
self.cpp_info.components["wayland-egl"].set_property("component_version", "18.1.0")

self.cpp_info.components["wayland-egl-backend"].set_property("pkg_config_name", "wayland-egl-backend")
self.cpp_info.components["wayland-egl-backend"].set_property("cmake_target_aliases", ["Wayland::Egl::Backend"])
self.cpp_info.components["wayland-egl-backend"].set_property("component_version", "3")

# TODO: to remove in conan v2
Expand Down
5 changes: 4 additions & 1 deletion recipes/wayland/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ project(test_package LANGUAGES C)

find_package(wayland COMPONENTS wayland-client REQUIRED)

# Test ECM FindWayland way
find_package(Wayland COMPONENTS Cursor REQUIRED)

add_executable(test_package test_package.c)
target_link_libraries(test_package PRIVATE wayland::wayland-client)
target_link_libraries(test_package PRIVATE wayland::wayland-client Wayland::Cursor)
9 changes: 5 additions & 4 deletions recipes/wayland/all/test_package/test_package.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <wayland-client.h>
#include <wayland-cursor.h>

int main(int argc, char **argv) {

int main(int argc, char **argv)
{
struct wl_display *display = wl_display_connect(NULL);
if (display == NULL) {
fprintf(stderr, "Can't connect to display\n");
fprintf(stderr, "Can't connect to display\n");
}
else
{
Expand All @@ -15,6 +16,6 @@ int main(int argc, char **argv) {
wl_display_disconnect(display);
printf("disconnected from display\n");
}

exit(0);
}