52 lines
1.2 KiB
Python
52 lines
1.2 KiB
Python
|
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']
|