-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
39 lines (31 loc) · 1005 Bytes
/
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
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
class Example(ConanFile):
settings = "os", "arch", "compiler", "build_type"
languages = "C", "C++"
options = {
"fPIC": [True, False]
}
default_options = {"fPIC": True}
def layout(self):
cmake_layout(self)
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
def requirements(self):
self.requires("fmt/11.0.2")
if not self.conf.get("tools.build:skip_test"):
self.requires("gtest/1.15.0")
def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
tc.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
if not self.conf.get("tools.build:skip_test", default=False):
cmake.test()
def package(self):
CMake(self).install()