qt5winextras

This commit is contained in:
Barath Kannan 2017-10-16 23:56:47 +11:00
parent 3ba22c1754
commit d28de4a13e
7 changed files with 90 additions and 73 deletions

View File

@ -1,62 +0,0 @@
diff --git a/mkspecs/modules/qt_lib_gui_private.pri b/mkspecs/modules/qt_lib_gui_private.pri
index 5473e78..c5e7448 100644
--- a/mkspecs/modules/qt_lib_gui_private.pri
+++ b/mkspecs/modules/qt_lib_gui_private.pri
@@ -11,4 +11,9 @@ QT.gui_private.enabled_features = direct2d directwrite directwrite2 freetype gif
QT.gui_private.disabled_features = xcb accessibility-atspi-bridge angle_d3d11_qdtd directfb egl egl_x11 eglfs eglfs_brcm eglfs_egldevice eglfs_gbm eglfs_mali eglfs_viv eglfs_viv_wl evdev fontconfig integrityfb integrityhid kms libinput libinput-axis-api linuxfb mirclient mtdev system-freetype system-xcb tslib vnc xkbcommon-evdev xlib
QMAKE_LIBS_HARFBUZZ = -lharfbuzz
QMAKE_LIBS_LIBJPEG = -ljpeg
-QMAKE_LIBS_LIBPNG = -llibpng16
+CONFIG(release, debug|release) {
+ QMAKE_LIBS_LIBPNG = -llibpng16
+}
+CONFIG(debug, debug|release) {
+ QMAKE_LIBS_LIBPNG = -llibpng16d
+}
diff --git a/mkspecs/qconfig.pri b/mkspecs/qconfig.pri
index 2af37df..646b8e5 100644
--- a/mkspecs/qconfig.pri
+++ b/mkspecs/qconfig.pri
@@ -2,8 +2,14 @@ QT_ARCH = x86_64
QT_BUILDABI = x86_64-little_endian-lp64
QT.global.enabled_features = shared c++11 concurrent
QT.global.disabled_features = cross_compile framework rpath appstore-compliant debug_and_release simulator_and_device build_all c++14 c++1z pkg-config force_asserts separate_debug_info static
-QT_CONFIG += shared release c++11 concurrent dbus no-pkg-config stl
-CONFIG += shared release no_plugin_manifest
+CONFIG(release, debug|release) {
+ QT_CONFIG += shared release c++11 concurrent dbus no-pkg-config stl
+ CONFIG += shared release no_plugin_manifest
+}
+CONFIG(debug, debug|release) {
+ QT_CONFIG += shared debug c++11 concurrent dbus no-pkg-config release_tools stl
+ CONFIG += shared debug no_plugin_manifest
+}
QT_VERSION = 5.9.2
QT_MAJOR_VERSION = 5
QT_MINOR_VERSION = 9
diff --git a/mkspecs/qmodule.pri b/mkspecs/qmodule.pri
index 3e213d4..00a37ca 100644
--- a/mkspecs/qmodule.pri
+++ b/mkspecs/qmodule.pri
@@ -1,10 +1,17 @@
EXTRA_INCLUDEPATH += C:/vcpkg/installed/x64-windows/include
-EXTRA_LIBDIR += C:/vcpkg/installed/x64-windows/lib
+CONFIG(release, debug|release) {
+ EXTRA_LIBDIR += C:/vcpkg/installed/x64-windows/lib
+ QT.global_private.enabled_features = alloca_malloc_h alloca sse2 dbus gui network qml-debug sql system-zlib testlib widgets xml
+ QT.global_private.disabled_features = alloca_h android-style-assets private_tests dbus-linked libudev posix_fallocate reduce_exports reduce_relocations release_tools stack-protector-strong
+ QMAKE_LIBS_ZLIB = -lzlib
+}
+CONFIG(debug, debug|release) {
+ QT.global_private.enabled_features = alloca_malloc_h alloca sse2 dbus gui network qml-debug release_tools sql system-zlib testlib widgets xml
+ QT.global_private.disabled_features = alloca_h android-style-assets private_tests dbus-linked libudev posix_fallocate reduce_exports reduce_relocations stack-protector-strong
+ QMAKE_LIBS_ZLIB = -lzlibd
+}
QT_CPU_FEATURES.x86_64 = sse sse2
-QT.global_private.enabled_features = alloca_malloc_h alloca sse2 dbus gui network qml-debug sql system-zlib testlib widgets xml
-QT.global_private.disabled_features = alloca_h android-style-assets private_tests dbus-linked libudev posix_fallocate reduce_exports reduce_relocations release_tools stack-protector-strong
QT_COORD_TYPE = double
-QMAKE_LIBS_ZLIB = -lzlib
CONFIG += sse2 sse3 ssse3 sse4_1 sse4_2 avx avx2 compile_examples f16c largefile msvc_mp precompile_header
QT_BUILD_PARTS += libs tools
QT_HOST_CFLAGS_DBUS +=

