Add conan integration

This commit is contained in:
2025-06-28 19:47:29 +02:00
parent 8807cd513c
commit 293135c9af
9 changed files with 38 additions and 818 deletions

View File

@@ -1,7 +1,7 @@
import re
from conan import ConanFile
from conan.tools.files import copy
from conan.tools.cmake import CMakeToolchain
from conan.tools.cmake import cmake_layout
class FoldingConan(ConanFile):
@@ -10,26 +10,25 @@ class FoldingConan(ConanFile):
description = "K-Fold and stratified K-Fold header-only library"
url = "https://github.com/rmontanana/folding"
license = "MIT"
homepage = "https://github.com/rmontanana/ArffFiles"
topics = ("kfold", "stratified folding")
homepage = "https://github.com/rmontanana/folding"
topics = ("kfold", "stratified folding", "mdlp")
no_copy_source = True
exports_sources = "folding.hpp"
package_type = "header-library"
# build_type = "Debug"
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeDeps", "CMakeToolchain"
def requirements(self):
# Build dependency
self.requires("libtorch/2.7.0")
def build_requirements(self):
self.tool_requires("cmake/[>=3.15]")
# Test dependencies
self.test_requires("catch2/3.8.1")
self.test_requires("arff-files/1.2.0")
self.test_requires("fimdlp/2.0.1")
def generate(self):
tc = CMakeToolchain(self)
tc.generate()
def layout(self):
cmake_layout(self)
def init(self):
# Read the CMakeLists.txt file to get the version
@@ -42,7 +41,7 @@ class FoldingConan(ConanFile):
self.version = match.group(1)
def package(self):
copy(self, "*.hpp", self.source_folder, self.package_folder)
copy(self, "*.hpp", src=self.source_folder, dst=self.package_folder)
def package_info(self):
self.cpp_info.bindirs = []