-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconanfile.py
58 lines (42 loc) · 1.34 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
from conans import ConanFile, CMake, tools, __version__ as conan_version
assert conan_version >= tools.Version('1.35'), 'Conan version is too old.'
class QtUnixCmdConan(ConanFile):
name = 'unixcmd'
version = '0.0.0'
generators = 'cmake'
settings = "os", "arch", "compiler", "build_type"
exports_sources = (
'CMakeLists.txt',
'main.cpp',
'qml/copy_dialog.qml',
'qml.qrc'
)
requires = 'qt/6.4.0@nap/devel'
options = {
'ci_build': [False, True],
'shared': [False, True],
}
default_options = {
'ci_build': False,
'shared': True,
}
def build(self):
self.cmake.build()
def package(self):
self.cmake.install()
@property
def cmake(self):
generator = 'Xcode' if self.settings.os == 'iOS' else 'Ninja'
cmake = CMake(self, generator=generator)
#cmake.definitions['QT_HOST_PATH'] = 'TODO'
cmake.definitions['CONAN_DISABLE_CHECK_COMPILER'] = True
cmake.definitions['CMAKE_SYSTEM_NAME'] = self.cmake_system_name
if self.options.ci_build:
cmake.definitions['IS_CI_BUILD'] = True
cmake.configure()
return cmake
@property
def cmake_system_name(self):
if self.settings.os == 'Macos':
return 'Darwin'
return self.settings.os