-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
63 lines (52 loc) · 2.24 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from conans import ConanFile, CMake
import os
class ToolbasView(ConanFile):
settings = "os", "compiler", "build_type", "arch"
requires = [
"wxwidgets/3.2.1@terranum-conan+wxwidgets/stable",
"mariadb/10.6.10@terranum-conan+mariadb/stable",
"gdal/3.5.2@terranum-conan+gdal/stable",
"libtiff/4.4.0",
"libdeflate/1.12",
"proj/9.0.1",
"libjpeg/9e",
"libpng/1.6.38"
]
options = {"unit_test": [True, False]}
default_options = {"unit_test": False}
generators = "cmake", "gcc", "txt"
def requirements(self):
if self.options.unit_test:
self.requires("gtest/1.12.1")
def configure(self):
self.options["gdal"].with_curl = True # for xml support
self.options["gdal"].shared = True
# this isn't needed anymore with wxWidgets 3.2.1
# if self.settings.os == "Linux":
# self.options["wxwidgets"].webview = False # webview control isn't available on linux.
def imports(self):
# copy libraries
self.copy("*.dll", dst="bin", src="bin") # From bin to bin
self.copy("*.dylib", dst="bin", src="lib")
if self.settings.os == "Linux":
self.copy("*.so*", dst="bin", src="lib")
# copy errmsg.sys on different places
if self.settings.os == "Windows" or self.settings.os == "Linux":
self.copy("errmsg.sys", dst="bin/mysql", src="share/english")
if self.settings.os == "Macos":
self.copy("errmsg.sys", dst="bin/ToolBasView.app/Contents/mysql", src="share/english")
if self.options.unit_test:
self.copy("errmsg.sys", dst="mysql", src="share/english")
# copy proj library datum
if self.settings.os == "Windows" or self.settings.os == "Linux":
self.copy("*", dst="bin", src="res", root_package="proj")
if self.settings.os == "Macos":
self.copy("*", dst="bin/ToolBasView.app/Contents/share/proj", src="res", root_package="proj")
def build(self):
cmake = CMake(self)
if self.options.unit_test:
cmake.definitions["USE_UNITTEST"] = "ON"
cmake.configure()
cmake.build()
if self.settings.os == "Macos":
cmake.install()