From 6901997234a6c6c99ffc30e420d752344b845340 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Sat, 1 Aug 2020 09:57:01 +0200 Subject: [PATCH 1/5] xkbcommon: add components --- recipes/xkbcommon/all/conanfile.py | 9 ++++++++- recipes/xkbcommon/all/test_package/conanfile.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/recipes/xkbcommon/all/conanfile.py b/recipes/xkbcommon/all/conanfile.py index 018966fe7a0be..99c5ad65546c7 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::xorg'] + 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.append('xorg::xorg') diff --git a/recipes/xkbcommon/all/test_package/conanfile.py b/recipes/xkbcommon/all/test_package/conanfile.py index bd7165a553cf4..4de88a711154a 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", "pkg_config" def build(self): cmake = CMake(self) From c2652403161c819ba50812cebe36259a16be1d75 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Mon, 3 Aug 2020 18:54:47 +0200 Subject: [PATCH 2/5] test pkg-config components --- recipes/xkbcommon/all/test_package/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/xkbcommon/all/test_package/conanfile.py b/recipes/xkbcommon/all/test_package/conanfile.py index 4de88a711154a..89b9d11eda19f 100644 --- a/recipes/xkbcommon/all/test_package/conanfile.py +++ b/recipes/xkbcommon/all/test_package/conanfile.py @@ -7,6 +7,9 @@ class TestPackageConan(ConanFile): generators = "cmake", "pkg_config" def build(self): + with tools.environment_append({'PKG_CONFIG_PATH': '.'}): + self.output.info("xkbcommon libs: %s" % " ".join(tools.PkgConfig("xkbcommon").libs_only_l)) + self.output.info("xkbcommon-x11 libs: %s" % " ".join(tools.PkgConfig("xkbcommon-x11").libs_only_l)) cmake = CMake(self) cmake.configure() cmake.build() From 608f68a49083e15d89fc84156d7ba0d866c0222b Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Mon, 3 Aug 2020 19:22:10 +0200 Subject: [PATCH 3/5] test cmake components --- recipes/xkbcommon/all/test_package/CMakeLists.txt | 3 ++- recipes/xkbcommon/all/test_package/conanfile.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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 89b9d11eda19f..4d788b58c895b 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", "pkg_config" + generators = "cmake", "cmake_find_package_multi", "pkg_config" def build(self): with tools.environment_append({'PKG_CONFIG_PATH': '.'}): From bc0b86190f7021a323b0eb64d804fe923ad9fe47 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Fri, 7 Aug 2020 09:04:51 +0200 Subject: [PATCH 4/5] Revert "test pkg-config components" This reverts commit c2652403161c819ba50812cebe36259a16be1d75. --- recipes/xkbcommon/all/test_package/conanfile.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/recipes/xkbcommon/all/test_package/conanfile.py b/recipes/xkbcommon/all/test_package/conanfile.py index 4d788b58c895b..55bf6d0ec4634 100644 --- a/recipes/xkbcommon/all/test_package/conanfile.py +++ b/recipes/xkbcommon/all/test_package/conanfile.py @@ -7,9 +7,6 @@ class TestPackageConan(ConanFile): generators = "cmake", "cmake_find_package_multi", "pkg_config" def build(self): - with tools.environment_append({'PKG_CONFIG_PATH': '.'}): - self.output.info("xkbcommon libs: %s" % " ".join(tools.PkgConfig("xkbcommon").libs_only_l)) - self.output.info("xkbcommon-x11 libs: %s" % " ".join(tools.PkgConfig("xkbcommon-x11").libs_only_l)) cmake = CMake(self) cmake.configure() cmake.build() From 8a2e8cba69c65b7fe71f0e335b5ce2ef28f248a0 Mon Sep 17 00:00:00 2001 From: Eric Lemanissier Date: Mon, 10 Aug 2020 11:01:38 +0200 Subject: [PATCH 5/5] use xorg components --- recipes/xkbcommon/all/conanfile.py | 4 ++-- recipes/xkbcommon/all/test_package/conanfile.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/xkbcommon/all/conanfile.py b/recipes/xkbcommon/all/conanfile.py index 99c5ad65546c7..cd69c9f4ff35c 100644 --- a/recipes/xkbcommon/all/conanfile.py +++ b/recipes/xkbcommon/all/conanfile.py @@ -75,10 +75,10 @@ def package(self): def package_info(self): self.cpp_info.components['libxkbcommon'].libs = ['xkbcommon'] self.cpp_info.components['libxkbcommon'].name = 'xkbcommon' - self.cpp_info.components['libxkbcommon'].requires = ['xorg::xorg'] + 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.append('xorg::xorg') + self.cpp_info.components['libxkbcommon-x11'].requires.extend(['xorg::xcb', 'xorg::xcb-xkb']) diff --git a/recipes/xkbcommon/all/test_package/conanfile.py b/recipes/xkbcommon/all/test_package/conanfile.py index 55bf6d0ec4634..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", "cmake_find_package_multi", "pkg_config" + generators = "cmake", "cmake_find_package" def build(self): cmake = CMake(self)