-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
41 lines (33 loc) · 1.45 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
from conans import ConanFile, CMake, tools
class WorldConan(ConanFile):
name = "world"
version = "1.1"
license = "<Put the package license here>"
author = "<Put your name here> <And your email here>"
url = "<Package recipe repository url here, for issues about the package>"
description = "<Description of Test here>"
topics = ("<Put some tag here>", "<here>", "<and here>")
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {"shared": False, "fPIC": True}
generators = "cmake"
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
def source(self):
self.run("git clone https://github.com/TMeixensberger/conan-test-package.git")
self.run("cp conan-test-package/hello-world . -r")
def build(self):
cmake = CMake(self)
cmake.verbose = True
cmake.configure(source_folder="hello-world")
cmake.build()
def package(self):
self.copy("*.h", dst="include", src="hello-world")
self.copy("*hello-world.lib", dst="lib", keep_path=False)
self.copy("*.dll", dst="bin", keep_path=False)
self.copy("*.so", dst="lib", keep_path=False)
self.copy("*.dylib", dst="lib", keep_path=False)
self.copy("*.a", dst="lib", keep_path=False)
def package_info(self):
self.cpp_info.libs = ["hello-world"]