View File

@ -10,7 +10,6 @@ function(install_qt)
vcpkg_find_acquire_program(JOM)
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY)
set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}")
set(_path "$ENV{PATH}")

View File

@ -70,15 +70,8 @@ configure_qt(
install_qt()
#vcpkg_apply_patches(
# SOURCE_PATH ${CURRENT_PACKAGES_DIR}/share/qt5
# PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-debug-qmakespecs.patch"
#)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)
#file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
#file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe")
file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5)

View File

@ -0,0 +1,48 @@
import os
import re
from glob import glob
files = [y for x in os.walk('.') for y in glob(os.path.join(x[0], '*.cmake'))]
for f in files:
openedfile = open(f, "r")
builder = ""
dllpattern = re.compile("_install_prefix}/bin/Qt5.*d.dll")
libpattern = re.compile("_install_prefix}/lib/Qt5.*d.lib")
exepattern = re.compile("_install_prefix}/bin/[a-z]+.exe")
for line in openedfile:
if "_install_prefix}/bin/${LIB_LOCATION}" in line:
builder += " if (${Configuration} STREQUAL \"RELEASE\")"
builder += "\n " + line
builder += " else()"
builder += "\n " + line.replace("/bin/", "/debug/bin/")
builder += " endif()\n"
elif "_install_prefix}/lib/${LIB_LOCATION}" in line:
builder += " if (${Configuration} STREQUAL \"RELEASE\")"
builder += "\n " + line
builder += " else()"
builder += "\n " + line.replace("/lib/", "/debug/lib/")
builder += " endif()\n"
elif "_install_prefix}/lib/${IMPLIB_LOCATION}" in line:
builder += " if (${Configuration} STREQUAL \"RELEASE\")"
builder += "\n " + line
builder += " else()"
builder += "\n " + line.replace("/lib/", "/debug/lib/")
builder += " endif()\n"
elif "_install_prefix}/plugins/${PLUGIN_LOCATION}" in line:
builder += " if (${Configuration} STREQUAL \"RELEASE\")"
builder += "\n " + line
builder += " else()"
builder += "\n " + line.replace("/plugins/", "/debug/plugins/")
builder += " endif()\n"
elif dllpattern.search(line) != None:
builder += line.replace("/bin/", "/debug/bin/")
elif libpattern.search(line) != None:
builder += line.replace("/lib/", "/debug/lib/")
elif exepattern.search(line) != None:
builder += line.replace("/bin/", "/tools/qt5/")
else:
builder += line
new_file = open(f, "w")
new_file.write(builder)
new_file.close()

View File

@ -31,14 +31,49 @@ endif()
# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings
set(ENV{_CL_} "/utf-8")
vcpkg_configure_qmake_debug(
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}
)
vcpkg_build_qmake_debug()
vcpkg_configure_qmake_release(
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}
)
vcpkg_build_qmake_release()
vcpkg_configure_qmake_debug(
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}
set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY)
set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}")
set(_path "$ENV{PATH}")
vcpkg_execute_required_process(
COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py
WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake
LOGNAME fix-cmake
)
vcpkg_build_qmake_debug()
set(ENV{PATH} "${_path}")
file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug)
file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug)
file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug)
file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug)
file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR})
file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR})
file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR})
file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)
file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll")
file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll")
file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS})
file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5winextras RENAME copyright)

View File

@ -38,4 +38,7 @@ function(vcpkg_configure_qmake_debug)
LOGNAME config-${TARGET_TRIPLET}-dbg
)
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done")
unset(QMAKE_COMMAND)
unset(QMAKE_COMMAND PARENT_SCOPE)
unset(QMAKE_COMMAND CACHE)
endfunction()

View File

@ -38,6 +38,7 @@ function(vcpkg_configure_qmake_release)
LOGNAME config-${TARGET_TRIPLET}-rel
)
message(STATUS "Configuring ${TARGET_TRIPLET}-rel done")
unset(QMAKE_COMMAND)
unset(QMAKE_COMMAND PARENT_SCOPE)
unset(QMAKE_COMMAND CACHE)
endfunction()