Update libraries versions

This commit is contained in:
2025-07-19 22:12:27 +02:00
parent 3e0b790cfe
commit 481c702302

View File

@@ -3,6 +3,7 @@ from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
from conan.tools.files import copy from conan.tools.files import copy
class BayesNetConan(ConanFile): class BayesNetConan(ConanFile):
name = "bayesnet" name = "bayesnet"
settings = "os", "compiler", "build_type", "arch" settings = "os", "compiler", "build_type", "arch"
@@ -10,17 +11,25 @@ class BayesNetConan(ConanFile):
"shared": [True, False], "shared": [True, False],
"fPIC": [True, False], "fPIC": [True, False],
"enable_testing": [True, False], "enable_testing": [True, False],
"enable_coverage": [True, False] "enable_coverage": [True, False],
} }
default_options = { default_options = {
"shared": False, "shared": False,
"fPIC": True, "fPIC": True,
"enable_testing": False, "enable_testing": False,
"enable_coverage": False "enable_coverage": False,
} }
# Sources are located in the same place as this recipe, copy them to the recipe # Sources are located in the same place as this recipe, copy them to the recipe
exports_sources = "CMakeLists.txt", "bayesnet/*", "config/*", "cmake/*", "docs/*", "tests/*", "bayesnetConfig.cmake.in" exports_sources = (
"CMakeLists.txt",
"bayesnet/*",
"config/*",
"cmake/*",
"docs/*",
"tests/*",
"bayesnetConfig.cmake.in",
)
def set_version(self) -> None: def set_version(self) -> None:
cmake = pathlib.Path(self.recipe_folder) / "CMakeLists.txt" cmake = pathlib.Path(self.recipe_folder) / "CMakeLists.txt"
@@ -29,7 +38,8 @@ class BayesNetConan(ConanFile):
# Accept either: project(foo VERSION 1.2.3) or set(foo_VERSION 1.2.3) # Accept either: project(foo VERSION 1.2.3) or set(foo_VERSION 1.2.3)
match = re.search( match = re.search(
r"""project\s*\([^\)]*VERSION\s+([0-9]+\.[0-9]+\.[0-9]+)""", r"""project\s*\([^\)]*VERSION\s+([0-9]+\.[0-9]+\.[0-9]+)""",
text, re.IGNORECASE | re.VERBOSE text,
re.IGNORECASE | re.VERBOSE,
) )
if match: if match:
self.version = match.group(1) self.version = match.group(1)
@@ -47,14 +57,14 @@ class BayesNetConan(ConanFile):
def requirements(self): def requirements(self):
# Core dependencies # Core dependencies
self.requires("libtorch/2.7.0") self.requires("libtorch/2.7.1")
self.requires("nlohmann_json/3.11.3") self.requires("nlohmann_json/3.11.3")
self.requires("folding/1.1.1") # Custom package self.requires("folding/1.1.2") # Custom package
self.requires("fimdlp/2.1.0") # Custom package self.requires("fimdlp/2.1.1") # Custom package
def build_requirements(self): def build_requirements(self):
self.build_requires("cmake/[>=3.27]") self.build_requires("cmake/[>=3.27]")
self.test_requires("arff-files/1.2.0") # Custom package self.test_requires("arff-files/1.2.1") # Custom package
self.test_requires("catch2/3.8.1") self.test_requires("catch2/3.8.1")
def layout(self): def layout(self):
@@ -78,7 +88,12 @@ class BayesNetConan(ConanFile):
self.run("ctest --output-on-failure", cwd=self.build_folder) self.run("ctest --output-on-failure", cwd=self.build_folder)
def package(self): def package(self):
copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) copy(
self,
"LICENSE",
src=self.source_folder,
dst=os.path.join(self.package_folder, "licenses"),
)
cmake = CMake(self) cmake = CMake(self)
cmake.install() cmake.install()