diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-11-20 17:07:03 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-11-20 17:07:03 -0800 |
| commit | eec26f68fc0f380118b2de7670c98f7a639d9d4b (patch) | |
| tree | 8cf88593e0db892f0e2b14b275264a21c0fcf619 | |
| parent | 875bb9a6611d51c0cd6b476983e0f220203a603d (diff) | |
| download | vcpkg-eec26f68fc0f380118b2de7670c98f7a639d9d4b.tar.gz vcpkg-eec26f68fc0f380118b2de7670c98f7a639d9d4b.zip | |
[qt5] Reduce duplication in modular build by extracting qt5modularscripts
60 files changed, 261 insertions, 3354 deletions
diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL new file mode 100644 index 000000000..060b41e3c --- /dev/null +++ b/ports/qt5/CONTROL @@ -0,0 +1,4 @@ +Source: qt5 +Version: 5.9.2-1 +Description: Qt5 Application Framework +Build-Depends: qt5base, qt5charts, qt5datavis3d, qt5declarative, qt5gamepad, qt5imageformats, qt5multimedia, qt5scxml, qt5serial, qt5speech, qt5svg, qt5tools, qt5virtualkeyboard, qt5websockets, qt53d, qt5winextras, qt5xmlpatterns diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake new file mode 100644 index 000000000..cc6e26fcb --- /dev/null +++ b/ports/qt5/portfile.cmake @@ -0,0 +1 @@ +SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)
diff --git a/ports/qt53d/CONTROL b/ports/qt53d/CONTROL index d8130de6e..b75c6b7bf 100644 --- a/ports/qt53d/CONTROL +++ b/ports/qt53d/CONTROL @@ -1,4 +1,4 @@ Source: qt53d Version: 5.9.2-0 Description: Qt5 3d Module - Functionality for near-realtime simulation systems with support for 2D and 3D rendering -Build-Depends: qt5base
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base
\ No newline at end of file diff --git a/ports/qt53d/portfile.cmake b/ports/qt53d/portfile.cmake index dd9751650..7de7bb5d5 100644 --- a/ports/qt53d/portfile.cmake +++ b/ports/qt53d/portfile.cmake @@ -1,157 +1,5 @@ include(vcpkg_common_functions) -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() - -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qt3d-5.9.2") -set(ARCHIVE_NAME "qt3d-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 1c7dbd4e557cdd183ec6e929aae5727ce2ffcb519517942b588594bb81a78cb3d732cde4dae58085a70ec2968a8c2443eae96536125c25938222ff7c89f4f9a2 -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
\ No newline at end of file +qt_modular_library(qt3d 1c7dbd4e557cdd183ec6e929aae5727ce2ffcb519517942b588594bb81a78cb3d732cde4dae58085a70ec2968a8c2443eae96536125c25938222ff7c89f4f9a2) diff --git a/ports/qt5base/configure_qt.cmake b/ports/qt5base/configure_qt.cmake index 315c48bdf..1d4f1e570 100644 --- a/ports/qt5base/configure_qt.cmake +++ b/ports/qt5base/configure_qt.cmake @@ -33,7 +33,7 @@ function(configure_qt) -datadir ${CURRENT_PACKAGES_DIR}/share/qt5/debug -plugindir ${CURRENT_PACKAGES_DIR}/debug/plugins -qmldir ${CURRENT_PACKAGES_DIR}/debug/qml - -headerdir ${CURRENT_PACKAGES_DIR}/share/qt5/debug/include + -headerdir ${CURRENT_PACKAGES_DIR}/include -I ${CURRENT_INSTALLED_DIR}/include -L ${CURRENT_INSTALLED_DIR}/debug/lib -platform ${PLATFORM} diff --git a/ports/qt5base/portfile.cmake b/ports/qt5base/portfile.cmake index 3c18a13f6..5cb7c6b82 100644 --- a/ports/qt5base/portfile.cmake +++ b/ports/qt5base/portfile.cmake @@ -77,13 +77,9 @@ file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) file(REMOVE ${BINARY_TOOLS}) file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe") -file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/qt5) file(REMOVE ${BINARY_TOOLS}) -set(QT_DEBUG_PREFIX_PATH ${CURRENT_INSTALLED_DIR}) -set(QT_RELEASE_PREFIX_PATH ${CURRENT_INSTALLED_DIR}) -configure_file(${CMAKE_CURRENT_LIST_DIR}/qt_debug.conf ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/qt.conf) -configure_file(${CMAKE_CURRENT_LIST_DIR}/qt_release.conf ${CURRENT_PACKAGES_DIR}/tools/qt5/qt.conf) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/qt_debug.conf ${CMAKE_CURRENT_LIST_DIR}/qt_release.conf DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) vcpkg_execute_required_process( COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py @@ -92,5 +88,6 @@ vcpkg_execute_required_process( ) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/qt5) -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5base RENAME copyright)
\ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5base RENAME copyright) diff --git a/ports/qt5base/qt_debug.conf b/ports/qt5base/qt_debug.conf index 3bed4b725..1314d00b9 100644 --- a/ports/qt5base/qt_debug.conf +++ b/ports/qt5base/qt_debug.conf @@ -1,7 +1,7 @@ [Paths] -Prefix = ${QT_DEBUG_PREFIX_PATH} -Documentation = share/qt5/debug/doc -Headers = share/qt5/debug/include +Prefix = ${CURRENT_INSTALLED_DIR} +Documentation = share/qt5/doc +Headers = include Libraries = debug/lib Binaries = debug/tools/qt5 LibraryExecutables = debug/tools/qt5 diff --git a/ports/qt5base/qt_release.conf b/ports/qt5base/qt_release.conf index 99356fc26..a04aef525 100644 --- a/ports/qt5base/qt_release.conf +++ b/ports/qt5base/qt_release.conf @@ -1,5 +1,5 @@ [Paths] -Prefix = ${QT_RELEASE_PREFIX_PATH} +Prefix = ${CURRENT_INSTALLED_DIR} Documentation = share/qt5/doc Headers = include Libraries = lib diff --git a/ports/qt5charts/CONTROL b/ports/qt5charts/CONTROL index d1a2eb844..7b97a82b8 100644 --- a/ports/qt5charts/CONTROL +++ b/ports/qt5charts/CONTROL @@ -1,4 +1,4 @@ Source: qt5charts Version: 5.9.2-0 Description: Qt5 Charts Module - UI components for displaying charts, driven by static or dynamic data models -Build-Depends: qt5base
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base
\ No newline at end of file diff --git a/ports/qt5charts/fixcmake.py b/ports/qt5charts/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5charts/fixcmake.py +++ /dev/null @@ -1,57 +0,0 @@ -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") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/", "/bin/") - builder += " else()" - builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") - builder += " endif()\n" - elif "_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 tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/", "/debug/bin/") - 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()
\ No newline at end of file diff --git a/ports/qt5charts/portfile.cmake b/ports/qt5charts/portfile.cmake index 6e43f92b5..45a53b63d 100644 --- a/ports/qt5charts/portfile.cmake +++ b/ports/qt5charts/portfile.cmake @@ -1,157 +1,5 @@ include(vcpkg_common_functions) -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() - -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qtcharts-5.9.2") -set(ARCHIVE_NAME "qtcharts-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 297547b565dd71b05237bb05ecc1abf1a774a4909668417e78bd65e805c1e47a456a5a06898fe06d4c4614118e4129e19893d4c77598667a9354ab969307a293 -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
\ No newline at end of file +qt_modular_library(qtcharts 297547b565dd71b05237bb05ecc1abf1a774a4909668417e78bd65e805c1e47a456a5a06898fe06d4c4614118e4129e19893d4c77598667a9354ab969307a293) diff --git a/ports/qt5datavisualization3d/CONTROL b/ports/qt5datavis3d/CONTROL index f48b02579..c3f2157f8 100644 --- a/ports/qt5datavisualization3d/CONTROL +++ b/ports/qt5datavis3d/CONTROL @@ -1,4 +1,4 @@ -Source: qt5datavisualization3d +Source: qt5datavis3d Version: 5.9.2-0 Description: Qt5 Data Visualization 3d Module - UI Components for creating 3D data visualizations -Build-Depends: qt5base
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base
\ No newline at end of file diff --git a/ports/qt5datavis3d/portfile.cmake b/ports/qt5datavis3d/portfile.cmake new file mode 100644 index 000000000..d7a552cba --- /dev/null +++ b/ports/qt5datavis3d/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtdatavis3d 5f173401ba2f0ebb4bbb1ff65053f1ece44a97a8bf1d9fc8d81540709c588e140c533d5f317d6a9109d538e38aa742d42bf00906f63d433811bc1c8526788dc3) diff --git a/ports/qt5datavisualization3d/fixcmake.py b/ports/qt5datavisualization3d/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5datavisualization3d/fixcmake.py +++ /dev/null @@ -1,57 +0,0 @@ -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") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/", "/bin/") - builder += " else()" - builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") - builder += " endif()\n" - elif "_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 tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/", "/debug/bin/") - 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()
\ No newline at end of file diff --git a/ports/qt5datavisualization3d/portfile.cmake b/ports/qt5datavisualization3d/portfile.cmake deleted file mode 100644 index 8a067c524..000000000 --- a/ports/qt5datavisualization3d/portfile.cmake +++ /dev/null @@ -1,157 +0,0 @@ -include(vcpkg_common_functions) - -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() - -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() - -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qtdatavis3d-5.9.2") -set(ARCHIVE_NAME "qtdatavis3d-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 5f173401ba2f0ebb4bbb1ff65053f1ece44a97a8bf1d9fc8d81540709c588e140c533d5f317d6a9109d538e38aa742d42bf00906f63d433811bc1c8526788dc3 -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
\ No newline at end of file diff --git a/ports/qt5declarative/CONTROL b/ports/qt5declarative/CONTROL index cd86bb413..93014a591 100644 --- a/ports/qt5declarative/CONTROL +++ b/ports/qt5declarative/CONTROL @@ -1,4 +1,4 @@ Source: qt5declarative Version: 5.9.2-0 Description: Qt5 Declarative (Quick 2) Module. Includes QtQuick, QtQuickParticles, QtQuickWidgets, QtQml, and QtPacketProtocol. -Build-Depends: qt5base
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base
\ No newline at end of file diff --git a/ports/qt5declarative/fixcmake.py b/ports/qt5declarative/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5declarative/fixcmake.py +++ /dev/null @@ -1,57 +0,0 @@ -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") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/", "/bin/") - builder += " else()" - builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") - builder += " endif()\n" - elif "_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 tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/", "/debug/bin/") - 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()
\ No newline at end of file diff --git a/ports/qt5declarative/portfile.cmake b/ports/qt5declarative/portfile.cmake index 29ff3e759..63ce79746 100644 --- a/ports/qt5declarative/portfile.cmake +++ b/ports/qt5declarative/portfile.cmake @@ -1,160 +1,5 @@ include(vcpkg_common_functions) -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() - -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qtdeclarative-5.9.2") -set(ARCHIVE_NAME "qtdeclarative-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 49b8b50932b73ea39da14ac3425044193dfd64eabceadba379aa01cf2fc141177f9870c387caf1cf93ce09e8b197828a54b8d9fcefc4d9cdf400a6c6dd9a9e90 -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright) - -#Fix incorrectly placed file(s) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/Qt5QmlDevToolsd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5QmlDevToolsd.lib)
\ No newline at end of file +qt_modular_library(qtdeclarative 49b8b50932b73ea39da14ac3425044193dfd64eabceadba379aa01cf2fc141177f9870c387caf1cf93ce09e8b197828a54b8d9fcefc4d9cdf400a6c6dd9a9e90) diff --git a/ports/qt5gamepad/CONTROL b/ports/qt5gamepad/CONTROL index 051deb634..5228aa006 100644 --- a/ports/qt5gamepad/CONTROL +++ b/ports/qt5gamepad/CONTROL @@ -1,4 +1,4 @@ Source: qt5gamepad Version: 5.9.2-0 Description: Qt5 Gamepad Module - Enables Qt applications to support the use of gamepad hardware -Build-Depends: qt5base
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base
\ No newline at end of file diff --git a/ports/qt5gamepad/fixcmake.py b/ports/qt5gamepad/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5gamepad/fixcmake.py +++ /dev/null @@ -1,57 +0,0 @@ -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") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/", "/bin/") - builder += " else()" - builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") - builder += " endif()\n" - elif "_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 tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/", "/debug/bin/") - 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()
\ No newline at end of file diff --git a/ports/qt5gamepad/portfile.cmake b/ports/qt5gamepad/portfile.cmake index 68ab01e6d..f4b81f4fd 100644 --- a/ports/qt5gamepad/portfile.cmake +++ b/ports/qt5gamepad/portfile.cmake @@ -1,157 +1,5 @@ include(vcpkg_common_functions) -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() - -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qtgamepad-5.9.2") -set(ARCHIVE_NAME "qtgamepad-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 398d6ff0268460358584a4ea8ba0588881970dcc1dff6c5aa91d1630065ba112c86d7a1fe96dceb8ff301b350aef7f74ad1ee6212048a4cdfb26ff5d944d6222 -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
\ No newline at end of file +qt_modular_library(qtgamepad 398d6ff0268460358584a4ea8ba0588881970dcc1dff6c5aa91d1630065ba112c86d7a1fe96dceb8ff301b350aef7f74ad1ee6212048a4cdfb26ff5d944d6222) diff --git a/ports/qt5imageformats/CONTROL b/ports/qt5imageformats/CONTROL index bcafa4558..995dc59fc 100644 --- a/ports/qt5imageformats/CONTROL +++ b/ports/qt5imageformats/CONTROL @@ -1,4 +1,4 @@ Source: qt5imageformats Version: 5.9.2-0 Description: Qt5 Image Formats Module - Plugins for additional image formats: TIFF, MNG, TGA, WBMP -Build-Depends: qt5base
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base
\ No newline at end of file diff --git a/ports/qt5imageformats/fixcmake.py b/ports/qt5imageformats/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5imageformats/fixcmake.py +++ /dev/null @@ -1,57 +0,0 @@ -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") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/", "/bin/") - builder += " else()" - builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") - builder += " endif()\n" - elif "_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 tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/", "/debug/bin/") - 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()
\ No newline at end of file diff --git a/ports/qt5imageformats/portfile.cmake b/ports/qt5imageformats/portfile.cmake index 612178ff8..ae3025b51 100644 --- a/ports/qt5imageformats/portfile.cmake +++ b/ports/qt5imageformats/portfile.cmake @@ -1,157 +1,7 @@ include(vcpkg_common_functions) -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() +qt_modular_library(qtimageformats 5f1b93c0e5fffa4c2c063d14c12ad97114a452b16814ca9ac45f00ec36308a09770b3b4d137cb5d19bd3aa3a6f576724084df5d0dad75236d49868af9243c9d2) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qtimageformats-5.9.2") -set(ARCHIVE_NAME "qtimageformats-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 5f1b93c0e5fffa4c2c063d14c12ad97114a452b16814ca9ac45f00ec36308a09770b3b4d137cb5d19bd3aa3a6f576724084df5d0dad75236d49868af9243c9d2 -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
\ No newline at end of file +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/ports/qt5modularscripts/CONTROL b/ports/qt5modularscripts/CONTROL new file mode 100644 index 000000000..88c0379af --- /dev/null +++ b/ports/qt5modularscripts/CONTROL @@ -0,0 +1,3 @@ +Source: qt5modularscripts +Version: 0 +Description: Vcpkg helpers to package qt5 modules diff --git a/ports/qt53d/fixcmake.py b/ports/qt5modularscripts/fixcmake.py index 923e600bc..923e600bc 100644 --- a/ports/qt53d/fixcmake.py +++ b/ports/qt5modularscripts/fixcmake.py diff --git a/ports/qt5modularscripts/portfile.cmake b/ports/qt5modularscripts/portfile.cmake new file mode 100644 index 000000000..e7149adfc --- /dev/null +++ b/ports/qt5modularscripts/portfile.cmake @@ -0,0 +1,9 @@ +file(COPY + ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + ${CMAKE_CURRENT_LIST_DIR}/qt_modular_library.cmake + DESTINATION + ${CURRENT_PACKAGES_DIR}/share/qt5modularscripts +) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/qt5modularscripts/copyright "") + +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/ports/qt5modularscripts/qt_modular_library.cmake b/ports/qt5modularscripts/qt_modular_library.cmake new file mode 100644 index 000000000..6fa4c20c8 --- /dev/null +++ b/ports/qt5modularscripts/qt_modular_library.cmake @@ -0,0 +1,174 @@ +set(_qt5base_port_dir "${CMAKE_CURRENT_LIST_DIR}")
+
+function(qt_modular_library NAME HASH)
+ string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH)
+ if(BUILDTREES_PATH_LENGTH GREATER 45)
+ message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n"
+ "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command."
+ )
+ endif()
+
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.")
+ endif()
+
+ set(SRCDIR_NAME "${NAME}-5.9.2")
+ set(ARCHIVE_NAME "${NAME}-opensource-src-5.9.2")
+ set(ARCHIVE_EXTENSION ".tar.xz")
+
+ set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME})
+ vcpkg_download_distfile(ARCHIVE_FILE
+ URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}"
+ FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION}
+ SHA512 ${HASH}
+ )
+ vcpkg_extract_source_archive(${ARCHIVE_FILE})
+ if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME})
+ file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME})
+ endif()
+
+ # This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings
+ set(ENV{_CL_} "/utf-8")
+
+ #Store build paths
+ set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
+ set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
+
+ file(REMOVE_RECURSE "${DEBUG_DIR}" "${RELEASE_DIR}")
+
+ #Find Python and add it to the path
+ vcpkg_find_acquire_program(PYTHON3)
+ get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY)
+ set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}")
+
+ #Configure debug
+ vcpkg_configure_qmake_debug(
+ SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}
+ )
+
+ #First generate the makefiles so we can modify them
+ vcpkg_build_qmake_debug(TARGETS qmake_all)
+
+ #Store debug makefiles path
+ file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*)
+
+ foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES})
+ file(READ "${DEBUG_MAKEFILE}" _contents)
+ string(REPLACE "zlib.lib" "zlibd.lib" _contents "${_contents}")
+ string(REPLACE "vcpkg\\installed\\${TARGET_TRIPLET}\\lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib" _contents "${_contents}")
+ file(WRITE "${DEBUG_MAKEFILE}" "${_contents}")
+ endforeach()
+
+ #Build debug
+ vcpkg_build_qmake_debug()
+
+ #Configure release
+ vcpkg_configure_qmake_release(
+ SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}
+ )
+
+ #First generate the makefiles so we can modify them
+ vcpkg_build_qmake_release(TARGETS qmake_all)
+
+ #Store release makefile path
+ file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*)
+
+ #Build release
+ vcpkg_build_qmake_release()
+
+ #Fix the cmake files if they exist
+ if(EXISTS ${RELEASE_DIR}/lib/cmake)
+ vcpkg_execute_required_process(
+ COMMAND ${PYTHON3} ${_qt5base_port_dir}/fixcmake.py
+ WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake
+ LOGNAME fix-cmake
+ )
+ endif()
+
+ file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR)
+ file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR)
+
+ string(SUBSTRING "${NATIVE_INSTALLED_DIR}" 2 -1 INSTALLED_DIR_WITHOUT_DRIVE)
+ string(SUBSTRING "${NATIVE_PACKAGES_DIR}" 2 -1 PACKAGES_DIR_WITHOUT_DRIVE)
+
+ #Set the correct install directory to packages
+ foreach(MAKEFILE ${RELEASE_MAKEFILES} ${DEBUG_MAKEFILES})
+ vcpkg_replace_string(${MAKEFILE} "(INSTALL_ROOT)${INSTALLED_DIR_WITHOUT_DRIVE}" "(INSTALL_ROOT)${PACKAGES_DIR_WITHOUT_DRIVE}")
+ endforeach()
+
+ #Install the module files
+ vcpkg_build_qmake_debug(TARGETS install)
+ vcpkg_build_qmake_release(TARGETS install)
+
+ #Remove extra cmake files
+ if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake)
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share)
+ file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake)
+ endif()
+ if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)
+ endif()
+
+ file(GLOB RELEASE_LIBS "${CURRENT_PACKAGES_DIR}/lib/*")
+ if(NOT RELEASE_LIBS)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib)
+ endif()
+ file(GLOB DEBUG_FILES "${CURRENT_PACKAGES_DIR}/debug/lib/*")
+ if(NOT DEBUG_FILES)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib)
+ endif()
+
+ #Move release and debug dlls to the correct directory
+ if(EXISTS ${CURRENT_PACKAGES_DIR}/tools/qt5)
+ file(RENAME ${CURRENT_PACKAGES_DIR}/tools/qt5 ${CURRENT_PACKAGES_DIR}/tools/${PORT})
+ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/tools/qt5 ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT})
+ endif()
+
+ file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/${PORT}/*.dll)
+ file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}/*.dll)
+ if (RELEASE_DLLS)
+ file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
+ file(REMOVE ${RELEASE_DLLS})
+ #Check if there are any binaries left over; if not - delete the directory
+ file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/${PORT}/*)
+ if(NOT RELEASE_BINS)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools)
+ endif()
+ endif()
+ if(DEBUG_DLLS)
+ file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
+ #file(REMOVE ${DEBUG_DLLS})
+ #Check if there are any binaries left over; if not - delete the directory
+ # file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*)
+ # if(NOT DEBUG_BINS)
+ # file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools)
+ # endif()
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools)
+ endif()
+
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/qt5/debug/include)
+
+ # file(GLOB DEBUG_LIBS "${CURRENT_PACKAGES_DIR}/debug/lib/*.lib")
+ # if(EXISTS ${CURRENT_PACKAGES_DIR}/bin)
+ # make_directory(${CURRENT_PACKAGES_DIR}/debug/bin)
+ # foreach(DEBUG_LIB ${DEBUG_LIBS})
+ # get_filename_component(DEBUG_STEM "${DEBUG_LIB}" NAME_WE)
+ # file(RENAME ${CURRENT_PACKAGES_DIR}/bin/${DEBUG_STEM}.dll ${CURRENT_PACKAGES_DIR}/debug/bin/${DEBUG_STEM}.dll)
+ # endforeach()
+ # endif()
+
+ vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
+
+ #Find the relevant license file and install it
+ if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3")
+ set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3")
+ elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3")
+ set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3")
+ elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3")
+ set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3")
+ elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3")
+ set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3")
+ endif()
+ file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
+
+endfunction()
\ No newline at end of file diff --git a/ports/qt5multimedia/CONTROL b/ports/qt5multimedia/CONTROL index 3a4d01030..b45f3f297 100644 --- a/ports/qt5multimedia/CONTROL +++ b/ports/qt5multimedia/CONTROL @@ -1,4 +1,4 @@ Source: qt5multimedia Version: 5.9.2-0 Description: Qt5 Multimedia Module - Classes and widgets for audio, video, radio and camera functionality -Build-Depends: qt5base
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base, qt5declarative diff --git a/ports/qt5multimedia/fixcmake.py b/ports/qt5multimedia/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5multimedia/fixcmake.py +++ /dev/null @@ -1,57 +0,0 @@ -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") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/", "/bin/") - builder += " else()" - builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") - builder += " endif()\n" - elif "_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 tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/", "/debug/bin/") - 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()
\ No newline at end of file diff --git a/ports/qt5multimedia/portfile.cmake b/ports/qt5multimedia/portfile.cmake index 5eb7c4ff1..878c2b150 100644 --- a/ports/qt5multimedia/portfile.cmake +++ b/ports/qt5multimedia/portfile.cmake @@ -1,157 +1,5 @@ include(vcpkg_common_functions) -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() - -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qtmultimedia-5.9.2") -set(ARCHIVE_NAME "qtmultimedia-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 b9fab874706440e97185475bfd0ad769c23d5ddbff5086cc0da9783777e81ed8140fb06fa0e7536ebfb67f2c9db39e1b9f3c2241834e74a9e1fb6ffd5cb7af11 -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
\ No newline at end of file +qt_modular_library(qtmultimedia b9fab874706440e97185475bfd0ad769c23d5ddbff5086cc0da9783777e81ed8140fb06fa0e7536ebfb67f2c9db39e1b9f3c2241834e74a9e1fb6ffd5cb7af11) diff --git a/ports/qt5scxml/CONTROL b/ports/qt5scxml/CONTROL index 974bce77c..4010ca304 100644 --- a/ports/qt5scxml/CONTROL +++ b/ports/qt5scxml/CONTROL @@ -1,4 +1,4 @@ Source: qt5scxml Version: 5.9.2-0 Description: Qt5 SCXML Module - Provides classes and tools for creating state machines from SCXML files and embedding them in applications -Build-Depends: qt5base
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base, qt5declarative diff --git a/ports/qt5scxml/fixcmake.py b/ports/qt5scxml/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5scxml/fixcmake.py +++ /dev/null @@ -1,57 +0,0 @@ -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") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/", "/bin/") - builder += " else()" - builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") - builder += " endif()\n" - elif "_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 tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/", "/debug/bin/") - 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()
\ No newline at end of file diff --git a/ports/qt5scxml/portfile.cmake b/ports/qt5scxml/portfile.cmake index 03de826cf..b0827216e 100644 --- a/ports/qt5scxml/portfile.cmake +++ b/ports/qt5scxml/portfile.cmake @@ -1,157 +1,5 @@ include(vcpkg_common_functions) -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() - -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qtscxml-5.9.2") -set(ARCHIVE_NAME "qtscxml-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 c33db992ab456e5dd8b9be65c5619c503048106bbb1839b0930f2d4df36eed0780dfa1fc2912d7758aa72195269e59cbe8826cbaa414c2f339ca66c565809c88 -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
\ No newline at end of file +qt_modular_library(qtscxml c33db992ab456e5dd8b9be65c5619c503048106bbb1839b0930f2d4df36eed0780dfa1fc2912d7758aa72195269e59cbe8826cbaa414c2f339ca66c565809c88) diff --git a/ports/qt5serial/CONTROL b/ports/qt5serial/CONTROL index 386fc8e6c..7782e6a53 100644 --- a/ports/qt5serial/CONTROL +++ b/ports/qt5serial/CONTROL @@ -1,4 +1,4 @@ Source: qt5serial Version: 5.9.2-0 Description: Qt5 Serial Port - provides access to hardware and virtual serial ports -Build-Depends: qt5base
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base
\ No newline at end of file diff --git a/ports/qt5serial/fixcmake.py b/ports/qt5serial/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5serial/fixcmake.py +++ /dev/null @@ -1,57 +0,0 @@ -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") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/", "/bin/") - builder += " else()" - builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") - builder += " endif()\n" - elif "_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 tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/", "/debug/bin/") - 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()
\ No newline at end of file diff --git a/ports/qt5serial/portfile.cmake b/ports/qt5serial/portfile.cmake index 1d47b5d0a..f4a42f38f 100644 --- a/ports/qt5serial/portfile.cmake +++ b/ports/qt5serial/portfile.cmake @@ -1,157 +1,5 @@ include(vcpkg_common_functions) -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() - -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qtserial-5.9.2") -set(ARCHIVE_NAME "qtserialport-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 cc8899c1ae2ed9fd8cf1c213ab7efaec12b3b16836006fdbf74cb7ea457705505a13e82c2f2873ee9426ae66473ec42259f4e728de64576ee44420f116cc433d -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
\ No newline at end of file +qt_modular_library(qtserialport cc8899c1ae2ed9fd8cf1c213ab7efaec12b3b16836006fdbf74cb7ea457705505a13e82c2f2873ee9426ae66473ec42259f4e728de64576ee44420f116cc433d) diff --git a/ports/qt5speech/CONTROL b/ports/qt5speech/CONTROL index 0013556d7..f175d13e7 100644 --- a/ports/qt5speech/CONTROL +++ b/ports/qt5speech/CONTROL @@ -1,4 +1,4 @@ Source: qt5speech Version: 5.9.2-0 Description: Qt5 Speech Module -Build-Depends: qt5base, atlmfc
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base, atlmfc
\ No newline at end of file diff --git a/ports/qt5speech/fixcmake.py b/ports/qt5speech/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5speech/fixcmake.py +++ /dev/null @@ -1,57 +0,0 @@ -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") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/", "/bin/") - builder += " else()" - builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") - builder += " endif()\n" - elif "_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 tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/", "/debug/bin/") - 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()
\ No newline at end of file diff --git a/ports/qt5speech/portfile.cmake b/ports/qt5speech/portfile.cmake index fa80da81d..8a271b289 100644 --- a/ports/qt5speech/portfile.cmake +++ b/ports/qt5speech/portfile.cmake @@ -1,157 +1,5 @@ include(vcpkg_common_functions) -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() - -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qtspeech-5.9.2") -set(ARCHIVE_NAME "qtspeech-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 8213ad13d33732fee3fc5b5e408b870970a3003d461be24195222e1d1209210039d1d0cd2f3c537a0db62629fb297d88b33ed4734ecb6c8d74f5406a87e7e0c0 -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
\ No newline at end of file +qt_modular_library(qtspeech 8213ad13d33732fee3fc5b5e408b870970a3003d461be24195222e1d1209210039d1d0cd2f3c537a0db62629fb297d88b33ed4734ecb6c8d74f5406a87e7e0c0) diff --git a/ports/qt5svg/CONTROL b/ports/qt5svg/CONTROL index f56df4b51..c52ca485c 100644 --- a/ports/qt5svg/CONTROL +++ b/ports/qt5svg/CONTROL @@ -1,4 +1,4 @@ Source: qt5svg Version: 5.9.2-0 Description: Qt5 SVG Module - provides classes for displaying the contents of SVG files -Build-Depends: qt5base
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base
\ No newline at end of file diff --git a/ports/qt5svg/fixcmake.py b/ports/qt5svg/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5svg/fixcmake.py +++ /dev/null @@ -1,57 +0,0 @@ -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") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/", "/bin/") - builder += " else()" - builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") - builder += " endif()\n" - elif "_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 tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/", "/debug/bin/") - 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()
\ No newline at end of file diff --git a/ports/qt5svg/portfile.cmake b/ports/qt5svg/portfile.cmake index 2b838714e..83283d376 100644 --- a/ports/qt5svg/portfile.cmake +++ b/ports/qt5svg/portfile.cmake @@ -1,157 +1,5 @@ include(vcpkg_common_functions) -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() - -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qtsvg-5.9.2") -set(ARCHIVE_NAME "qtsvg-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 c21c5a12fa10ff9f91deda88c99c995ee2138bdffa21c793b0c42f25155f01f87ede5206624b9d82713649f8cf1cfdb95f1d5b7e792de62f3848d3a9ec665fdd -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
\ No newline at end of file +qt_modular_library(qtsvg c21c5a12fa10ff9f91deda88c99c995ee2138bdffa21c793b0c42f25155f01f87ede5206624b9d82713649f8cf1cfdb95f1d5b7e792de62f3848d3a9ec665fdd) diff --git a/ports/qt5tools/CONTROL b/ports/qt5tools/CONTROL index 702d4d68e..4050ac097 100644 --- a/ports/qt5tools/CONTROL +++ b/ports/qt5tools/CONTROL @@ -1,4 +1,4 @@ Source: qt5tools Version: 5.9.2-0 Description: Qt5 Tools Module; Includes deployment tools and helpers, Qt Designer, Assistant, and other applications -Build-Depends: qt5base, qt5declarative
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base, qt5declarative
\ No newline at end of file diff --git a/ports/qt5tools/fixcmake.py b/ports/qt5tools/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5tools/fixcmake.py +++ /dev/null @@ -1,57 +0,0 @@ -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") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/", "/bin/") - builder += " else()" - builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") - builder += " endif()\n" - elif "_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 tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/", "/debug/bin/") - 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()
\ No newline at end of file diff --git a/ports/qt5tools/portfile.cmake b/ports/qt5tools/portfile.cmake index 2dcd4a3c3..10eefa959 100644 --- a/ports/qt5tools/portfile.cmake +++ b/ports/qt5tools/portfile.cmake @@ -1,157 +1,5 @@ include(vcpkg_common_functions) -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() - -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qttools-5.9.2") -set(ARCHIVE_NAME "qttools-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 afce063e167de96dfa264cfd27dc8d80c23ef091a30f4f8119575cae83f39716c3b332427630b340f518b82d6396cca1893f28e00f3c667ba201d7e4fc2aefe1 -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
\ No newline at end of file +qt_modular_library(qttools afce063e167de96dfa264cfd27dc8d80c23ef091a30f4f8119575cae83f39716c3b332427630b340f518b82d6396cca1893f28e00f3c667ba201d7e4fc2aefe1) diff --git a/ports/qt5virtualkeyboard/CONTROL b/ports/qt5virtualkeyboard/CONTROL index 7f5649f31..041e2cdd9 100644 --- a/ports/qt5virtualkeyboard/CONTROL +++ b/ports/qt5virtualkeyboard/CONTROL @@ -1,4 +1,4 @@ Source: qt5virtualkeyboard Version: 5.9.2-0 Description: Qt5 Virtual Keyboard Module - A framework for implementing different input methods. Supports localized keyboard layouts and custom visual themes -Build-Depends: qt5base
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base
\ No newline at end of file diff --git a/ports/qt5virtualkeyboard/fixcmake.py b/ports/qt5virtualkeyboard/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5virtualkeyboard/fixcmake.py +++ /dev/null @@ -1,57 +0,0 @@ -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") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/", "/bin/") - builder += " else()" - builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") - builder += " endif()\n" - elif "_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 tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/", "/debug/bin/") - 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()
\ No newline at end of file diff --git a/ports/qt5virtualkeyboard/portfile.cmake b/ports/qt5virtualkeyboard/portfile.cmake index a2f0b1999..cceed3894 100644 --- a/ports/qt5virtualkeyboard/portfile.cmake +++ b/ports/qt5virtualkeyboard/portfile.cmake @@ -1,157 +1,7 @@ include(vcpkg_common_functions) -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() +qt_modular_library(qtvirtualkeyboard f8c39b789e877e60389ee9aab4a5c17e6018093f72fc57f526ce2584183135206306d4d5a7c7551a6de45969aa6f55444bb39f4ea3324cdf10611533f0bc2b22) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qtvirtualkeyboard-5.9.2") -set(ARCHIVE_NAME "qtvirtualkeyboard-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 f8c39b789e877e60389ee9aab4a5c17e6018093f72fc57f526ce2584183135206306d4d5a7c7551a6de45969aa6f55444bb39f4ea3324cdf10611533f0bc2b22 -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
\ No newline at end of file +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) diff --git a/ports/qt5websockets/CONTROL b/ports/qt5websockets/CONTROL index 51497f6ec..2ab49879b 100644 --- a/ports/qt5websockets/CONTROL +++ b/ports/qt5websockets/CONTROL @@ -1,4 +1,4 @@ Source: qt5websockets Version: 5.9.2-0 Description: Qt5 Web Sockets Module - provides WebSocket communication compliant with RFC 6455 -Build-Depends: qt5base
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base
\ No newline at end of file diff --git a/ports/qt5websockets/fixcmake.py b/ports/qt5websockets/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5websockets/fixcmake.py +++ /dev/null @@ -1,57 +0,0 @@ -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") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/", "/bin/") - builder += " else()" - builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") - builder += " endif()\n" - elif "_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 tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/", "/debug/bin/") - 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()
\ No newline at end of file diff --git a/ports/qt5websockets/portfile.cmake b/ports/qt5websockets/portfile.cmake index 64f9bf374..98442f4c0 100644 --- a/ports/qt5websockets/portfile.cmake +++ b/ports/qt5websockets/portfile.cmake @@ -1,157 +1,5 @@ include(vcpkg_common_functions) -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() - -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qtwebsockets-5.9.2") -set(ARCHIVE_NAME "qtwebsockets-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 9330d6806251bc77d4c2a497a31b1b0e42a1e6bfe3ea7c00cee123052e9e1f9080e33cf4dfcd6ee6e4732c62f41257a77ec25ad607528f4e8ebe61ccaee3e159 -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
\ No newline at end of file +qt_modular_library(qtwebsockets 9330d6806251bc77d4c2a497a31b1b0e42a1e6bfe3ea7c00cee123052e9e1f9080e33cf4dfcd6ee6e4732c62f41257a77ec25ad607528f4e8ebe61ccaee3e159) diff --git a/ports/qt5winextras/CONTROL b/ports/qt5winextras/CONTROL index 1c212d9b5..451118c5a 100644 --- a/ports/qt5winextras/CONTROL +++ b/ports/qt5winextras/CONTROL @@ -1,4 +1,4 @@ Source: qt5winextras Version: 5.9.2-0 Description: Qt5 Windows Extras Module. Provides platform-specific APIs for Windows. -Build-Depends: qt5base, atlmfc
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base, atlmfc
\ No newline at end of file diff --git a/ports/qt5winextras/fixcmake.py b/ports/qt5winextras/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5winextras/fixcmake.py +++ /dev/null @@ -1,57 +0,0 @@ -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") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/", "/bin/") - builder += " else()" - builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") - builder += " endif()\n" - elif "_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 tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/", "/debug/bin/") - 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()
\ No newline at end of file diff --git a/ports/qt5winextras/portfile.cmake b/ports/qt5winextras/portfile.cmake index 04b55327f..692683adf 100644 --- a/ports/qt5winextras/portfile.cmake +++ b/ports/qt5winextras/portfile.cmake @@ -1,157 +1,5 @@ include(vcpkg_common_functions) -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() - -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qtwinextras-5.9.2") -set(ARCHIVE_NAME "qtwinextras-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 dbfb89833cc291fade8e9fe2ad9c7b7a78c2032de8dcbca1049d637f829811b99e1852ae39ca73a6eac2960df168765bee28023bb723e69c87e2f3bb50b7ef02 -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
\ No newline at end of file +qt_modular_library(qtwinextras dbfb89833cc291fade8e9fe2ad9c7b7a78c2032de8dcbca1049d637f829811b99e1852ae39ca73a6eac2960df168765bee28023bb723e69c87e2f3bb50b7ef02) diff --git a/ports/qt5xmlpatterns/CONTROL b/ports/qt5xmlpatterns/CONTROL index baef1b3fd..03bd2938e 100644 --- a/ports/qt5xmlpatterns/CONTROL +++ b/ports/qt5xmlpatterns/CONTROL @@ -1,4 +1,4 @@ Source: qt5xmlpatterns Version: 5.9.2-0 Description: Qt5 XML Patterns Module - Support for XPath, XQuery, XSLT and XML schema validation -Build-Depends: qt5base
\ No newline at end of file +Build-Depends: qt5modularscripts, qt5base
\ No newline at end of file diff --git a/ports/qt5xmlpatterns/fixcmake.py b/ports/qt5xmlpatterns/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5xmlpatterns/fixcmake.py +++ /dev/null @@ -1,57 +0,0 @@ -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") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/Qt5.*d.dll") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/", "/bin/") - builder += " else()" - builder += "\n " + line.replace("/tools/qt5/", "/debug/bin/") - builder += " endif()\n" - elif "_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 tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/", "/debug/bin/") - 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()
\ No newline at end of file diff --git a/ports/qt5xmlpatterns/portfile.cmake b/ports/qt5xmlpatterns/portfile.cmake index 764628c5e..6fbc69538 100644 --- a/ports/qt5xmlpatterns/portfile.cmake +++ b/ports/qt5xmlpatterns/portfile.cmake @@ -1,157 +1,5 @@ include(vcpkg_common_functions) -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 37) - message(WARNING "Qt5's buildsystem uses very long paths and may fail on your system.\n" - "We recommend moving vcpkg to a short path such as 'C:\\src\\vcpkg' or using the subst command." - ) -endif() +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Qt5 doesn't currently support static builds. Please use a dynamic triplet instead.") -endif() - -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) - -set(SRCDIR_NAME "qtxmlpatterns-5.9.2") -set(ARCHIVE_NAME "qtxmlpatterns-opensource-src-5.9.2") -set(ARCHIVE_EXTENSION ".tar.xz") - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/${ARCHIVE_NAME}${ARCHIVE_EXTENSION}" - FILENAME ${SRCDIR_NAME}${ARCHIVE_EXTENSION} - SHA512 c14dbd97988473ba73b4e21352c5560278aa4dbfdf2be1d12e9119c0b5dbe8a0e4eff9a682052024a01bb21dcf52d40ba00da98947901fb91518af92a225da83 -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME}) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/${ARCHIVE_NAME} ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME}) -endif() - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -#Store build paths -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - -#Find Python and add it to the path -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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_debug(TARGETS sub-src-qmake_all) - -#Store debug makefiles path -file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) - -#Fix path to Qt5QmlDevTools -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "vcpkg\\installed\\${TARGET_TRIPLET}\\lib\\Qt5QmlDevToolsd.lib" "vcpkg\\installed\\${TARGET_TRIPLET}\\debug\\lib\\Qt5QmlDevToolsd.lib") -endforeach() - -#Build debug -vcpkg_build_qmake_debug() - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -#First generate the makefiles so we can modify them -vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) - -#Store release makefile path -file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) - -#Build release -vcpkg_build_qmake_release() - -#Fix the cmake files if they exist -if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) -endif() - -#Set the correct install directory to packages -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - vcpkg_replace_string(${RELEASE_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() -foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) - vcpkg_replace_string(${DEBUG_MAKEFILE} "(INSTALL_ROOT)\\vcpkg\\installed\\${TARGET_TRIPLET}" "(INSTALL_ROOT)\\vcpkg\\packages\\${PORT}_${TARGET_TRIPLET}") -endforeach() - -#Install the module files -vcpkg_build_qmake_debug(TARGETS install) -vcpkg_build_qmake_release(TARGETS install) - -#Reset the path to the baseline -set(ENV{PATH} "${_path}") - -#Remove extra cmake files -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB RELEASE_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT RELEASE_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib) - endif() -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - #Check if there are any libs left over; if not - delete the directory - file(GLOB DEBUG_LIBS ${CURRENT_PACKAGES_DIR}/lib/*) - if(NOT DEBUG_LIBS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib) - endif() -endif() - -#Move release and debug dlls to the correct directory -file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/tools/qt5/*.dll) -file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*.dll) -if (RELEASE_DLLS) - file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE ${RELEASE_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB RELEASE_BINS ${CURRENT_PACKAGES_DIR}/tools/qt5/*) - if(NOT RELEASE_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/tools) - endif() -endif() -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${DEBUG_DLLS}) - #Check if there are any binaries left over; if not - delete the directory - file(GLOB DEBUG_BINS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5/*) - if(NOT DEBUG_BINS) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() -endif() - -#If there are no include files in the module - create an empty one to stop vcpkg from complaining -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include) - file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_${PORT} "") -endif() - -#Find the relevant license file and install it -if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3") -elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3") - set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3") -endif() -file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}/ RENAME copyright)
\ No newline at end of file +qt_modular_library(qtxmlpatterns c14dbd97988473ba73b4e21352c5560278aa4dbfdf2be1d12e9119c0b5dbe8a0e4eff9a682052024a01bb21dcf52d40ba00da98947901fb91518af92a225da83) diff --git a/scripts/cmake/vcpkg_configure_qmake_debug.cmake b/scripts/cmake/vcpkg_configure_qmake_debug.cmake index e3dfb0777..3eeb42cb3 100644 --- a/scripts/cmake/vcpkg_configure_qmake_debug.cmake +++ b/scripts/cmake/vcpkg_configure_qmake_debug.cmake @@ -21,7 +21,7 @@ function(vcpkg_configure_qmake_debug) cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) # Find qmake exectuable - find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/debug/tools/qt5) + find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/tools/qt5) if(NOT QMAKE_COMMAND) message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") @@ -30,10 +30,12 @@ function(vcpkg_configure_qmake_debug) # Cleanup build directories file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_debug.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) vcpkg_execute_required_process( - COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} + COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME config-${TARGET_TRIPLET}-dbg ) diff --git a/scripts/cmake/vcpkg_configure_qmake_release.cmake b/scripts/cmake/vcpkg_configure_qmake_release.cmake index cf9eacbd5..60750060b 100644 --- a/scripts/cmake/vcpkg_configure_qmake_release.cmake +++ b/scripts/cmake/vcpkg_configure_qmake_release.cmake @@ -22,6 +22,7 @@ function(vcpkg_configure_qmake_release) # Find qmake exectuable find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/tools/qt5) + if(NOT QMAKE_COMMAND) message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") endif() @@ -29,10 +30,12 @@ function(vcpkg_configure_qmake_release) # Cleanup build directories file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_release.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) vcpkg_execute_required_process( - COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} + COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME config-${TARGET_TRIPLET}-rel ) |
