-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
44 lines (33 loc) · 1.52 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
from conans import ConanFile, CMake
VERSION = "0.5"
class QuerysetCPP(ConanFile):
name = "queryset-cpp"
version = VERSION
description = """C++ implementation of an ORM inspired by Python/Django"""
generators = "cmake"
settings = "os", "compiler", "build_type", "arch"
exports = "conanfile.py", "CMakeLists.txt", "queryset/*", "tests/*"
url = "https://github.com/jgsogo/queryset-cpp"
options = {"shared": [True, False],}
default_options = "shared=True"
def requirements(self):
self.requires.add("Boost/1.60.0@lasote/stable")
self.requires.add("spdlog/0.9.0@memsharded/stable")
self.requires.add("sqlite3cc/master@jgsogo/stable")
self.requires.add("libpqxx/5.0.1@jgsogo/stable")
def imports(self):
self.copy("*.dll", dst="bin", src="bin") # From bin to bin
self.copy("*.dylib*", dst="bin", src="lib") # From lib to bin
def build(self):
cmake = CMake(self.settings)
flag_build_tests = "-DBUILD_TEST:BOOL=ON" if self.scope.BUILD_TEST else ""
if flag_build_tests:
self.run('cmake "%s" %s %s' % (self.conanfile_directory, cmake.command_line, flag_build_tests))
self.run("cmake --build . %s" % cmake.build_config)
self.run("ctest -C {}".format(self.settings.build_type))
def package(self):
self.copy("*.h", dst="include")
# self.copy("*.lib", dst="lib", src="lib")
# self.copy("*.a", dst="lib", src="lib")
def package_id(self):
self.info.header_only()