From bc0add0519807b8c124c6d991ba05da3abd896eb Mon Sep 17 00:00:00 2001 From: oir Date: Tue, 10 Dec 2024 18:07:05 -0500 Subject: [PATCH 1/2] Add conanfile.py --- conanfile.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 conanfile.py diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 0000000..080eb34 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,35 @@ +import os + +from conan import ConanFile +from conan.tools.files import copy, load + + +class barkeepConan(ConanFile): + name = "barkeep" + # No settings/options are necessary, this is header only + exports_sources = "barkeep/barkeep.h" + # We can avoid copying the sources to the build folder in the cache + no_copy_source = True + + def set_version(self): + # The version is extracted from the header file + content = load(self, "barkeep/barkeep.h") + for line in content.splitlines(): + if line.startswith("#define BARKEEP_VERSION"): + self.version = line.split()[-1].strip('"') + break + + def package(self): + # This will also copy the "include" folder + copy( + self, + "barkeep/barkeep.h", + self.source_folder, + os.path.join(self.package_folder, "include"), + ) + + def package_info(self): + # For header-only packages, libdirs and bindirs are not used + # so it's necessary to set those as empty. + self.cpp_info.bindirs = [] + self.cpp_info.libdirs = [] From f01c00ebf3d5188957404df354c275315860e423 Mon Sep 17 00:00:00 2001 From: oir Date: Tue, 10 Dec 2024 18:08:28 -0500 Subject: [PATCH 2/2] fixup --- conanfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 080eb34..8b4d4c1 100644 --- a/conanfile.py +++ b/conanfile.py @@ -20,7 +20,6 @@ def set_version(self): break def package(self): - # This will also copy the "include" folder copy( self, "barkeep/barkeep.h",