-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconanfile.py
More file actions
51 lines (40 loc) · 1.74 KB
/
conanfile.py
File metadata and controls
51 lines (40 loc) · 1.74 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
import os.path
from conans import ConanFile, CMake
from conans import tools
class Lp3EngineConan(ConanFile):
name = "Lp3-Engine"
version = "0.4.1.0"
requires = ("Boost/1.60.0@lasote/stable",
"glm/0.9.8-0@TimSimpson/testing",
"GSL/0.0.0.0-1@TimSimpson/testing")
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
exports = ["conanfile.py", "CMakeLists.txt", "target/*", "src/*"]
def imports(self):
self.copy("*.dll", "", "bin")
self.copy("*.dylib", "", "lib")
def build(self):
root = self.conanfile_directory
if self.scope.dev:
cmd = 'macaroni {root} --generate'.format(root=root)
self.run("cd %s && %s" % (self.conanfile_directory, cmd))
skip_macaroni = ""
else:
skip_macaroni = "-DSKIP_MACARONI=1"
cmake = CMake(self.settings)
self.run('cmake "%s" %s %s' % (self.conanfile_directory,
cmake.command_line, skip_macaroni))
self.run("cmake --build . %s" % cmake.build_config)
def package(self):
for comp in ['Core', 'Gfx', 'Input']:
include_dir = os.path.join(self.conanfile_directory, 'src', comp)
self.copy("*.h", dst="include", src=include_dir)
self.copy("*.hpp", dst="include", src=include_dir)
# Copy headers generated by Macaroni
self.copy("*.h", dst="include", src="target")
self.copy("*.mh", dst="macaroni", src="target")
self.copy("*.lib", dst="lib", src="lib")
self.copy("*.a", dst="lib", src="lib")
self.copy("*.dll", dst="lib", src="lib")
def package_info(self):
self.cpp_info.libs = ["Lp3_Core", "Lp3_Gfx", "Lp3_Input"]