-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathconanfile.py
More file actions
34 lines (25 loc) · 851 Bytes
/
conanfile.py
File metadata and controls
34 lines (25 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import os
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
from conan.tools.build import can_run
class json2cppTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
def requirements(self):
self.requires(self.tested_reference_str)
def build_requirements(self):
self.tool_requires(self.tested_reference_str)
def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
tc.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def layout(self):
cmake_layout(self)
def test(self):
if can_run(self):
cmd = os.path.join(self.cpp.build.bindir, "example")
self.run(cmd, env="conanrun")