Skip to content

Commit

Permalink
[Qt] Update to 5.12.4 (#7667)
Browse files Browse the repository at this point in the history
* update to 5.12.4
* removed port qt5-modularscripts and split it functionality into more functions into qt5-base
* added qt_port_hashes.cmake for simpler upgrade.
* added optional VCPKG_QT_HOST_MKSPEC and VCPKG_QT_TARGET_MKSPEC to select QTs build mkspecs from a triplet
* qt_<config>.conf are now copied from the build dir instead from the port dir
* fixed freetype dependencies.
* cleanup of vcpkg_qmake scripts. No strange/unclear replacements anymore.
* introduced vcpkg_buildpath_length_warning
* changed directory layout of the qt5 installation executables and mkspecs a bit.
  • Loading branch information
Neumann-A authored and Rastaban committed Sep 12, 2019
1 parent ecfc714 commit 96f4487
Show file tree
Hide file tree
Showing 102 changed files with 1,214 additions and 1,015 deletions.
2 changes: 1 addition & 1 deletion ports/libqglviewer/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: libqglviewer
Version: 2.7.0
Version: 2.7.0-2
Description: libQGLViewer is an open source C++ library based on Qt that eases the creation of OpenGL 3D viewers.
Build-Depends: qt5-base
13 changes: 13 additions & 0 deletions ports/libqglviewer/QGLViewer_remove_shared.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/QGLViewer/QGLViewer.pro b/QGLViewer/QGLViewer.pro
index f9afe8089..63f74736e 100644
--- a/QGLViewer/QGLViewer.pro
+++ b/QGLViewer/QGLViewer.pro
@@ -7,7 +7,7 @@
TEMPLATE = lib
TARGET = QGLViewer
VERSION = 2.7.0
-CONFIG *= qt opengl warn_on shared thread create_prl rtti no_keywords
+CONFIG *= qt opengl warn_on thread create_prl rtti no_keywords

QGL_HEADERS = \
qglviewer.h \
13 changes: 13 additions & 0 deletions ports/libqglviewer/macosx.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/QGLViewer/QGLViewer.pro b/QGLViewer/QGLViewer.pro
index 702925cb6..fc3cb7118 100644
--- a/QGLViewer/QGLViewer.pro
+++ b/QGLViewer/QGLViewer.pro
@@ -224,7 +224,7 @@ macx|darwin-g++ {
QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS

# So that the path QGLViewer/*.h exists
- QMAKE_POST_LINK=cd $$DESTDIR/QGLViewer.framework/Headers && (test -L QGLViewer || ln -s . QGLViewer)
+ #QMAKE_POST_LINK=cd $$DESTDIR/QGLViewer.framework/Headers && (test -L QGLViewer || ln -s . QGLViewer)

# Specific paths for the installation of the framework.
!isEmpty( LIB_DIR ) {
2 changes: 2 additions & 0 deletions ports/libqglviewer/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ vcpkg_from_github(
SHA512 0586020c159fa4b3acb3ea3fa0a361bcc757d840298d7a436c356d0929b5ace3da4d054e3c0d107a499076413336e3b9a2f35750e6bf0add9320cc52a5c7afd5
HEAD_REF master
PATCHES "use-default-config-on-all-platforms.patch"
"QGLViewer_remove_shared.patch"
"macosx.patch"
)

vcpkg_configure_qmake(SOURCE_PATH ${SOURCE_PATH}/QGLViewer/QGLViewer.pro)
Expand Down
4 changes: 2 additions & 2 deletions ports/qt5-3d/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-3d
Version: 5.12.3-1
Version: 5.12.4
Description: Qt5 3d Module - Functionality for near-realtime simulation systems with support for 2D and 3D rendering
Build-Depends: qt5-modularscripts, qt5-base, qt5-declarative
Build-Depends: qt5-base, qt5-declarative
7 changes: 2 additions & 5 deletions ports/qt5-3d/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
include(vcpkg_common_functions)

include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake)

qt_modular_library(qt3d 679c2dbc60fc53c1c5469369f25244bd844c2e6e723a1b451f7cbb50bfa018e6fb715214e5a5df6fb32d7c7936bb6c99d85e299fe2b76344bcf774c93ed0acd0)
include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake)
qt_submodule_installation()
4 changes: 2 additions & 2 deletions ports/qt5-activeqt/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: qt5-activeqt
Version: 5.12.3-1
Version: 5.12.4
Description: Qt5 ActiveQt Module - ActiveX components
Build-Depends: qt5-modularscripts, qt5-base
Build-Depends: qt5-base
9 changes: 2 additions & 7 deletions ports/qt5-activeqt/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
include(vcpkg_common_functions)

if (NOT VCPKG_TARGET_IS_WINDOWS)
message(FATAL_ERROR "qt5-activeqt only support Windows.")
endif()

include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake)

