summaryrefslogtreecommitdiff
path: root/Tools/qt/conanfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/qt/conanfile.py')
-rw-r--r--Tools/qt/conanfile.py52
1 files changed, 22 insertions, 30 deletions
diff --git a/Tools/qt/conanfile.py b/Tools/qt/conanfile.py
index 5a3d0cfca..cecdd677d 100644
--- a/Tools/qt/conanfile.py
+++ b/Tools/qt/conanfile.py
@@ -31,7 +31,7 @@ class QtWebKitConan(ConanFile):
url = "https://github.com/qtwebkit/qtwebkit"
description = "Qt port of WebKit"
topics = ("qt", "browser-engine", "webkit", "qt5", "qml", "qtwebkit")
- settings = "os", "compiler", "build_type", "arch"
+ settings = "os", "compiler", "arch", "arch_build"
generators = "cmake", "virtualenv", "txt"
exports_sources = "../../*"
no_copy_source = True
@@ -40,6 +40,12 @@ class QtWebKitConan(ConanFile):
"libpng/1.6.37",
"libwebp/1.1.0"
)
+ options = {
+ "qt": "ANY",
+ "cmakeargs": "ANY",
+ "build_type": "ANY",
+ "install_prefix": "ANY"
+ }
default_options = {
"icu:shared": True,
"icu:data_packaging": "library",
@@ -64,11 +70,11 @@ class QtWebKitConan(ConanFile):
self.build_requires(
'pkg-config_installer/0.29.2@bincrafters/stable')
- # gperf python perl bison ruby flex
+ if self.settings.os == 'Windows': # TODO: Fix msys perl or at least allow using non-msys one from PATH
+ self.build_requires("strawberryperl/5.30.0.1")
+
if not tools.which("gperf"):
self.build_requires("gperf_installer/3.1@conan/stable")
- if not tools.which("perl"):
- self.build_requires("strawberryperl/5.30.0.1")
if not tools.which("ruby"):
self.build_requires("ruby_installer/2.6.3@bincrafters/stable")
if not tools.which("bison"):
@@ -94,20 +100,22 @@ class QtWebKitConan(ConanFile):
cmake.generator = "Ninja"
cmake.verbose = False
cmake.definitions["QT_CONAN_DIR"] = self.build_folder
- # QtWebKit installation requires conanfile.txt in build directory
- self.write_imports()
+ cmake.definitions["QT_CONAN_FILE"] = __file__
# if self.options.use_ccache:
# cmake.definitions["CMAKE_C_COMPILER_LAUNCHER"] = "ccache"
# cmake.definitions["CMAKE_CXX_COMPILER_LAUNCHER"] = "ccache"
- if "QTDIR" in os.environ:
+ if self.options.qt:
cmake.definitions["Qt5_DIR"] = os.path.join(
- os.environ["QTDIR"], "lib", "cmake", "Qt5")
+ str(self.options.qt), "lib", "cmake", "Qt5")
print("Qt5 directory:" + cmake.definitions["Qt5_DIR"])
- if "CMAKEFLAGS" in os.environ:
- cmake_flags = shlex.split(os.environ["CMAKEFLAGS"])
+ if self.options.build_type:
+ cmake.build_type = str(self.options.build_type)
+
+ if self.options.cmakeargs:
+ cmake_flags = shlex.split(str(self.options.cmakeargs))
else:
cmake_flags = None
@@ -122,6 +130,9 @@ class QtWebKitConan(ConanFile):
else:
ninja_flags = None
+ if self.options.install_prefix:
+ cmake.definitions["CMAKE_INSTALL_PREFIX"] = str(self.options.install_prefix)
+
print(self.source_folder)
print()
print(self.build_folder)
@@ -130,25 +141,6 @@ class QtWebKitConan(ConanFile):
cmake.build(args=ninja_flags)
cmake.install()
- # QtWebKit installation requires conanfile.txt in build directory, so we generate it here
- # Should be kept in sync with imports()
- def write_imports(self):
- conanfile = open(os.path.join(self.build_folder, "conanfile.txt"), "w")
- conanfile.write("[imports]\n")
-
- if self.settings.os == 'Windows':
- conanfile.write("bin, icudt65.dll -> ./bin\n")
- conanfile.write("bin, icuin65.dll -> ./bin\n")
- conanfile.write("bin, icuuc65.dll -> ./bin\n")
- # Visual Studio
- conanfile.write("bin, libxml2.dll -> ./bin\n")
- conanfile.write("bin, libxslt.dll -> ./bin\n")
- # MinGW
- conanfile.write("bin, libxml2-2.dll -> ./bin\n")
- conanfile.write("bin, libxslt-1.dll -> ./bin\n")
-
- conanfile.close()
-
def imports(self):
if self.settings.os == 'Windows':
self.copy("icudt65.dll", "./bin", "bin")
@@ -159,7 +151,7 @@ class QtWebKitConan(ConanFile):
self.copy("libxslt.dll", "./bin", "bin")
# MinGW
self.copy("libxml2-2.dll", "./bin", "bin")
- self.copy("libxml2-2.dll", "./bin", "bin")
+ self.copy("libxslt-1.dll", "./bin", "bin")
def package(self):
pass