build: add a conanfile for dependencies

This commit is contained in:
Danny Robson 2024-07-18 15:06:52 +10:00
parent 6b1cbc4d73
commit 738ba64101
2 changed files with 3 additions and 52 deletions

View File

@ -1,52 +0,0 @@
import os.path
from conan import ConanFile
from conan.tools.cmake import cmake_layout, CMake
class MyConan(ConanFile):
name = 'cruft-util'
version = '0.1'
user = 'nerdcruft'
settings = "os", "compiler", "build_type", "arch"
build_requires = (
'nc/0.1@nerdcruft',
)
requires = (
'fmt/[~10]',
'range-v3/[~0.11]',
)
generators = "CMakeToolchain", "CMakeDeps"
exports_sources = 'CMakeLists.txt', 'src*', 'test*', 'Doxyfile.in', 'preprocessor.py', 'libcruft.pc.in',
def layout(self):
cmake_layout(self)
return
self.folders.source = '.'
self.folders.build = os.path.join('build', 'debug', 'gcc')
self.folders.generators = os.path.join(self.folders.build, 'generators')
self.cpp.source.includedirs = ['.']
self.cpp.build.includedirs = [
os.path.join('generated')
]
self.cpp.package.libs = ['cruft']
def build(self):
cmake = CMake(self)
cmake.configure(cli_args=['-G=Ninja'])
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
self.cpp_info.libs = ['cruft']

3
conanfile.txt Normal file
View File

@ -0,0 +1,3 @@
[requires]
fmt/10.1.1
range-v3/0.11.0