qt_modular_library(qtactiveqt 477c42653a59739aeeb17ab54bdd5cc50bc72a117250926e940c34d3f81d1b92356074056fb49f3cd811a88840377836b2d97cea8cbc62ae1d895168e7860753)

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools/qt5-activeqt/plugins/platforminputcontexts)
include(${CURRENT_INSTALLED_DIR}/share/qt5/qt_port_functions.cmake)
qt_submodule_installation()
2 changes: 1 addition & 1 deletion ports/qt5-base/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: qt5-base
Version: 5.12.3-4
Version: 5.12.4-6
Homepage: https://www.qt.io/
Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.
Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl
132 changes: 132 additions & 0 deletions ports/qt5-base/cmake/configure_qt.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
function(configure_qt)
cmake_parse_arguments(_csc "" "SOURCE_PATH;TARGET_PLATFORM;HOST_PLATFORM;HOST_TOOLS_ROOT" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN})

if(NOT _csc_TARGET_PLATFORM)
message(FATAL_ERROR "configure_qt requires a TARGET_PLATFORM argument.")
endif()

if(DEFINED _csc_HOST_PLATFORM)
list(APPEND _csc_OPTIONS -platform ${_csc_HOST_PLATFORM})
endif()

if(DEFINED _csc_HOST_TOOLS_ROOT)
## vcpkg internal file struture assumed here!
message(STATUS "Building Qt with prepared host tools from ${_csc_HOST_TOOLS_ROOT}!")
vcpkg_add_to_path("${_csc_HOST_TOOLS_ROOT}/bin")
vcpkg_add_to_path("${_csc_HOST_TOOLS_ROOT}")
set(EXT_BIN_DIR -external-hostbindir ${_csc_HOST_TOOLS_ROOT}/bin) # we only use release binaries for building
find_program(QMAKE_COMMAND NAMES qmake PATHS ${_csc_HOST_TOOLS_ROOT}/bin NO_DEFAULT_PATH)
set(INVOKE "${QMAKE_COMMAND}" )
else()
if(CMAKE_HOST_WIN32)
set(CONFIGURE_BAT "configure.bat")
else()
set(CONFIGURE_BAT "configure")
endif()
set(INVOKE "${_csc_SOURCE_PATH}/${CONFIGURE_BAT}")
endif()

#Cleanup previous build folders
file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")

#Find and ad Perl to PATH
vcpkg_find_acquire_program(PERL)
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
vcpkg_add_to_path("${PERL_EXE_PATH}")

if("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static")
list(APPEND _csc_OPTIONS -static)
else()
#list(APPEND _csc_OPTIONS_DEBUG -separate-debug-info)
endif()

if(VCPKG_TARGET_IS_WINDOWS AND "${VCPKG_CRT_LINKAGE}" STREQUAL "static")
list(APPEND _csc_OPTIONS -static-runtime)
endif()

list(APPEND _csc_OPTIONS_RELEASE -release)
list(APPEND _csc_OPTIONS_DEBUG -debug)

#Replace with VCPKG variables if PR #7733 is merged
unset(BUILDTYPES)
if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug")
set(_buildname "DEBUG")
list(APPEND BUILDTYPES ${_buildname})
set(_short_name_${_buildname} "dbg")
set(_path_suffix_${_buildname} "/debug")
set(_build_type_${_buildname} "debug")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "release")
set(_buildname "RELEASE")
list(APPEND BUILDTYPES ${_buildname})
set(_short_name_${_buildname} "rel")
set(_path_suffix_${_buildname} "")
set(_build_type_${_buildname} "release")
endif()
unset(_buildname)

