-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconanfile.py
More file actions
54 lines (43 loc) · 1.5 KB
/
conanfile.py
File metadata and controls
54 lines (43 loc) · 1.5 KB
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
46
47
48
49
50
51
52
53
54
from conan import ConanFile
from conan.tools.cmake import CMake, cmake_layout
from conan.tools.files import copy
class RslUtilRecipe(ConanFile):
name = "rsl-util"
version = "0.1"
package_type = "header-library"
no_copy_source = True
# Optional metadata
license = "MIT"
author = "Tsche [email protected]"
description = "Reflective reimplementations of various standard library types and other utilities."
topics = () # TODO
settings = "os", "arch", "compiler", "build_type"
options = {
"examples": [True, False], "tests": [True, False]
}
default_options = {"examples": False, "tests": False}
generators = "CMakeToolchain", "CMakeDeps"
exports_sources = "CMakeLists.txt", "include/*", "test/*", "cmake/*"
def requirements(self):
if self.options.tests:
self.requires("gtest/1.17.0")
def layout(self):
cmake_layout(self)
def build(self):
cmake = CMake(self)
cmake.configure(
variables={
"BUILD_TESTING": self.options.tests,
"BUILD_EXAMPLES": self.options.examples
})
cmake.build()
cmake.install()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
self.cpp_info.set_property("cmake_file_name", "rsl-util")
util = self.cpp_info.components["util"]
util.set_property("cmake_target_name", "rsl::util")
util.includedirs = ["include"]
util.libs = []