Skip to content

Commit dbfd1f1

Browse files
committed
fix conanfile
1 parent 00c8a53 commit dbfd1f1

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

recipes/kickcat/all/conanfile.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class KickCATRecipe(ConanFile):
1818
topics = ("ethercat")
1919
package_type = "library"
2020
settings = "os", "compiler", "build_type", "arch"
21-
options = {"shared": [True, False], "fPIC": [True, False]}
22-
default_options = {"shared": False, "fPIC": True}
21+
options = {"shared": [True, False], "fPIC": [True, False], "with_esi_parser": [True, False]}
22+
default_options = {"shared": False, "fPIC": True, "with_esi_parser": False}
2323

2424
def source(self):
2525
get(self, **self.conan_data["sources"][self.version], strip_root=True)
@@ -45,14 +45,19 @@ def validate(self):
4545

4646
if self.settings.compiler == 'gcc' and Version(self.settings.compiler.version) < "7":
4747
raise ConanInvalidConfiguration("Building requires GCC >= 7")
48+
49+
def requirements(self):
50+
if self.options.with_esi_parser:
51+
self.requires("tinyxml2/10.0.0")
52+
4853

4954
def generate(self):
5055
tc = CMakeToolchain(self)
56+
tc.cache_variables["ENABLE_ESI_PARSER"] = bool(self.options.with_esi_parser)
5157
tc.cache_variables["BUILD_UNIT_TESTS"] = "OFF"
5258
tc.cache_variables["BUILD_EXAMPLES"] = "OFF"
5359
tc.cache_variables["BUILD_SIMULATION"] = "OFF"
5460
tc.cache_variables["BUILD_TOOLS"] = "OFF"
55-
tc.cache_variables["DEBUG"] = "OFF"
5661
tc.generate()
5762

5863
def build(self):
@@ -61,8 +66,11 @@ def build(self):
6166
cmake.build()
6267

6368
def package(self):
64-
copy(self, "*.h", os.path.join(self.source_folder, "include"),
65-
os.path.join(self.package_folder, "include"))
69+
src_folders = ["lib/include", "lib/slave/include", "lib/slave/driver/include", "lib/master/include", "include"]
70+
for folder in src_folders:
71+
copy(self, "*.h", os.path.join(self.source_folder, folder),
72+
os.path.join(self.package_folder, "include"))
73+
6674
copy(self, "*.a", self.build_folder,
6775
os.path.join(self.package_folder, "lib"), keep_path=False)
6876
copy(self, "*.so", self.build_folder,

0 commit comments

Comments
 (0)