foreach(_buildname ${BUILDTYPES})
set(_build_triplet ${TARGET_TRIPLET}-${_short_name_${_buildname}})
message(STATUS "Configuring ${_build_triplet}")
set(_build_dir "${CURRENT_BUILDTREES_DIR}/${_build_triplet}")
file(MAKE_DIRECTORY ${_build_dir})
# These paths get hardcoded into qmake. So point them into the CURRENT_INSTALLED_DIR instead of CURRENT_PACKAGES_DIR
# makefiles will be fixed to install into CURRENT_PACKAGES_DIR in install_qt
set(BUILD_OPTIONS ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildname}}
-prefix ${CURRENT_INSTALLED_DIR}
-extprefix ${CURRENT_INSTALLED_DIR}
${EXT_BIN_DIR}
-hostprefix ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}
-hostlibdir ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}/lib # could probably be move to manual-link
-hostbindir ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}/bin
# Qt VS Plugin requires a /bin subfolder with the executables in the root dir. But to use the wizard a correctly setup lib folder is also required
# So with the vcpkg layout there is no way to make it work unless all dll are are copied to tools/qt5/bin and all libs to tools/qt5/lib
-archdatadir ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}
-datadir ${CURRENT_INSTALLED_DIR}${_path_suffix}/share/qt5${_path_suffix_${_buildname}}
-plugindir ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/plugins
-qmldir ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/qml
-headerdir ${CURRENT_INSTALLED_DIR}/include
-libexecdir ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}
-bindir ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/bin
-libdir ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/lib
-I ${CURRENT_INSTALLED_DIR}/include
-L ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/lib
-L ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/lib/manual-link
-xplatform ${_csc_TARGET_PLATFORM}
)

if(DEFINED _csc_HOST_TOOLS_ROOT) #use qmake
if(WIN32)
set(INVOKE_OPTIONS "QMAKE_CXX.QMAKE_MSC_VER=1911" "QMAKE_MSC_VER=1911")
endif()
vcpkg_execute_required_process(
COMMAND ${INVOKE} "${_csc_SOURCE_PATH}" "${INVOKE_OPTIONS}" -- ${BUILD_OPTIONS}
WORKING_DIRECTORY ${_build_dir}
LOGNAME config-${_build_triplet}
)
else()# call configure (builds qmake for triplet and calls it like above)
vcpkg_execute_required_process(
COMMAND "${INVOKE}" ${BUILD_OPTIONS}
WORKING_DIRECTORY ${_build_dir}
LOGNAME config-${_build_triplet}
)
endif()

# Note archdatadir and datadir are required to be prefixed with the hostprefix?
message(STATUS "Configuring ${_build_triplet} done")

# Copy configuration dependent qt.conf
file(TO_CMAKE_PATH "${CURRENT_PACKAGES_DIR}" CMAKE_CURRENT_PACKAGES_DIR_PATH)
file(TO_CMAKE_PATH "${CURRENT_INSTALLED_DIR}" CMAKE_CURRENT_INSTALLED_DIR_PATH)
file(READ "${CURRENT_BUILDTREES_DIR}/${_build_triplet}/bin/qt.conf" _contents)
string(REPLACE "${CMAKE_CURRENT_PACKAGES_DIR_PATH}" "\${CURRENT_INSTALLED_DIR}" _contents ${_contents})
string(REPLACE "${CMAKE_CURRENT_INSTALLED_DIR_PATH}" "\${CURRENT_INSTALLED_DIR}" _contents ${_contents})
#string(REPLACE "HostPrefix=\${CURRENT_PACKAGES_DIR}" "HostPrefix=\${CURRENT_INSTALLED_DIR}" _contents ${_contents})
string(REPLACE "[EffectivePaths]\nPrefix=..\n" "" _contents ${_contents})
string(REPLACE "[EffectiveSourcePaths]\nPrefix=${_csc_SOURCE_PATH}\n" "" _contents ${_contents})
string(REPLACE "Sysroot=\n" "" _contents ${_contents})
string(REPLACE "SysrootifyPrefix=false\n" "" _contents ${_contents})
file(WRITE "${CURRENT_PACKAGES_DIR}/tools/qt5/qt_${_build_type_${_buildname}}.conf" "${_contents}")
endforeach()

endfunction()
101 changes: 101 additions & 0 deletions ports/qt5-base/cmake/find_qt_mkspec.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
function(find_qt_mkspec TARGET_PLATFORM_MKSPEC_OUT HOST_PLATFORM_MKSPEC_OUT EXT_HOST_TOOLS_OUT)
## Figure out QTs target mkspec
if(NOT DEFINED VCPKG_QT_TARGET_MKSPEC)
message(STATUS "Figuring out qt target mkspec. Target arch ${VCPKG_TARGET_ARCHITECTURE}")
if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_TARGET_IS_UWP)
if(VCPKG_PLATFORM_TOOLSET STREQUAL "v140")
set(msvc_year "2015")
elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v141")
set(msvc_year "2017")
elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v142")
set(msvc_year "2019")
else()
message(FATAL_ERROR "No target mkspec found!")
endif()
set(_tmp_targ_out "winrt-${VCPKG_TARGET_ARCHITECTURE}-msvc${msvc_year}")
else()
if("${VCPKG_TARGET_ARCHITECTURE}" MATCHES "arm64")
message(STATUS "Figuring out arm64")
set(_tmp_targ_out "win32-arm64-msvc2017") #mkspec does not have anything defined related to msvc2017 so this should work
else()
set(_tmp_targ_out "win32-msvc")
endif()
endif()
elseif(VCPKG_TARGET_IS_LINUX)
set(_tmp_targ_out "linux-g++" )
elseif(VCPKG_TARGET_IS_OSX)
set(_tmp_targ_out "macx-clang") # switch to macx-g++ since vcpkg requires g++ to compile any way?
endif()
else()
set(_tmp_targ_out ${VCPKG_QT_TARGET_MKSPEC})
endif()
message(STATUS "Target mkspec set to: ${_tmp_targ_out}")
set(${TARGET_PLATFORM_MKSPEC_OUT} ${_tmp_targ_out} PARENT_SCOPE)

