-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#12700) sdbus-cpp: conan v2 support
* sdbus-cpp/all: Update requirements/build_requirements * sdbus-cpp/all: Fix TOOLS CROSS BUILDING (KB-H062) warning WARN: [TOOLS CROSS BUILDING (KB-H062)] The 'tools.cross_building(self.settings)' syntax may not work correctly in some scenarios. Consider using tools.cross_building(self). * sdbus-cpp/all: Fix INVALID TOPICS (KB-H064) warning WARN: [INVALID TOPICS (KB-H064)] The topic 'conan' is invalid and should be removed from topics attribute. * sdbus-cpp/all: Add pkg-config test sdbus-cpp officially supports pkg-config, so we need to test it. * sdbus-cpp/all: Add conan v2 support * sdbus-cpp/all: Make a little cleanup and apply CCI recommendations * sdbus-cpp/all: Add missing system libs The math library was probably just missing. And the pthread library was always implicitly inherited from libsystemd dependency. * sdbus-cpp/all: Add information about LGPL exceptions for header files Since version 0.9.0, sdbus-c++ has an additional license with an exception for the template code in the header files. Basically it is a fork of Qt LGPL exception 1.1. * sdbus-cpp/all: Apply suggestions from code review Co-authored-by: Uilian Ries <uilianries@gmail.com> * sdbus-cpp/all: Apply test packages review suggestions * sdbus-cpp/all: Use conan.tools in test packages Co-authored-by: Uilian Ries <uilianries@gmail.com>
- Loading branch information
1 parent
d8863a9
commit 9f82ea9
Showing
12 changed files
with
221 additions
and
90 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
sources: | ||
"0.8.3": | ||
url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v0.8.3.tar.gz" | ||
sha256: "0fd575ae0f463773dd9141242d1133731e2b780fd6526650ce992ba711d88628" | ||
"1.0.0": | ||
url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v1.0.0.tar.gz" | ||
sha256: "3db82112c0d8a171a4115d761e3a592b62091fa7600988736652595178ae4e94" | ||
"1.2.0": | ||
url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v1.2.0.tar.gz" | ||
sha256: "7f7231904abb6a996b8c18ddc5fb50078ef5dff5191649abf9f127aff41d24e9" | ||
"1.1.0": | ||
url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v1.1.0.tar.gz" | ||
sha256: "35e939fdd9c796522702c9c8762dd59b5c47f3440c01ba9feb9921c042780b55" | ||
"1.0.0": | ||
url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v1.0.0.tar.gz" | ||
sha256: "3db82112c0d8a171a4115d761e3a592b62091fa7600988736652595178ae4e94" | ||
"0.8.3": | ||
url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v0.8.3.tar.gz" | ||
sha256: "0fd575ae0f463773dd9141242d1133731e2b780fd6526650ce992ba711d88628" | ||
|
||
"1.2.0": | ||
url: "https://github.com/Kistler-Group/sdbus-cpp/archive/v1.2.0.tar.gz" | ||
sha256: "7f7231904abb6a996b8c18ddc5fb50078ef5dff5191649abf9f127aff41d24e9" | ||
patches: | ||
"0.8.3": | ||
- base_path: "source_subfolder" | ||
patch_file: "patches/0001-xml2cpp-Add-missing-EXPAT-include-dirs-136.patch" | ||
"1.0.0": | ||
- base_path: "source_subfolder" | ||
patch_file: "patches/0002-correct-readme-cpack-resource-path.patch" | ||
- patch_file: "patches/0002-correct-readme-cpack-resource-path.patch" | ||
patch_description: "fix out of tree build by using proper paths in cmake file" | ||
patch_type: "backport" | ||
patch_source: "https://github.com/Kistler-Group/sdbus-cpp/commit/0b8f2d97524f354bcaf816b27b6139a5b0c480ba" | ||
"0.8.3": | ||
- patch_file: "patches/0001-xml2cpp-Add-missing-EXPAT-include-dirs-136.patch" | ||
patch_description: "fix build error by adding missing headers" | ||
patch_type: "backport" | ||
patch_source: "https://github.com/Kistler-Group/sdbus-cpp/commit/fb008445b15b452f461c34667f4991f5ce06e481" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,27 @@ | ||
import os | ||
|
||
from conans import ConanFile, CMake, tools | ||
from conan import ConanFile | ||
from conan.tools.build import can_run | ||
from conan.tools.cmake import CMake, cmake_layout | ||
|
||
|
||
class SdbusCppTestConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = ("cmake", "cmake_find_package") | ||
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" | ||
test_type = "explicit" | ||
|
||
def requirements(self): | ||
self.requires(self.tested_reference_str) | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self.settings): | ||
bin_path = os.path.join("bin", "example") | ||
self.run(bin_path, run_environment=True) | ||
if can_run(self): | ||
bin_path = os.path.join(self.cpp.build.bindirs[0], "example") | ||
self.run(bin_path, env="conanrun") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
project(PackageTest LANGUAGES CXX) | ||
|
||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(SDBusCpp REQUIRED IMPORTED_TARGET sdbus-c++) | ||
|
||
add_executable(example ../test_package/example.cpp) | ||
target_link_libraries(example PRIVATE PkgConfig::SDBusCpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import os | ||
|
||
from conan import ConanFile | ||
from conan.tools.build import can_run | ||
from conan.tools.cmake import CMake, cmake_layout | ||
from conan.tools.files import copy | ||
|
||
|
||
class SdbusCppTestConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "CMakeToolchain", "PkgConfigDeps", "VirtualRunEnv" | ||
test_type = "explicit" | ||
|
||
def build_requirements(self): | ||
self.tool_requires("pkgconf/1.7.4") | ||
|
||
def requirements(self): | ||
self.requires(self.tested_reference_str) | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
|
||
def generate(self): | ||
# workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/18150 | ||
copy(self, "*.pc", self.generators_folder, | ||
os.path.join(self.generators_folder, "lib", "pkgconfig")) | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if can_run(self): | ||
bin_path = os.path.join(self.cpp.build.bindirs[0], "example") | ||
self.run(bin_path, env="conanrun") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
project(PackageTest CXX) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup(TARGETS) | ||
|
||
find_package(sdbus-c++ REQUIRED) | ||
|
||
add_executable(example ../test_package/example.cpp) | ||
target_link_libraries(example SDBusCpp::sdbus-c++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import os | ||
|
||
from conan import ConanFile | ||
from conan.tools.build import can_run | ||
|
||
from conans import CMake | ||
|
||
|
||
class SdbusCppTestConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = ("cmake", "cmake_find_package") | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if can_run(self): | ||
bin_path = os.path.join("bin", "example") | ||
self.run(bin_path, run_environment=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
project(PackageTest CXX) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup(TARGETS) | ||
|
||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(SDBusCpp REQUIRED IMPORTED_TARGET sdbus-c++) | ||
|
||
add_executable(example ../test_package/example.cpp) | ||
target_link_libraries(example PRIVATE PkgConfig::SDBusCpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import os | ||
|
||
from conan import ConanFile | ||
from conan.tools.build import can_run | ||
|
||
from conans import CMake | ||
|
||
|
||
class SdbusCppTestConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = ("cmake", "pkg_config") | ||
|
||
def build_requirements(self): | ||
self.tool_requires("pkgconf/1.7.4") | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if can_run(self): | ||
bin_path = os.path.join("bin", "example") | ||
self.run(bin_path, run_environment=True) |
Oops, something went wrong.