-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconanfile.py
49 lines (40 loc) · 1.75 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
from conan import ConanFile
from conan.tools.apple import is_apple_os
from conan.tools.scm import Git
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout
class QtColorWidgetsConan(ConanFile):
name = "qt-color-widgets"
version = "f72207b"
license = "https://github.com/ess-dmsc/Qt-Color-Widgets/blob/master/COPYING"
url = "https://github.com/ess-dmsc/Qt-Color-Widgets"
description = "Improved QColorDialog and several other color-related widgets."
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False]}
default_options = {"shared":False}
generators = "CMakeDeps"
# The folder name when the *.tar.gz release is extracted
folder_name = "Qt-Color-Widgets"
def source(self):
git = Git(self)
git.clone(url="https://github.com/ess-dmsc/Qt-Color-Widgets.git", target=".")
git.checkout(self.version)
def layout(self):
cmake_layout(self)
def generate(self):
tc = CMakeToolchain(self)
tc.preprocessor_definitions["BUILD_SHARED_LIBS"] = "OFF"
tc.preprocessor_definitions["BUILD_STATIC_LIBS"] = "ON"
tc.preprocessor_definitions["QTCOLORWIDGETS_DESIGNER_PLUGIN"] = "OFF"
tc.preprocessor_definitions["CMAKE_INSTALL_PREFIX"] = ""
if is_apple_os:
tc.preprocessor_definitions["CMAKE_MACOSX_RPATH"] = "ON"
tc.preprocessor_definitions["CMAKE_PREFIX_PATH"] = "/usr/local/opt/qt"
tc.preprocessor_definitions["CMAKE_SHARED_LINKER_FLAGS"] = "-headerpad_max_install_names"
tc.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
cmake.install()
def package_info(self):
self.cpp_info.libs = ["QtColorWidgets"]