-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
45 lines (36 loc) · 1.22 KB
/
conanfile.py
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
35
36
37
38
39
40
41
42
43
44
45
import os
import json
import re
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.build import cross_building
class PythonVirtualenvTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "VirtualBuildEnv", "VirtualRunEnv"
apply_env = False
test_type = "explicit"
def build_requirements(self):
self.tool_requires(
"python-virtualenv/system@mtolympus/stable",
options={
"requirements":json.dumps([
"sphinx",
"sphinx-rtd-theme",
])
}
)
def generate(self):
tc = CMakeToolchain(self)
tc.generate()
py = self.python_requires["cmake-python-deps"].module.CMakePythonDeps(self)
py.generate()
def layout(self):
cmake_layout(self)
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def test(self):
if not cross_building(self):
cmd = f"{os.path.join(self.cpp.build.bindirs[0], 'dumpfile')} 20 {os.path.join(self.build_folder, 'docs', 'sphinx' ,'index.html')}"
self.run(cmd, env="conanrun")