-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconanfile.py
More file actions
43 lines (38 loc) · 1.53 KB
/
Copy pathconanfile.py
File metadata and controls
43 lines (38 loc) · 1.53 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
from conan import ConanFile
from conan.tools.env import VirtualBuildEnv
from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake
# This recipe is only to install dependencies to build MdtTerminal
# The recipes to create packages are in packaging/conan/ subfolder
class MdtTerminalConan(ConanFile):
name = "mdtterminal"
license = "LGPL-3.0-or-later"
url = "https://gitlab.com/scandyna/mdtterminal"
description = "Terminal to experiment with some devices using some ports, like serial port."
settings = "os", "compiler", "build_type", "arch"
options = {
"shared": [True, False],
"enable_serialport_userspace_usb_support": [True, False]
}
default_options = {
"shared": True,
"enable_serialport_userspace_usb_support": True
}
generators = "CMakeDeps", "VirtualBuildEnv"
def configure(self):
if self.settings.os == "Windows":
self.options.enable_serialport_userspace_usb_support = False
def requirements(self):
self.requires("qt/6.8.3")
self.requires("mdtitemmodel/0.0.7@scandyna/testing")
if self.options.enable_serialport_userspace_usb_support:
self.requires("libusb/1.0.29")
def build_requirements(self):
self.test_requires("catch2/2.13.10")
self.test_requires("mdtcmakemodules/0.22.0@scandyna/testing")
def generate(self):
tc = CMakeToolchain(self)
if self.options.enable_serialport_userspace_usb_support:
tc.variables["ENABLE_SERIALPORT_USERSPACE_USB_SUPPORT"] = "ON"
else:
tc.variables["ENABLE_SERIALPORT_USERSPACE_USB_SUPPORT"] = "OFF"
tc.generate()