diff --git a/recipes/xkbcommon/all/conanfile.py b/recipes/xkbcommon/all/conanfile.py index 018966fe7a0be..cd69c9f4ff35c 100644 --- a/recipes/xkbcommon/all/conanfile.py +++ b/recipes/xkbcommon/all/conanfile.py @@ -73,5 +73,12 @@ def package(self): tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.components['libxkbcommon'].libs = ['xkbcommon'] + self.cpp_info.components['libxkbcommon'].name = 'xkbcommon' + self.cpp_info.components['libxkbcommon'].requires = ['xorg::xkeyboard-config'] + if self.options.with_x11: + self.cpp_info.components['libxkbcommon-x11'].libs = ['xkbcommon-x11'] + self.cpp_info.components['libxkbcommon-x11'].name = 'xkbcommon-x11' + self.cpp_info.components['libxkbcommon-x11'].requires = ['libxkbcommon'] + self.cpp_info.components['libxkbcommon-x11'].requires.extend(['xorg::xcb', 'xorg::xcb-xkb']) diff --git a/recipes/xkbcommon/all/test_package/CMakeLists.txt b/recipes/xkbcommon/all/test_package/CMakeLists.txt index 41c00a9b4152f..5d46725fd44c8 100644 --- a/recipes/xkbcommon/all/test_package/CMakeLists.txt +++ b/recipes/xkbcommon/all/test_package/CMakeLists.txt @@ -3,6 +3,7 @@ project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() +find_package(xkbcommon REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} xkbcommon::xkbcommon) diff --git a/recipes/xkbcommon/all/test_package/conanfile.py b/recipes/xkbcommon/all/test_package/conanfile.py index bd7165a553cf4..1d0bdd3779793 100644 --- a/recipes/xkbcommon/all/test_package/conanfile.py +++ b/recipes/xkbcommon/all/test_package/conanfile.py @@ -4,7 +4,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "cmake", "cmake_find_package" def build(self): cmake = CMake(self)