## Figure out QTs host mkspec
if(NOT DEFINED VCPKG_QT_HOST_MKSPEC)
#if(WIN32)
# set(_tmp_host_out "win32-msvc")
#elseif("${CMAKE_HOST_SYSTEM}" STREQUAL "Linux")
# set(_tmp_host_out "linux-g++")
#elseif("${CMAKE_HOST_SYSTEM}" STREQUAL "Darwin")
# set(_tmp_host_out "macx-clang")
#endif()
if(DEFINED _tmp_host_out)
message(STATUS "Host mkspec set to: ${_tmp_host_out}")
else()
message(STATUS "Host mkspec not set. Qt's own buildsystem will try to figure out the host system")
endif()
else()
set(_tmp_host_out ${VCPKG_QT_HOST_MKSPEC})
endif()

if(DEFINED _tmp_host_out)
set(${HOST_PLATFORM_MKSPEC_OUT} ${_tmp_host_out} PARENT_SCOPE)
endif()

## Figure out VCPKG qt-tools directory for the port.
if(NOT DEFINED VCPKG_QT_HOST_TOOLS_ROOT AND DEFINED VCPKG_QT_HOST_PLATFORM) ## Root dir of the required host tools
if(NOT "${_tmp_host_out}" MATCHES "${_tmp_host_out}")
if(CMAKE_HOST_WIN32)

if($ENV{PROCESSOR_ARCHITECTURE} MATCHES "[aA][rR][mM]64")
list(APPEND _test_triplets arm64-windows)
elseif($ENV{PROCESSOR_ARCHITECTURE} MATCHES "[aA][mM][dD]64")
list(APPEND _test_triplets x64-windows x64-windows-static)
list(APPEND _test_triplets x86-windows x86-windows-static)
elseif($ENV{PROCESSOR_ARCHITECTURE} MATCHES "x86")
list(APPEND _test_triplets x86-windows x86-windows-static)
else()
message(FATAL_ERROR "Unknown host processor! Host Processor $ENV{PROCESSOR_ARCHITECTURE}")
endif()
elseif(CMAKE_HOST_SYSTEM STREQUAL "Linux")
list(APPEND _test_triplets "x64-linux")
elseif(CMAKE_HOST_SYSTEM STREQUAL "Darwin")
list(APPEND _test_triplets "x64-osx")
else()
endif()
foreach(_triplet ${_test_triplets})
find_program(QMAKE_PATH qmake PATHS ${VCPKG_ROOT_DIR}/installed/${_triplet}/tools/qt5/bin NO_DEFAULT_PATHS)
message(STATUS "Checking: ${VCPKG_ROOT_DIR}/installed/${_triplet}/tools/qt5/bin. ${QMAKE_PATH}")
if(QMAKE_PATH)
set(_tmp_host_root "${VCPKG_ROOT_DIR}/installed/${_triplet}/tools/qt5")
set(_tmp_host_qmake ${QMAKE_PATH} PARENT_SCOPE)
message(STATUS "Qt host tools root dir within vcpkg: ${_tmp_host_root}")
break()
endif()
endforeach()
if(NOT DEFINED _tmp_host_root)
message(FATAL_ERROR "Unable to locate required host tools. Please define VCPKG_QT_HOST_TOOLS_ROOT to the required root dir of the host tools")
endif()
endif()
else()
set(_tmp_host_root ${VCPKG_QT_HOST_TOOLS_ROOT})
endif()

if(DEFINED _tmp_host_root)
set(${EXT_HOST_TOOLS_OUT} ${_tmp_host_root} PARENT_SCOPE)
endif()

endfunction()
Loading

0 comments on commit 96f4487

Please sign in to comment.