From 2a94ee4c62ad8b3468ae10fa5c0f02dc92e0c1be Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Sun, 15 Oct 2017 22:22:17 +1100 Subject: qt5 base --- ports/qt5base/CONTROL | 4 ++ ports/qt5base/configure_qt.cmake | 63 ++++++++++++++++++++ ports/qt5base/fix-system-pcre2.patch | 18 ++++++ ports/qt5base/fixcmake.py | 48 +++++++++++++++ ports/qt5base/install_qt.cmake | 45 +++++++++++++++ ports/qt5base/portfile.cmake | 109 +++++++++++++++++++++++++++++++++++ 6 files changed, 287 insertions(+) create mode 100644 ports/qt5base/CONTROL create mode 100644 ports/qt5base/configure_qt.cmake create mode 100644 ports/qt5base/fix-system-pcre2.patch create mode 100644 ports/qt5base/fixcmake.py create mode 100644 ports/qt5base/install_qt.cmake create mode 100644 ports/qt5base/portfile.cmake diff --git a/ports/qt5base/CONTROL b/ports/qt5base/CONTROL new file mode 100644 index 000000000..0b9e4792a --- /dev/null +++ b/ports/qt5base/CONTROL @@ -0,0 +1,4 @@ +Source: qt5base +Version: 5.9.2-0 +Description: Qt5 application framework base components. Webengine, examples and tests not included. +Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion diff --git a/ports/qt5base/configure_qt.cmake b/ports/qt5base/configure_qt.cmake new file mode 100644 index 000000000..fea8de923 --- /dev/null +++ b/ports/qt5base/configure_qt.cmake @@ -0,0 +1,63 @@ +function(configure_qt) + cmake_parse_arguments(_csc "" "SOURCE_PATH;PLATFORM" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) + + if (_csc_PLATFORM) + set(PLATFORM ${_csc_PLATFORM}) + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v140") + set(PLATFORM "win32-msvc2015") + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(PLATFORM "win32-msvc2017") + endif() + + vcpkg_find_acquire_program(PERL) + get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) + + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}") + + if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) + list(APPEND _csc_OPTIONS + "-static" + "-static-runtime" + ) + endif() + + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + vcpkg_execute_required_process( + COMMAND "${_csc_SOURCE_PATH}/configure.bat" ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} + -debug + -prefix ${CURRENT_PACKAGES_DIR}/debug + -hostbindir ${CURRENT_PACKAGES_DIR}/debug/tools/qt5 + -archdatadir ${CURRENT_PACKAGES_DIR}/debug/share/qt5 + -datadir ${CURRENT_PACKAGES_DIR}/debug/share/qt5 + -plugindir ${CURRENT_PACKAGES_DIR}/debug/plugins + -qmldir ${CURRENT_PACKAGES_DIR}/debug/qml + -I ${CURRENT_INSTALLED_DIR}/include + -L ${CURRENT_INSTALLED_DIR}/debug/lib + -platform ${PLATFORM} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + vcpkg_execute_required_process( + COMMAND "${_csc_SOURCE_PATH}/configure.bat" ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} + -release + -prefix ${CURRENT_PACKAGES_DIR} + -hostbindir ${CURRENT_PACKAGES_DIR}/tools/qt5 + -archdatadir ${CURRENT_PACKAGES_DIR}/share/qt5 + -datadir ${CURRENT_PACKAGES_DIR}/share/qt5 + -plugindir ${CURRENT_PACKAGES_DIR}/plugins + -qmldir ${CURRENT_PACKAGES_DIR}/qml + -I ${CURRENT_INSTALLED_DIR}/include + -L ${CURRENT_INSTALLED_DIR}/lib + -platform ${PLATFORM} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME config-${TARGET_TRIPLET}-rel + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + +endfunction() \ No newline at end of file diff --git a/ports/qt5base/fix-system-pcre2.patch b/ports/qt5base/fix-system-pcre2.patch new file mode 100644 index 000000000..be401d448 --- /dev/null +++ b/ports/qt5base/fix-system-pcre2.patch @@ -0,0 +1,18 @@ +diff --git a/src/corelib/configure.json b/src/corelib/configure.json +index a5b69a2..01c5cde 100644 +--- a/src/corelib/configure.json ++++ b/src/corelib/configure.json +@@ -159,7 +159,12 @@ + ] + }, + "sources": [ +- "-lpcre2-16" ++ { ++ "builds": { ++ "debug": "-lpcre2-16d", ++ "release": "-lpcre2-16" ++ } ++ } + ] + }, + "pps": { diff --git a/ports/qt5base/fixcmake.py b/ports/qt5base/fixcmake.py new file mode 100644 index 000000000..d55ca7754 --- /dev/null +++ b/ports/qt5base/fixcmake.py @@ -0,0 +1,48 @@ +import os +import re +from glob import glob + +files = [y for x in os.walk('.') for y in glob(os.path.join(x[0], '*.cmake'))] + +for f in files: + openedfile = open(f, "r") + builder = "" + dllpattern = re.compile("_install_prefix}/bin/Qt5.*d.dll") + libpattern = re.compile("_install_prefix}/lib/Qt5.*d.lib") + exepattern = re.compile("_install_prefix}/bin/[a-z]+.exe") + for line in openedfile: + if "_install_prefix}/bin/${LIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/bin/", "/debug/bin/") + builder += " endif()\n" + elif "_install_prefix}/lib/${LIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/lib/", "/debug/lib/") + builder += " endif()\n" + elif "_install_prefix}/lib/${IMPLIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/lib/", "/debug/lib/") + builder += " endif()\n" + elif "_install_prefix}/plugins/${PLUGIN_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/plugins/", "/debug/plugins/") + builder += " endif()\n" + elif dllpattern.search(line) != None: + builder += line.replace("/bin/", "/debug/bin/") + elif libpattern.search(line) != None: + builder += line.replace("/lib/", "/debug/lib/") + elif exepattern.search(line) != None: + builder += line.replace("/bin/", "/tools/qt5/") + else: + builder += line + new_file = open(f, "w") + new_file.write(builder) + new_file.close() \ No newline at end of file diff --git a/ports/qt5base/install_qt.cmake b/ports/qt5base/install_qt.cmake new file mode 100644 index 000000000..1b0bec935 --- /dev/null +++ b/ports/qt5base/install_qt.cmake @@ -0,0 +1,45 @@ +function(install_qt) + cmake_parse_arguments(_bc "DISABLE_PARALLEL" "" "" ${ARGN}) + + if (_bc_DISABLE_PARALLEL) + set(JOBS "1") + else() + set(JOBS "$ENV{NUMBER_OF_PROCESSORS}") + endif() + + vcpkg_find_acquire_program(JOM) + vcpkg_find_acquire_program(PYTHON3) + get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) + + set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") + set(_path "$ENV{PATH}") + + message(STATUS "Package ${TARGET_TRIPLET}-rel") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/bin;${_path}") + vcpkg_execute_required_process( + COMMAND ${JOM} /J ${JOBS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME build-${TARGET_TRIPLET}-rel + ) + vcpkg_execute_required_process( + COMMAND ${JOM} /J ${JOBS} install + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME package-${TARGET_TRIPLET}-rel + ) + message(STATUS "Package ${TARGET_TRIPLET}-rel done") + + message(STATUS "Package ${TARGET_TRIPLET}-dbg") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/bin;${_path}") + vcpkg_execute_required_process( + COMMAND ${JOM} /J ${JOBS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME build-${TARGET_TRIPLET}-dbg + ) + vcpkg_execute_required_process( + COMMAND ${JOM} /J ${JOBS} install + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME package-${TARGET_TRIPLET}-dbg + ) + set(ENV{PATH} "${_path}") + message(STATUS "Package ${TARGET_TRIPLET}-dbg done") +endfunction() \ No newline at end of file diff --git a/ports/qt5base/portfile.cmake b/ports/qt5base/portfile.cmake new file mode 100644 index 000000000..9e2efeac7 --- /dev/null +++ b/ports/qt5base/portfile.cmake @@ -0,0 +1,109 @@ +include(vcpkg_common_functions) + +string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) +if(BUILDTREES_PATH_LENGTH GREATER 27) + 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}) +include(configure_qt) +include(install_qt) + +set(SRCDIR_NAME "qt-5.9.2") +set(ARCHIVE_NAME "qtbase-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 a2f965871645256f3d019f71f3febb875455a29d03fccc7a3371ddfeb193b0af12394e779df05adf69fd10fe7b0d966f3915a24528ec7eb3bc36c2db6af2b6e7 +) +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() + +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-system-pcre2.patch" +) + +# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings +set(ENV{_CL_} "/utf-8") + +configure_qt( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -confirm-license + -opensource + -system-zlib + -system-libjpeg + -system-libpng + -system-freetype + -system-pcre + -system-harfbuzz + -system-doubleconversion + -system-sqlite + -sql-sqlite + -sql-psql + -feature-freetype + -nomake examples -nomake tests + -opengl desktop # other options are "-no-opengl" and "-opengl angle" + -mp + LIBJPEG_LIBS="-ljpeg" + OPTIONS_RELEASE + ZLIB_LIBS="-lzlib" + LIBPNG_LIBS="-llibpng16" + OPTIONS_DEBUG + ZLIB_LIBS="-lzlibd" + LIBPNG_LIBS="-llibpng16d" + PSQL_LIBS="-llibpqd" + FREETYPE_LIBS="-lfreetyped" +) + +install_qt() + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +file(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(REMOVE ${BINARY_TOOLS}) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/cmake + LOGNAME fix-cmake +) + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + +#--------------------------------------------------------------------------- +# Qt5Bootstrap: a release-only dependency +#--------------------------------------------------------------------------- +# Remove release-only Qt5Bootstrap.lib from debug folders: +#file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.lib) +#file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.prl) +# Above approach does not work: +# check_matching_debug_and_release_binaries(dbg_libs, rel_libs) +# requires the two sets to be of equal size! +# Alt. approach, create dummy folder instead: +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/dont-use) +file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/dont-use) +file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.prl DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/dont-use) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.lib) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.prl) +#--------------------------------------------------------------------------- + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5base RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From 459ac9f2e17340e10e3cb8a66f956c59541d5fdd Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 16 Oct 2017 00:40:25 +1100 Subject: qt5tools package --- ports/qt5base/portfile.cmake | 2 +- ports/qt5tools/CONTROL | 4 +++ ports/qt5tools/portfile.cmake | 51 +++++++++++++++++++++++++++++++++++ scripts/cmake/vcpkg_build_qmake.cmake | 11 ++++---- 4 files changed, 61 insertions(+), 7 deletions(-) create mode 100644 ports/qt5tools/CONTROL create mode 100644 ports/qt5tools/portfile.cmake diff --git a/ports/qt5base/portfile.cmake b/ports/qt5base/portfile.cmake index 9e2efeac7..359c81990 100644 --- a/ports/qt5base/portfile.cmake +++ b/ports/qt5base/portfile.cmake @@ -15,7 +15,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) include(configure_qt) include(install_qt) -set(SRCDIR_NAME "qt-5.9.2") +set(SRCDIR_NAME "qtbase-5.9.2") set(ARCHIVE_NAME "qtbase-opensource-src-5.9.2") set(ARCHIVE_EXTENSION ".tar.xz") diff --git a/ports/qt5tools/CONTROL b/ports/qt5tools/CONTROL new file mode 100644 index 000000000..7bdb5c1db --- /dev/null +++ b/ports/qt5tools/CONTROL @@ -0,0 +1,4 @@ +Source: qt5tools +Version: 5.9.2-0 +Description: Qt5 tools +Build-Depends: qt5base diff --git a/ports/qt5tools/portfile.cmake b/ports/qt5tools/portfile.cmake new file mode 100644 index 000000000..6d01d6333 --- /dev/null +++ b/ports/qt5tools/portfile.cmake @@ -0,0 +1,51 @@ +include(vcpkg_common_functions) + +string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) +if(BUILDTREES_PATH_LENGTH GREATER 27) + 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 "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") + +#Clean up build directories +file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + +vcpkg_configure_qmake( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} + OPTIONS "CONFIG+=release" +) + +vcpkg_build_qmake() + +file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/bin/*.exe") +file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) +file(REMOVE ${BINARY_TOOLS}) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5tools RENAME copyright) + +#touch an empty include file - qt tools does not create any and this is an error in vcpkg +file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty) \ No newline at end of file diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index 1c6358654..bee5da7c9 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -15,18 +15,17 @@ function(vcpkg_build_qmake) vcpkg_find_acquire_program(JOM) # Make sure that the linker finds the libraries used - set(ENV_LIB_BACKUP ENV{LIB}) - set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/debug/lib;$ENV{LIB}") + set(ENV_PATH_BACKUP ENV{PATH}) + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;$ENV{PATH}") message(STATUS "Package ${TARGET_TRIPLET}") - vcpkg_execute_required_process_repeat( - COUNT 2 + vcpkg_execute_required_process( COMMAND ${JOM} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} LOGNAME package-${TARGET_TRIPLET} ) message(STATUS "Package ${TARGET_TRIPLET} done") - # Restore the original value of ENV{LIB} - set(ENV{LIB} ENV_LIB_BACKUP) + # Restore the original value of ENV{PATH} + set(ENV{PATH} ENV_PATH_BACKUP) endfunction() -- cgit v1.2.3 From 890a81bebc3642454e3833c789a35ba9a7989c9d Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 16 Oct 2017 00:41:48 +1100 Subject: remove old qt5 --- ports/qt5/CONTROL | 4 - ports/qt5/add-private-header-paths.patch | 801 ------------------------------ ports/qt5/configure_qt.cmake | 62 --- ports/qt5/fix-commandline-overrides.patch | 149 ------ ports/qt5/fix-qalgorithms-vs2017.patch | 138 ----- ports/qt5/fixcmake.py | 63 --- ports/qt5/install_qt.cmake | 45 -- ports/qt5/portfile.cmake | 147 ------ ports/qt5/qtdeploy.ps1 | 68 --- 9 files changed, 1477 deletions(-) delete mode 100644 ports/qt5/CONTROL delete mode 100644 ports/qt5/add-private-header-paths.patch delete mode 100644 ports/qt5/configure_qt.cmake delete mode 100644 ports/qt5/fix-commandline-overrides.patch delete mode 100644 ports/qt5/fix-qalgorithms-vs2017.patch delete mode 100644 ports/qt5/fixcmake.py delete mode 100644 ports/qt5/install_qt.cmake delete mode 100644 ports/qt5/portfile.cmake delete mode 100644 ports/qt5/qtdeploy.ps1 diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL deleted file mode 100644 index ce46d249b..000000000 --- a/ports/qt5/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5 -Version: 5.8-6 -Description: Qt5 application framework main components. Webengine, examples and tests not included. -Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre, harfbuzz, sqlite3, libpq, double-conversion diff --git a/ports/qt5/add-private-header-paths.patch b/ports/qt5/add-private-header-paths.patch deleted file mode 100644 index c6e233710..000000000 --- a/ports/qt5/add-private-header-paths.patch +++ /dev/null @@ -1,801 +0,0 @@ -diff --git a/Qt53DCore/Qt53DCoreConfig.cmake b/Qt53DCore/Qt53DCoreConfig.cmake -index 80fc091..4fbaf5e 100644 ---- a/Qt53DCore/Qt53DCoreConfig.cmake -+++ b/Qt53DCore/Qt53DCoreConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::3DCore) - - set(_Qt53DCore_OWN_INCLUDE_DIRS "${_qt53DCore_install_prefix}/include/" "${_qt53DCore_install_prefix}/include/Qt3DCore") -- set(Qt53DCore_PRIVATE_INCLUDE_DIRS "") -+ set(Qt53DCore_PRIVATE_INCLUDE_DIRS -+ "${_qt53DCore_install_prefix}/include/Qt3DCore/5.8.0" -+ "${_qt53DCore_install_prefix}/include/Qt3DCore/5.8.0/Qt3DCore" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt53DCore_OWN_INCLUDE_DIRS}) -diff --git a/Qt53DExtras/Qt53DExtrasConfig.cmake b/Qt53DExtras/Qt53DExtrasConfig.cmake -index 61de455..5f00da8 100644 ---- a/Qt53DExtras/Qt53DExtrasConfig.cmake -+++ b/Qt53DExtras/Qt53DExtrasConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::3DExtras) - - set(_Qt53DExtras_OWN_INCLUDE_DIRS "${_qt53DExtras_install_prefix}/include/" "${_qt53DExtras_install_prefix}/include/Qt3DExtras") -- set(Qt53DExtras_PRIVATE_INCLUDE_DIRS "") -+ set(Qt53DExtras_PRIVATE_INCLUDE_DIRS -+ "${_qt53DExtras_install_prefix}/include/Qt3DExtras/5.8.0" -+ "${_qt53DExtras_install_prefix}/include/Qt3DExtras/5.8.0/Qt3DExtras" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt53DExtras_OWN_INCLUDE_DIRS}) -diff --git a/Qt53DInput/Qt53DInputConfig.cmake b/Qt53DInput/Qt53DInputConfig.cmake -index 1526967..089441e 100644 ---- a/Qt53DInput/Qt53DInputConfig.cmake -+++ b/Qt53DInput/Qt53DInputConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::3DInput) - - set(_Qt53DInput_OWN_INCLUDE_DIRS "${_qt53DInput_install_prefix}/include/" "${_qt53DInput_install_prefix}/include/Qt3DInput") -- set(Qt53DInput_PRIVATE_INCLUDE_DIRS "") -+ set(Qt53DInput_PRIVATE_INCLUDE_DIRS -+ "${_qt53DInput_install_prefix}/include/Qt3DInput/5.8.0" -+ "${_qt53DInput_install_prefix}/include/Qt3DInput/5.8.0/Qt3DInput" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt53DInput_OWN_INCLUDE_DIRS}) -diff --git a/Qt53DLogic/Qt53DLogicConfig.cmake b/Qt53DLogic/Qt53DLogicConfig.cmake -index 336f0dc..963be42 100644 ---- a/Qt53DLogic/Qt53DLogicConfig.cmake -+++ b/Qt53DLogic/Qt53DLogicConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::3DLogic) - - set(_Qt53DLogic_OWN_INCLUDE_DIRS "${_qt53DLogic_install_prefix}/include/" "${_qt53DLogic_install_prefix}/include/Qt3DLogic") -- set(Qt53DLogic_PRIVATE_INCLUDE_DIRS "") -+ set(Qt53DLogic_PRIVATE_INCLUDE_DIRS -+ "${_qt53DLogic_install_prefix}/include/Qt3DLogic/5.8.0" -+ "${_qt53DLogic_install_prefix}/include/Qt3DLogic/5.8.0/Qt3DLogic" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt53DLogic_OWN_INCLUDE_DIRS}) -diff --git a/Qt53DQuick/Qt53DQuickConfig.cmake b/Qt53DQuick/Qt53DQuickConfig.cmake -index cf510c9..0277c0c 100644 ---- a/Qt53DQuick/Qt53DQuickConfig.cmake -+++ b/Qt53DQuick/Qt53DQuickConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::3DQuick) - - set(_Qt53DQuick_OWN_INCLUDE_DIRS "${_qt53DQuick_install_prefix}/include/" "${_qt53DQuick_install_prefix}/include/Qt3DQuick") -- set(Qt53DQuick_PRIVATE_INCLUDE_DIRS "") -+ set(Qt53DQuick_PRIVATE_INCLUDE_DIRS -+ "${_qt53DQuick_install_prefix}/include/Qt3DQuick/5.8.0" -+ "${_qt53DQuick_install_prefix}/include/Qt3DQuick/5.8.0/Qt3DQuick" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt53DQuick_OWN_INCLUDE_DIRS}) -diff --git a/Qt53DQuickInput/Qt53DQuickInputConfig.cmake b/Qt53DQuickInput/Qt53DQuickInputConfig.cmake -index 06fe217..f935824 100644 ---- a/Qt53DQuickInput/Qt53DQuickInputConfig.cmake -+++ b/Qt53DQuickInput/Qt53DQuickInputConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::3DQuickInput) - - set(_Qt53DQuickInput_OWN_INCLUDE_DIRS "${_qt53DQuickInput_install_prefix}/include/" "${_qt53DQuickInput_install_prefix}/include/Qt3DQuickInput") -- set(Qt53DQuickInput_PRIVATE_INCLUDE_DIRS "") -+ set(Qt53DQuickInput_PRIVATE_INCLUDE_DIRS -+ "${_qt53DQuickInput_install_prefix}/include/Qt3DQuickInput/5.8.0" -+ "${_qt53DQuickInput_install_prefix}/include/Qt3DQuickInput/5.8.0/Qt3DQuickInput" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt53DQuickInput_OWN_INCLUDE_DIRS}) -diff --git a/Qt53DQuickRender/Qt53DQuickRenderConfig.cmake b/Qt53DQuickRender/Qt53DQuickRenderConfig.cmake -index dd5472b..ef728fd 100644 ---- a/Qt53DQuickRender/Qt53DQuickRenderConfig.cmake -+++ b/Qt53DQuickRender/Qt53DQuickRenderConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::3DQuickRender) - - set(_Qt53DQuickRender_OWN_INCLUDE_DIRS "${_qt53DQuickRender_install_prefix}/include/" "${_qt53DQuickRender_install_prefix}/include/Qt3DQuickRender") -- set(Qt53DQuickRender_PRIVATE_INCLUDE_DIRS "") -+ set(Qt53DQuickRender_PRIVATE_INCLUDE_DIRS -+ "${_qt53DQuickRender_install_prefix}/include/Qt3DQuickRender/5.8.0" -+ "${_qt53DQuickRender_install_prefix}/include/Qt3DQuickRender/5.8.0/Qt3DQuickRender" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt53DQuickRender_OWN_INCLUDE_DIRS}) -diff --git a/Qt53DRender/Qt53DRenderConfig.cmake b/Qt53DRender/Qt53DRenderConfig.cmake -index 70eff4b..271463b 100644 ---- a/Qt53DRender/Qt53DRenderConfig.cmake -+++ b/Qt53DRender/Qt53DRenderConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::3DRender) - - set(_Qt53DRender_OWN_INCLUDE_DIRS "${_qt53DRender_install_prefix}/include/" "${_qt53DRender_install_prefix}/include/Qt3DRender") -- set(Qt53DRender_PRIVATE_INCLUDE_DIRS "") -+ set(Qt53DRender_PRIVATE_INCLUDE_DIRS -+ "${_qt53DRender_install_prefix}/include/Qt3DRender/5.8.0" -+ "${_qt53DRender_install_prefix}/include/Qt3DRender/5.8.0/Qt3DRender" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt53DRender_OWN_INCLUDE_DIRS}) -diff --git a/Qt5AxBase/Qt5AxBaseConfig.cmake b/Qt5AxBase/Qt5AxBaseConfig.cmake -index 48966d5..63afee8 100644 ---- a/Qt5AxBase/Qt5AxBaseConfig.cmake -+++ b/Qt5AxBase/Qt5AxBaseConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::AxBase) - - set(_Qt5AxBase_OWN_INCLUDE_DIRS "${_qt5AxBase_install_prefix}/include/" "${_qt5AxBase_install_prefix}/include/ActiveQt") -- set(Qt5AxBase_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5AxBase_PRIVATE_INCLUDE_DIRS -+ "${_qt5AxBase_install_prefix}/include/ActiveQt/5.8.0" -+ "${_qt5AxBase_install_prefix}/include/ActiveQt/5.8.0/ActiveQt" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5AxBase_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Bluetooth/Qt5BluetoothConfig.cmake b/Qt5Bluetooth/Qt5BluetoothConfig.cmake -index 9d2f7c4..1223caf 100644 ---- a/Qt5Bluetooth/Qt5BluetoothConfig.cmake -+++ b/Qt5Bluetooth/Qt5BluetoothConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Bluetooth) - - set(_Qt5Bluetooth_OWN_INCLUDE_DIRS "${_qt5Bluetooth_install_prefix}/include/" "${_qt5Bluetooth_install_prefix}/include/QtBluetooth") -- set(Qt5Bluetooth_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Bluetooth_PRIVATE_INCLUDE_DIRS -+ "${_qt5Bluetooth_install_prefix}/include/QtBluetooth/5.8.0" -+ "${_qt5Bluetooth_install_prefix}/include/QtBluetooth/5.8.0/QtBluetooth" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Bluetooth_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Charts/Qt5ChartsConfig.cmake b/Qt5Charts/Qt5ChartsConfig.cmake -index fef4b13..52e458d 100644 ---- a/Qt5Charts/Qt5ChartsConfig.cmake -+++ b/Qt5Charts/Qt5ChartsConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Charts) - - set(_Qt5Charts_OWN_INCLUDE_DIRS "${_qt5Charts_install_prefix}/include/" "${_qt5Charts_install_prefix}/include/QtCharts") -- set(Qt5Charts_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Charts_PRIVATE_INCLUDE_DIRS -+ "${_qt5Charts_install_prefix}/include/QtCharts/5.8.0" -+ "${_qt5Charts_install_prefix}/include/QtCharts/5.8.0/QtCharts" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Charts_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Core/Qt5CoreConfig.cmake b/Qt5Core/Qt5CoreConfig.cmake -index 4232dc7..c35d103 100644 ---- a/Qt5Core/Qt5CoreConfig.cmake -+++ b/Qt5Core/Qt5CoreConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Core) - - set(_Qt5Core_OWN_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/" "${_qt5Core_install_prefix}/include/QtCore") -- set(Qt5Core_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Core_PRIVATE_INCLUDE_DIRS -+ "${_qt5Core_install_prefix}/include/QtCore/5.8.0" -+ "${_qt5Core_install_prefix}/include/QtCore/5.8.0/QtCore" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Core_OWN_INCLUDE_DIRS}) -diff --git a/Qt5DBus/Qt5DBusConfig.cmake b/Qt5DBus/Qt5DBusConfig.cmake -index d5e3ac6..472b928 100644 ---- a/Qt5DBus/Qt5DBusConfig.cmake -+++ b/Qt5DBus/Qt5DBusConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::DBus) - - set(_Qt5DBus_OWN_INCLUDE_DIRS "${_qt5DBus_install_prefix}/include/" "${_qt5DBus_install_prefix}/include/QtDBus") -- set(Qt5DBus_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5DBus_PRIVATE_INCLUDE_DIRS -+ "${_qt5DBus_install_prefix}/include/QtDBus/5.8.0" -+ "${_qt5DBus_install_prefix}/include/QtDBus/5.8.0/QtDBus" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5DBus_OWN_INCLUDE_DIRS}) -diff --git a/Qt5DataVisualization/Qt5DataVisualizationConfig.cmake b/Qt5DataVisualization/Qt5DataVisualizationConfig.cmake -index b518994..91559aa 100644 ---- a/Qt5DataVisualization/Qt5DataVisualizationConfig.cmake -+++ b/Qt5DataVisualization/Qt5DataVisualizationConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::DataVisualization) - - set(_Qt5DataVisualization_OWN_INCLUDE_DIRS "${_qt5DataVisualization_install_prefix}/include/" "${_qt5DataVisualization_install_prefix}/include/QtDataVisualization") -- set(Qt5DataVisualization_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5DataVisualization_PRIVATE_INCLUDE_DIRS -+ "${_qt5DataVisualization_install_prefix}/include/QtDataVisualization/5.8.0" -+ "${_qt5DataVisualization_install_prefix}/include/QtDataVisualization/5.8.0/QtDataVisualization" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5DataVisualization_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Designer/Qt5DesignerConfig.cmake b/Qt5Designer/Qt5DesignerConfig.cmake -index 69ea6dc..7b76032 100644 ---- a/Qt5Designer/Qt5DesignerConfig.cmake -+++ b/Qt5Designer/Qt5DesignerConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Designer) - - set(_Qt5Designer_OWN_INCLUDE_DIRS "${_qt5Designer_install_prefix}/include/" "${_qt5Designer_install_prefix}/include/QtDesigner") -- set(Qt5Designer_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Designer_PRIVATE_INCLUDE_DIRS -+ "${_qt5Designer_install_prefix}/include/QtDesigner/5.8.0" -+ "${_qt5Designer_install_prefix}/include/QtDesigner/5.8.0/QtDesigner" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Designer_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Gamepad/Qt5GamepadConfig.cmake b/Qt5Gamepad/Qt5GamepadConfig.cmake -index 66db87f..987ae8f 100644 ---- a/Qt5Gamepad/Qt5GamepadConfig.cmake -+++ b/Qt5Gamepad/Qt5GamepadConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Gamepad) - - set(_Qt5Gamepad_OWN_INCLUDE_DIRS "${_qt5Gamepad_install_prefix}/include/" "${_qt5Gamepad_install_prefix}/include/QtGamepad") -- set(Qt5Gamepad_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Gamepad_PRIVATE_INCLUDE_DIRS -+ "${_qt5Gamepad_install_prefix}/include/QtGamepad/5.8.0" -+ "${_qt5Gamepad_install_prefix}/include/QtGamepad/5.8.0/QtGamepad" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Gamepad_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Gui/Qt5GuiConfig.cmake b/Qt5Gui/Qt5GuiConfig.cmake -index 4718ba9..56888c1 100644 ---- a/Qt5Gui/Qt5GuiConfig.cmake -+++ b/Qt5Gui/Qt5GuiConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Gui) - - set(_Qt5Gui_OWN_INCLUDE_DIRS "${_qt5Gui_install_prefix}/include/" "${_qt5Gui_install_prefix}/include/QtGui") -- set(Qt5Gui_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Gui_PRIVATE_INCLUDE_DIRS -+ "${_qt5Gui_install_prefix}/include/QtGui/5.8.0" -+ "${_qt5Gui_install_prefix}/include/QtGui/5.8.0/QtGui" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Gui_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Help/Qt5HelpConfig.cmake b/Qt5Help/Qt5HelpConfig.cmake -index e84511c..0da7c20 100644 ---- a/Qt5Help/Qt5HelpConfig.cmake -+++ b/Qt5Help/Qt5HelpConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Help) - - set(_Qt5Help_OWN_INCLUDE_DIRS "${_qt5Help_install_prefix}/include/" "${_qt5Help_install_prefix}/include/QtHelp") -- set(Qt5Help_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Help_PRIVATE_INCLUDE_DIRS -+ "${_qt5Help_install_prefix}/include/QtHelp/5.8.0" -+ "${_qt5Help_install_prefix}/include/QtHelp/5.8.0/QtHelp" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Help_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Location/Qt5LocationConfig.cmake b/Qt5Location/Qt5LocationConfig.cmake -index a8bdf0a..f5348c2 100644 ---- a/Qt5Location/Qt5LocationConfig.cmake -+++ b/Qt5Location/Qt5LocationConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Location) - - set(_Qt5Location_OWN_INCLUDE_DIRS "${_qt5Location_install_prefix}/include/" "${_qt5Location_install_prefix}/include/QtLocation") -- set(Qt5Location_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Location_PRIVATE_INCLUDE_DIRS -+ "${_qt5Location_install_prefix}/include/QtLocation/5.8.0" -+ "${_qt5Location_install_prefix}/include/QtLocation/5.8.0/QtLocation" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Location_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Multimedia/Qt5MultimediaConfig.cmake b/Qt5Multimedia/Qt5MultimediaConfig.cmake -index 69f353f..67fa08b 100644 ---- a/Qt5Multimedia/Qt5MultimediaConfig.cmake -+++ b/Qt5Multimedia/Qt5MultimediaConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Multimedia) - - set(_Qt5Multimedia_OWN_INCLUDE_DIRS "${_qt5Multimedia_install_prefix}/include/" "${_qt5Multimedia_install_prefix}/include/QtMultimedia") -- set(Qt5Multimedia_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Multimedia_PRIVATE_INCLUDE_DIRS -+ "${_qt5Multimedia_install_prefix}/include/QtMultimedia/5.8.0" -+ "${_qt5Multimedia_install_prefix}/include/QtMultimedia/5.8.0/QtMultimedia" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Multimedia_OWN_INCLUDE_DIRS}) -diff --git a/Qt5MultimediaWidgets/Qt5MultimediaWidgetsConfig.cmake b/Qt5MultimediaWidgets/Qt5MultimediaWidgetsConfig.cmake -index 88162f8..1dcf69e 100644 ---- a/Qt5MultimediaWidgets/Qt5MultimediaWidgetsConfig.cmake -+++ b/Qt5MultimediaWidgets/Qt5MultimediaWidgetsConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::MultimediaWidgets) - - set(_Qt5MultimediaWidgets_OWN_INCLUDE_DIRS "${_qt5MultimediaWidgets_install_prefix}/include/" "${_qt5MultimediaWidgets_install_prefix}/include/QtMultimediaWidgets") -- set(Qt5MultimediaWidgets_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5MultimediaWidgets_PRIVATE_INCLUDE_DIRS -+ "${_qt5MultimediaWidgets_install_prefix}/include/QtMultimediaWidgets/5.8.0" -+ "${_qt5MultimediaWidgets_install_prefix}/include/QtMultimediaWidgets/5.8.0/QtMultimediaWidgets" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5MultimediaWidgets_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Network/Qt5NetworkConfig.cmake b/Qt5Network/Qt5NetworkConfig.cmake -index 1778278..6a5d7f3 100644 ---- a/Qt5Network/Qt5NetworkConfig.cmake -+++ b/Qt5Network/Qt5NetworkConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Network) - - set(_Qt5Network_OWN_INCLUDE_DIRS "${_qt5Network_install_prefix}/include/" "${_qt5Network_install_prefix}/include/QtNetwork") -- set(Qt5Network_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Network_PRIVATE_INCLUDE_DIRS -+ "${_qt5Network_install_prefix}/include/QtNetwork/5.8.0" -+ "${_qt5Network_install_prefix}/include/QtNetwork/5.8.0/QtNetwork" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Network_OWN_INCLUDE_DIRS}) -diff --git a/Qt5NetworkAuth/Qt5NetworkAuthConfig.cmake b/Qt5NetworkAuth/Qt5NetworkAuthConfig.cmake -index 50f56e0..821080c 100644 ---- a/Qt5NetworkAuth/Qt5NetworkAuthConfig.cmake -+++ b/Qt5NetworkAuth/Qt5NetworkAuthConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::NetworkAuth) - - set(_Qt5NetworkAuth_OWN_INCLUDE_DIRS "${_qt5NetworkAuth_install_prefix}/include/" "${_qt5NetworkAuth_install_prefix}/include/QtNetworkAuth") -- set(Qt5NetworkAuth_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5NetworkAuth_PRIVATE_INCLUDE_DIRS -+ "${_qt5NetworkAuth_install_prefix}/include/QtNetworkAuth/5.8.0" -+ "${_qt5NetworkAuth_install_prefix}/include/QtNetworkAuth/5.8.0/QtNetworkAuth" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5NetworkAuth_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Nfc/Qt5NfcConfig.cmake b/Qt5Nfc/Qt5NfcConfig.cmake -index 83ffddd..d8a5ba9 100644 ---- a/Qt5Nfc/Qt5NfcConfig.cmake -+++ b/Qt5Nfc/Qt5NfcConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Nfc) - - set(_Qt5Nfc_OWN_INCLUDE_DIRS "${_qt5Nfc_install_prefix}/include/" "${_qt5Nfc_install_prefix}/include/QtNfc") -- set(Qt5Nfc_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Nfc_PRIVATE_INCLUDE_DIRS -+ "${_qt5Nfc_install_prefix}/include/QtNfc/5.8.0" -+ "${_qt5Nfc_install_prefix}/include/QtNfc/5.8.0/QtNfc" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Nfc_OWN_INCLUDE_DIRS}) -diff --git a/Qt5OpenGL/Qt5OpenGLConfig.cmake b/Qt5OpenGL/Qt5OpenGLConfig.cmake -index 6c874ac..3ac408a 100644 ---- a/Qt5OpenGL/Qt5OpenGLConfig.cmake -+++ b/Qt5OpenGL/Qt5OpenGLConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::OpenGL) - - set(_Qt5OpenGL_OWN_INCLUDE_DIRS "${_qt5OpenGL_install_prefix}/include/" "${_qt5OpenGL_install_prefix}/include/QtOpenGL") -- set(Qt5OpenGL_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5OpenGL_PRIVATE_INCLUDE_DIRS -+ "${_qt5OpenGL_install_prefix}/include/QtOpenGL/5.8.0" -+ "${_qt5OpenGL_install_prefix}/include/QtOpenGL/5.8.0/QtOpenGL" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5OpenGL_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Positioning/Qt5PositioningConfig.cmake b/Qt5Positioning/Qt5PositioningConfig.cmake -index 1aa3128..a6a2f24 100644 ---- a/Qt5Positioning/Qt5PositioningConfig.cmake -+++ b/Qt5Positioning/Qt5PositioningConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Positioning) - - set(_Qt5Positioning_OWN_INCLUDE_DIRS "${_qt5Positioning_install_prefix}/include/" "${_qt5Positioning_install_prefix}/include/QtPositioning") -- set(Qt5Positioning_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Positioning_PRIVATE_INCLUDE_DIRS -+ "${_qt5Positioning_install_prefix}/include/QtPositioning/5.8.0" -+ "${_qt5Positioning_install_prefix}/include/QtPositioning/5.8.0/QtPositioning" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Positioning_OWN_INCLUDE_DIRS}) -diff --git a/Qt5PrintSupport/Qt5PrintSupportConfig.cmake b/Qt5PrintSupport/Qt5PrintSupportConfig.cmake -index d7c6765..9a24e99 100644 ---- a/Qt5PrintSupport/Qt5PrintSupportConfig.cmake -+++ b/Qt5PrintSupport/Qt5PrintSupportConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::PrintSupport) - - set(_Qt5PrintSupport_OWN_INCLUDE_DIRS "${_qt5PrintSupport_install_prefix}/include/" "${_qt5PrintSupport_install_prefix}/include/QtPrintSupport") -- set(Qt5PrintSupport_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5PrintSupport_PRIVATE_INCLUDE_DIRS -+ "${_qt5PrintSupport_install_prefix}/include/QtPrintSupport/5.8.0" -+ "${_qt5PrintSupport_install_prefix}/include/QtPrintSupport/5.8.0/QtPrintSupport" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5PrintSupport_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Purchasing/Qt5PurchasingConfig.cmake b/Qt5Purchasing/Qt5PurchasingConfig.cmake -index b0cf03d..d0b527d 100644 ---- a/Qt5Purchasing/Qt5PurchasingConfig.cmake -+++ b/Qt5Purchasing/Qt5PurchasingConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Purchasing) - - set(_Qt5Purchasing_OWN_INCLUDE_DIRS "${_qt5Purchasing_install_prefix}/include/" "${_qt5Purchasing_install_prefix}/include/QtPurchasing") -- set(Qt5Purchasing_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Purchasing_PRIVATE_INCLUDE_DIRS -+ "${_qt5Purchasing_install_prefix}/include/QtPurchasing/5.8.0" -+ "${_qt5Purchasing_install_prefix}/include/QtPurchasing/5.8.0/QtPurchasing" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Purchasing_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Qml/Qt5QmlConfig.cmake b/Qt5Qml/Qt5QmlConfig.cmake -index 966e3ff..c59d5d1 100644 ---- a/Qt5Qml/Qt5QmlConfig.cmake -+++ b/Qt5Qml/Qt5QmlConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Qml) - - set(_Qt5Qml_OWN_INCLUDE_DIRS "${_qt5Qml_install_prefix}/include/" "${_qt5Qml_install_prefix}/include/QtQml") -- set(Qt5Qml_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Qml_PRIVATE_INCLUDE_DIRS -+ "${_qt5Qml_install_prefix}/include/QtQml/5.8.0" -+ "${_qt5Qml_install_prefix}/include/QtQml/5.8.0/QtQml" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Qml_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Quick/Qt5QuickConfig.cmake b/Qt5Quick/Qt5QuickConfig.cmake -index e1e2d05..def9557 100644 ---- a/Qt5Quick/Qt5QuickConfig.cmake -+++ b/Qt5Quick/Qt5QuickConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Quick) - - set(_Qt5Quick_OWN_INCLUDE_DIRS "${_qt5Quick_install_prefix}/include/" "${_qt5Quick_install_prefix}/include/QtQuick") -- set(Qt5Quick_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Quick_PRIVATE_INCLUDE_DIRS -+ "${_qt5Quick_install_prefix}/include/QtQuick/5.8.0" -+ "${_qt5Quick_install_prefix}/include/QtQuick/5.8.0/QtQuick" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Quick_OWN_INCLUDE_DIRS}) -diff --git a/Qt5QuickControls2/Qt5QuickControls2Config.cmake b/Qt5QuickControls2/Qt5QuickControls2Config.cmake -index cf34ce5..6f0ec96 100644 ---- a/Qt5QuickControls2/Qt5QuickControls2Config.cmake -+++ b/Qt5QuickControls2/Qt5QuickControls2Config.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::QuickControls2) - - set(_Qt5QuickControls2_OWN_INCLUDE_DIRS "${_qt5QuickControls2_install_prefix}/include/" "${_qt5QuickControls2_install_prefix}/include/QtQuickControls2") -- set(Qt5QuickControls2_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5QuickControls2_PRIVATE_INCLUDE_DIRS -+ "${_qt5QuickControls2_install_prefix}/include/QtQuickControls2/5.8.0" -+ "${_qt5QuickControls2_install_prefix}/include/QtQuickControls2/5.8.0/QtQuickControls2" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5QuickControls2_OWN_INCLUDE_DIRS}) -diff --git a/Qt5QuickTest/Qt5QuickTestConfig.cmake b/Qt5QuickTest/Qt5QuickTestConfig.cmake -index 9b2b8b2..6e1ea1d 100644 ---- a/Qt5QuickTest/Qt5QuickTestConfig.cmake -+++ b/Qt5QuickTest/Qt5QuickTestConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::QuickTest) - - set(_Qt5QuickTest_OWN_INCLUDE_DIRS "${_qt5QuickTest_install_prefix}/include/" "${_qt5QuickTest_install_prefix}/include/QtQuickTest") -- set(Qt5QuickTest_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5QuickTest_PRIVATE_INCLUDE_DIRS -+ "${_qt5QuickTest_install_prefix}/include/QtQuickTest/5.8.0" -+ "${_qt5QuickTest_install_prefix}/include/QtQuickTest/5.8.0/QtQuickTest" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5QuickTest_OWN_INCLUDE_DIRS}) -diff --git a/Qt5QuickWidgets/Qt5QuickWidgetsConfig.cmake b/Qt5QuickWidgets/Qt5QuickWidgetsConfig.cmake -index b0b8988..559b2f0 100644 ---- a/Qt5QuickWidgets/Qt5QuickWidgetsConfig.cmake -+++ b/Qt5QuickWidgets/Qt5QuickWidgetsConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::QuickWidgets) - - set(_Qt5QuickWidgets_OWN_INCLUDE_DIRS "${_qt5QuickWidgets_install_prefix}/include/" "${_qt5QuickWidgets_install_prefix}/include/QtQuickWidgets") -- set(Qt5QuickWidgets_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5QuickWidgets_PRIVATE_INCLUDE_DIRS -+ "${_qt5QuickWidgets_install_prefix}/include/QtQuickWidgets/5.8.0" -+ "${_qt5QuickWidgets_install_prefix}/include/QtQuickWidgets/5.8.0/QtQuickWidgets" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5QuickWidgets_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Script/Qt5ScriptConfig.cmake b/Qt5Script/Qt5ScriptConfig.cmake -index da053f8..b2b34d6 100644 ---- a/Qt5Script/Qt5ScriptConfig.cmake -+++ b/Qt5Script/Qt5ScriptConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Script) - - set(_Qt5Script_OWN_INCLUDE_DIRS "${_qt5Script_install_prefix}/include/" "${_qt5Script_install_prefix}/include/QtScript") -- set(Qt5Script_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Script_PRIVATE_INCLUDE_DIRS -+ "${_qt5Script_install_prefix}/include/QtScript/5.8.0" -+ "${_qt5Script_install_prefix}/include/QtScript/5.8.0/QtScript" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Script_OWN_INCLUDE_DIRS}) -diff --git a/Qt5ScriptTools/Qt5ScriptToolsConfig.cmake b/Qt5ScriptTools/Qt5ScriptToolsConfig.cmake -index e4bf959..959ac50 100644 ---- a/Qt5ScriptTools/Qt5ScriptToolsConfig.cmake -+++ b/Qt5ScriptTools/Qt5ScriptToolsConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::ScriptTools) - - set(_Qt5ScriptTools_OWN_INCLUDE_DIRS "${_qt5ScriptTools_install_prefix}/include/" "${_qt5ScriptTools_install_prefix}/include/QtScriptTools") -- set(Qt5ScriptTools_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5ScriptTools_PRIVATE_INCLUDE_DIRS -+ "${_qt5ScriptTools_install_prefix}/include/QtScriptTools/5.8.0" -+ "${_qt5ScriptTools_install_prefix}/include/QtScriptTools/5.8.0/QtScriptTools" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5ScriptTools_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Scxml/Qt5ScxmlConfig.cmake b/Qt5Scxml/Qt5ScxmlConfig.cmake -index 90ac06b..e78c552 100644 ---- a/Qt5Scxml/Qt5ScxmlConfig.cmake -+++ b/Qt5Scxml/Qt5ScxmlConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Scxml) - - set(_Qt5Scxml_OWN_INCLUDE_DIRS "${_qt5Scxml_install_prefix}/include/" "${_qt5Scxml_install_prefix}/include/QtScxml") -- set(Qt5Scxml_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Scxml_PRIVATE_INCLUDE_DIRS -+ "${_qt5Scxml_install_prefix}/include/QtScxml/5.8.0" -+ "${_qt5Scxml_install_prefix}/include/QtScxml/5.8.0/QtScxml" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Scxml_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Sensors/Qt5SensorsConfig.cmake b/Qt5Sensors/Qt5SensorsConfig.cmake -index 9e53e4d..2096beb 100644 ---- a/Qt5Sensors/Qt5SensorsConfig.cmake -+++ b/Qt5Sensors/Qt5SensorsConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Sensors) - - set(_Qt5Sensors_OWN_INCLUDE_DIRS "${_qt5Sensors_install_prefix}/include/" "${_qt5Sensors_install_prefix}/include/QtSensors") -- set(Qt5Sensors_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Sensors_PRIVATE_INCLUDE_DIRS -+ "${_qt5Sensors_install_prefix}/include/QtSensors/5.8.0" -+ "${_qt5Sensors_install_prefix}/include/QtSensors/5.8.0/QtSensors" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Sensors_OWN_INCLUDE_DIRS}) -diff --git a/Qt5SerialBus/Qt5SerialBusConfig.cmake b/Qt5SerialBus/Qt5SerialBusConfig.cmake -index f2e4d69..8ba391c 100644 ---- a/Qt5SerialBus/Qt5SerialBusConfig.cmake -+++ b/Qt5SerialBus/Qt5SerialBusConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::SerialBus) - - set(_Qt5SerialBus_OWN_INCLUDE_DIRS "${_qt5SerialBus_install_prefix}/include/" "${_qt5SerialBus_install_prefix}/include/QtSerialBus") -- set(Qt5SerialBus_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5SerialBus_PRIVATE_INCLUDE_DIRS -+ "${_qt5SerialBus_install_prefix}/include/QtSerialBus/5.8.0" -+ "${_qt5SerialBus_install_prefix}/include/QtSerialBus/5.8.0/QtSerialBus" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5SerialBus_OWN_INCLUDE_DIRS}) -diff --git a/Qt5SerialPort/Qt5SerialPortConfig.cmake b/Qt5SerialPort/Qt5SerialPortConfig.cmake -index fa15de5..4ec1024 100644 ---- a/Qt5SerialPort/Qt5SerialPortConfig.cmake -+++ b/Qt5SerialPort/Qt5SerialPortConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::SerialPort) - - set(_Qt5SerialPort_OWN_INCLUDE_DIRS "${_qt5SerialPort_install_prefix}/include/" "${_qt5SerialPort_install_prefix}/include/QtSerialPort") -- set(Qt5SerialPort_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5SerialPort_PRIVATE_INCLUDE_DIRS -+ "${_qt5SerialPort_install_prefix}/include/QtSerialPort/5.8.0" -+ "${_qt5SerialPort_install_prefix}/include/QtSerialPort/5.8.0/QtSerialPort" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5SerialPort_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Sql/Qt5SqlConfig.cmake b/Qt5Sql/Qt5SqlConfig.cmake -index 0e5d50c..baf3f66 100644 ---- a/Qt5Sql/Qt5SqlConfig.cmake -+++ b/Qt5Sql/Qt5SqlConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Sql) - - set(_Qt5Sql_OWN_INCLUDE_DIRS "${_qt5Sql_install_prefix}/include/" "${_qt5Sql_install_prefix}/include/QtSql") -- set(Qt5Sql_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Sql_PRIVATE_INCLUDE_DIRS -+ "${_qt5Sql_install_prefix}/include/QtSql/5.8.0" -+ "${_qt5Sql_install_prefix}/include/QtSql/5.8.0/QtSql" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Sql_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Svg/Qt5SvgConfig.cmake b/Qt5Svg/Qt5SvgConfig.cmake -index 5d6ad04..b0d1aaa 100644 ---- a/Qt5Svg/Qt5SvgConfig.cmake -+++ b/Qt5Svg/Qt5SvgConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Svg) - - set(_Qt5Svg_OWN_INCLUDE_DIRS "${_qt5Svg_install_prefix}/include/" "${_qt5Svg_install_prefix}/include/QtSvg") -- set(Qt5Svg_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Svg_PRIVATE_INCLUDE_DIRS -+ "${_qt5Svg_install_prefix}/include/QtSvg/5.8.0" -+ "${_qt5Svg_install_prefix}/include/QtSvg/5.8.0/QtSvg" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Svg_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Test/Qt5TestConfig.cmake b/Qt5Test/Qt5TestConfig.cmake -index 8183efd..f15979f 100644 ---- a/Qt5Test/Qt5TestConfig.cmake -+++ b/Qt5Test/Qt5TestConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Test) - - set(_Qt5Test_OWN_INCLUDE_DIRS "${_qt5Test_install_prefix}/include/" "${_qt5Test_install_prefix}/include/QtTest") -- set(Qt5Test_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Test_PRIVATE_INCLUDE_DIRS -+ "${_qt5Test_install_prefix}/include/QtTest/5.8.0" -+ "${_qt5Test_install_prefix}/include/QtTest/5.8.0/QtTest" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Test_OWN_INCLUDE_DIRS}) -diff --git a/Qt5TextToSpeech/Qt5TextToSpeechConfig.cmake b/Qt5TextToSpeech/Qt5TextToSpeechConfig.cmake -index 2577e82..aa4bf39 100644 ---- a/Qt5TextToSpeech/Qt5TextToSpeechConfig.cmake -+++ b/Qt5TextToSpeech/Qt5TextToSpeechConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::TextToSpeech) - - set(_Qt5TextToSpeech_OWN_INCLUDE_DIRS "${_qt5TextToSpeech_install_prefix}/include/" "${_qt5TextToSpeech_install_prefix}/include/QtTextToSpeech") -- set(Qt5TextToSpeech_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5TextToSpeech_PRIVATE_INCLUDE_DIRS -+ "${_qt5TextToSpeech_install_prefix}/include/QtTextToSpeech/5.8.0" -+ "${_qt5TextToSpeech_install_prefix}/include/QtTextToSpeech/5.8.0/QtTextToSpeech" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5TextToSpeech_OWN_INCLUDE_DIRS}) -diff --git a/Qt5UiTools/Qt5UiToolsConfig.cmake b/Qt5UiTools/Qt5UiToolsConfig.cmake -index f217198..1bfa8b2 100644 ---- a/Qt5UiTools/Qt5UiToolsConfig.cmake -+++ b/Qt5UiTools/Qt5UiToolsConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::UiTools) - - set(_Qt5UiTools_OWN_INCLUDE_DIRS "${_qt5UiTools_install_prefix}/include/" "${_qt5UiTools_install_prefix}/include/QtUiTools") -- set(Qt5UiTools_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5UiTools_PRIVATE_INCLUDE_DIRS -+ "${_qt5UiTools_install_prefix}/include/QtUiTools/5.8.0" -+ "${_qt5UiTools_install_prefix}/include/QtUiTools/5.8.0/QtUiTools" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5UiTools_OWN_INCLUDE_DIRS}) -diff --git a/Qt5WebChannel/Qt5WebChannelConfig.cmake b/Qt5WebChannel/Qt5WebChannelConfig.cmake -index ce8949c..c056b9d 100644 ---- a/Qt5WebChannel/Qt5WebChannelConfig.cmake -+++ b/Qt5WebChannel/Qt5WebChannelConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::WebChannel) - - set(_Qt5WebChannel_OWN_INCLUDE_DIRS "${_qt5WebChannel_install_prefix}/include/" "${_qt5WebChannel_install_prefix}/include/QtWebChannel") -- set(Qt5WebChannel_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5WebChannel_PRIVATE_INCLUDE_DIRS -+ "${_qt5WebChannel_install_prefix}/include/QtWebChannel/5.8.0" -+ "${_qt5WebChannel_install_prefix}/include/QtWebChannel/5.8.0/QtWebChannel" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5WebChannel_OWN_INCLUDE_DIRS}) -diff --git a/Qt5WebSockets/Qt5WebSocketsConfig.cmake b/Qt5WebSockets/Qt5WebSocketsConfig.cmake -index c2609da..42e21b8 100644 ---- a/Qt5WebSockets/Qt5WebSocketsConfig.cmake -+++ b/Qt5WebSockets/Qt5WebSocketsConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::WebSockets) - - set(_Qt5WebSockets_OWN_INCLUDE_DIRS "${_qt5WebSockets_install_prefix}/include/" "${_qt5WebSockets_install_prefix}/include/QtWebSockets") -- set(Qt5WebSockets_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5WebSockets_PRIVATE_INCLUDE_DIRS -+ "${_qt5WebSockets_install_prefix}/include/QtWebSockets/5.8.0" -+ "${_qt5WebSockets_install_prefix}/include/QtWebSockets/5.8.0/QtWebSockets" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5WebSockets_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Widgets/Qt5WidgetsConfig.cmake b/Qt5Widgets/Qt5WidgetsConfig.cmake -index 44c7aed..658e29a 100644 ---- a/Qt5Widgets/Qt5WidgetsConfig.cmake -+++ b/Qt5Widgets/Qt5WidgetsConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Widgets) - - set(_Qt5Widgets_OWN_INCLUDE_DIRS "${_qt5Widgets_install_prefix}/include/" "${_qt5Widgets_install_prefix}/include/QtWidgets") -- set(Qt5Widgets_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Widgets_PRIVATE_INCLUDE_DIRS -+ "${_qt5Widgets_install_prefix}/include/QtWidgets/5.8.0" -+ "${_qt5Widgets_install_prefix}/include/QtWidgets/5.8.0/QtWidgets" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Widgets_OWN_INCLUDE_DIRS}) -diff --git a/Qt5WinExtras/Qt5WinExtrasConfig.cmake b/Qt5WinExtras/Qt5WinExtrasConfig.cmake -index c63cee3..f9ea776 100644 ---- a/Qt5WinExtras/Qt5WinExtrasConfig.cmake -+++ b/Qt5WinExtras/Qt5WinExtrasConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::WinExtras) - - set(_Qt5WinExtras_OWN_INCLUDE_DIRS "${_qt5WinExtras_install_prefix}/include/" "${_qt5WinExtras_install_prefix}/include/QtWinExtras") -- set(Qt5WinExtras_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5WinExtras_PRIVATE_INCLUDE_DIRS -+ "${_qt5WinExtras_install_prefix}/include/QtWinExtras/5.8.0" -+ "${_qt5WinExtras_install_prefix}/include/QtWinExtras/5.8.0/QtWinExtras" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5WinExtras_OWN_INCLUDE_DIRS}) -diff --git a/Qt5Xml/Qt5XmlConfig.cmake b/Qt5Xml/Qt5XmlConfig.cmake -index fee861c..31dc6f7 100644 ---- a/Qt5Xml/Qt5XmlConfig.cmake -+++ b/Qt5Xml/Qt5XmlConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::Xml) - - set(_Qt5Xml_OWN_INCLUDE_DIRS "${_qt5Xml_install_prefix}/include/" "${_qt5Xml_install_prefix}/include/QtXml") -- set(Qt5Xml_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5Xml_PRIVATE_INCLUDE_DIRS -+ "${_qt5Xml_install_prefix}/include/QtXml/5.8.0" -+ "${_qt5Xml_install_prefix}/include/QtXml/5.8.0/QtXml" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5Xml_OWN_INCLUDE_DIRS}) -diff --git a/Qt5XmlPatterns/Qt5XmlPatternsConfig.cmake b/Qt5XmlPatterns/Qt5XmlPatternsConfig.cmake -index 662a612..45cfe8b 100644 ---- a/Qt5XmlPatterns/Qt5XmlPatternsConfig.cmake -+++ b/Qt5XmlPatterns/Qt5XmlPatternsConfig.cmake -@@ -56,7 +56,10 @@ endmacro() - if (NOT TARGET Qt5::XmlPatterns) - - set(_Qt5XmlPatterns_OWN_INCLUDE_DIRS "${_qt5XmlPatterns_install_prefix}/include/" "${_qt5XmlPatterns_install_prefix}/include/QtXmlPatterns") -- set(Qt5XmlPatterns_PRIVATE_INCLUDE_DIRS "") -+ set(Qt5XmlPatterns_PRIVATE_INCLUDE_DIRS -+ "${_qt5XmlPatterns_install_prefix}/include/QtXmlPatterns/5.8.0" -+ "${_qt5XmlPatterns_install_prefix}/include/QtXmlPatterns/5.8.0/QtXmlPatterns" -+ ) - include("${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake" OPTIONAL) - - foreach(_dir ${_Qt5XmlPatterns_OWN_INCLUDE_DIRS}) - diff --git a/ports/qt5/configure_qt.cmake b/ports/qt5/configure_qt.cmake deleted file mode 100644 index 21e3384c1..000000000 --- a/ports/qt5/configure_qt.cmake +++ /dev/null @@ -1,62 +0,0 @@ -function(configure_qt) - cmake_parse_arguments(_csc "" "SOURCE_PATH;PLATFORM" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) - - if (_csc_PLATFORM) - set(PLATFORM ${_csc_PLATFORM}) - elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v140") - set(PLATFORM "win32-msvc2015") - elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141") - set(PLATFORM "win32-msvc2017") - endif() - - vcpkg_find_acquire_program(PERL) - get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) - - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}") - - if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) - list(APPEND _csc_OPTIONS - "-static" - "-static-runtime" - ) - endif() - - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - vcpkg_execute_required_process( - COMMAND "${_csc_SOURCE_PATH}/configure.bat" ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} - -release - -prefix ${CURRENT_PACKAGES_DIR} - -hostbindir ${CURRENT_PACKAGES_DIR}/tools/qt5 - -archdatadir ${CURRENT_PACKAGES_DIR}/share/qt5 - -datadir ${CURRENT_PACKAGES_DIR}/share/qt5 - -plugindir ${CURRENT_PACKAGES_DIR}/plugins - -qmldir ${CURRENT_PACKAGES_DIR}/qml - -I ${CURRENT_INSTALLED_DIR}/include - -L ${CURRENT_INSTALLED_DIR}/lib - -platform ${PLATFORM} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME config-${TARGET_TRIPLET}-rel - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") - - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - vcpkg_execute_required_process( - COMMAND "${_csc_SOURCE_PATH}/configure.bat" ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} - -debug - -prefix ${CURRENT_PACKAGES_DIR}/debug - -hostbindir ${CURRENT_PACKAGES_DIR}/debug/tools/qt5 - -archdatadir ${CURRENT_PACKAGES_DIR}/debug/share/qt5 - -datadir ${CURRENT_PACKAGES_DIR}/debug/share/qt5 - -plugindir ${CURRENT_PACKAGES_DIR}/debug/plugins - -qmldir ${CURRENT_PACKAGES_DIR}/debug/qml - -I ${CURRENT_INSTALLED_DIR}/include - -L ${CURRENT_INSTALLED_DIR}/debug/lib - -platform ${PLATFORM} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME config-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") -endfunction() \ No newline at end of file diff --git a/ports/qt5/fix-commandline-overrides.patch b/ports/qt5/fix-commandline-overrides.patch deleted file mode 100644 index 08f627740..000000000 --- a/ports/qt5/fix-commandline-overrides.patch +++ /dev/null @@ -1,149 +0,0 @@ -diff --git a/qtbase/configure.json b/qtbase/configure.json -index f774291..8903df0 100644 ---- a/qtbase/configure.json -+++ b/qtbase/configure.json -@@ -19,8 +19,7 @@ - "commandline": { - "assignments": { - "DBUS_HOST_PATH": "host_dbus.prefix", -- "DBUS_PATH": "dbus.prefix", -- "ZLIB_LIBS": "zlib.libs" -+ "DBUS_PATH": "dbus.prefix" - }, - "custom": "qmakeArgs", - "options": { -diff --git a/qtbase/mkspecs/features/qt_configure.prf b/qtbase/mkspecs/features/qt_configure.prf -index eaaa161..fdec8ea 100644 ---- a/qtbase/mkspecs/features/qt_configure.prf -+++ b/qtbase/mkspecs/features/qt_configure.prf -@@ -401,6 +401,7 @@ defineReplace(qtConfPrepareArgs) { - } - - defineTest(qtConfSetupLibraries) { -+ asspfx = $${currentConfig}.commandline.assignments - for (l, $${currentConfig}.libraries._KEYS_) { - lpfx = $${currentConfig}.libraries.$${l} - # 'export' may be omitted, in which case it falls back to the library's name -@@ -408,6 +409,15 @@ defineTest(qtConfSetupLibraries) { - $${lpfx}.export = $$l - export($${lpfx}.export) - } -+ # 'export' may also be empty, but we need a derived identifier -+ alias = $$eval($${lpfx}.export) -+ isEmpty(alias): alias = $$l -+ $${lpfx}.alias = $$alias -+ export($${lpfx}.alias) -+ # make it easy to refer to the library by its export name. -+ $${currentConfig}.exports._KEYS_ += $$alias -+ $${currentConfig}.exports.$$alias += $$l -+ export($${currentConfig}.exports.$$alias) - isEmpty($${lpfx}.sources._KEYS_): \ - error("Library $$l defines no sources") - for (s, $${lpfx}.sources._KEYS_) { -@@ -427,10 +437,35 @@ defineTest(qtConfSetupLibraries) { - } - } - } -+ -+ $${currentConfig}.exports._KEYS_ = $$unique($${currentConfig}.exports._KEYS_) -+ export($${currentConfig}.exports._KEYS_) -+ -+ for (alias, $${currentConfig}.exports._KEYS_) { -+ ua = $$upper($$alias) -+ $${asspfx}._KEYS_ += \ -+ $${ua}_PREFIX $${ua}_INCDIR $${ua}_LIBDIR \ -+ $${ua}_LIBS $${ua}_LIBS_DEBUG $${ua}_LIBS_RELEASE -+ uapfx = $${asspfx}.$${ua} -+ $${uapfx}_PREFIX = $${alias}.prefix -+ $${uapfx}_INCDIR = $${alias}.incdir -+ $${uapfx}_LIBDIR = $${alias}.libdir -+ $${uapfx}_LIBS = $${alias}.libs -+ $${uapfx}_LIBS_DEBUG = $${alias}.libs.debug -+ $${uapfx}_LIBS_RELEASE = $${alias}.libs.release -+ export($${uapfx}_PREFIX) -+ export($${uapfx}_INCDIR) -+ export($${uapfx}_LIBDIR) -+ export($${uapfx}_LIBS) -+ export($${uapfx}_LIBS_DEBUG) -+ export($${uapfx}_LIBS_RELEASE) -+ } -+ export($${asspfx}._KEYS_) -+ - - # reverse mapping for assignments on command line. -- for (a, $${currentConfig}.commandline.assignments._KEYS_) { -- apfx = $${currentConfig}.commandline.assignments.$${a} -+ for (a, $${asspfx}._KEYS_) { -+ apfx = $${asspfx}.$${a} - ra = config.commandline.rev_assignments.$$eval($$apfx) - $$ra = $$a - export($$ra) -@@ -479,6 +514,18 @@ defineTest(qtConfLibrary_inline) { - export($${1}.libs) - } - -+ incdir = $$val_escape(config.input.$${input}.incdir) -+ !isEmpty(incdir) { -+ $${1}.includedir = $$incdir -+ export($${1}.includedir) -+ } -+ -+ libdir = $$val_escape(config.input.$${input}.libdir) -+ !isEmpty(libdir) { -+ $${1}.libs = "-L$$libdir $$eval($${1}.libs)" -+ export($${1}.libs) -+ } -+ - return(true) - } - -diff --git a/qtbase/src/gui/configure.json b/qtbase/src/gui/configure.json -index 1f50116..af03362 100644 ---- a/qtbase/src/gui/configure.json -+++ b/qtbase/src/gui/configure.json -@@ -100,7 +100,7 @@ - "test": "unix/freetype", - "sources": [ - { "type": "pkgConfig", "args": "freetype2" }, -- { "type": "freetype", "libs": "-lfreetype" } -+ { "libs": "-lfreetype" } - ] - }, - "fontconfig": { -diff --git a/qtbase/src/network/configure.json b/qtbase/src/network/configure.json -index 1e08aa7..314970e 100644 ---- a/qtbase/src/network/configure.json -+++ b/qtbase/src/network/configure.json -@@ -7,9 +7,6 @@ - - "commandline": { - "assignments": { -- "OPENSSL_LIBS": "openssl.libs", -- "OPENSSL_LIBS_DEBUG": "openssl.libs.debug", -- "OPENSSL_LIBS_RELEASE": "openssl.libs.release", - "OPENSSL_PATH": "openssl.prefix" - }, - "options": { -diff --git a/qtbase/src/sql/configure.json b/qtbase/src/sql/configure.json -index 96c82e8..51a7e51 100644 ---- a/qtbase/src/sql/configure.json -+++ b/qtbase/src/sql/configure.json -@@ -8,7 +8,6 @@ - "commandline": { - "assignments": { - "MYSQL_PATH": "mysql.prefix", -- "PSQL_LIBS": "psql.libs", - "SYBASE": "tds.prefix", - "SYBASE_LIBS": "tds.libs" - }, -@@ -71,8 +70,8 @@ - "sources": [ - { "type": "pkgConfig", "args": "libpq" }, - { "type": "psqlConfig" }, -- { "type": "psqlEnv", "libs": "-llibpq -lws2_32 -ladvapi32", "condition": "config.win32" }, -- { "type": "psqlEnv", "libs": "-lpq", "condition": "!config.win32" } -+ { "libs": "-llibpq -lws2_32 -ladvapi32", "condition": "config.win32" }, -+ { "libs": "-lpq", "condition": "!config.win32" } - ] - }, - "tds": { diff --git a/ports/qt5/fix-qalgorithms-vs2017.patch b/ports/qt5/fix-qalgorithms-vs2017.patch deleted file mode 100644 index eab41c0c3..000000000 --- a/ports/qt5/fix-qalgorithms-vs2017.patch +++ /dev/null @@ -1,138 +0,0 @@ -diff --git a/qtbase/src/corelib/tools/qalgorithms.h b/qtbase/src/corelib/tools/qalgorithms.h -index 303374b..7e84695 100644 ---- a/qtbase/src/corelib/tools/qalgorithms.h -+++ b/qtbase/src/corelib/tools/qalgorithms.h -@@ -589,15 +589,16 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NO - return __builtin_popcountll(v); - } - #elif defined(Q_CC_MSVC) && !defined(Q_OS_WINCE) && !defined(Q_PROCESSOR_ARM) -+#define QT_POPCOUNT_CONSTEXPR - #define QT_HAS_BUILTIN_CTZ --Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_ctz(quint32 val) -+Q_ALWAYS_INLINE unsigned long qt_builtin_ctz(quint32 val) - { - unsigned long result; - _BitScanForward(&result, val); - return result; - } - #define QT_HAS_BUILTIN_CLZ --Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_clz(quint32 val) -+Q_ALWAYS_INLINE unsigned long qt_builtin_clz(quint32 val) - { - unsigned long result; - _BitScanReverse(&result, val); -@@ -610,7 +611,7 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_clz(quint32 val) - #if Q_PROCESSOR_WORDSIZE == 8 - // These are only defined for 64bit builds. - #define QT_HAS_BUILTIN_CTZLL --Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_ctzll(quint64 val) -+Q_ALWAYS_INLINE unsigned long qt_builtin_ctzll(quint64 val) - { - unsigned long result; - _BitScanForward64(&result, val); -@@ -618,7 +619,7 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_ctzll(quint64 val) - } - // MSVC calls it _BitScanReverse and returns the carry flag, which we don't need - #define QT_HAS_BUILTIN_CLZLL --Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_clzll(quint64 val) -+Q_ALWAYS_INLINE unsigned long qt_builtin_clzll(quint64 val) - { - unsigned long result; - _BitScanReverse64(&result, val); -@@ -628,31 +629,31 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_clzll(quint64 val) - } - #endif // MSVC 64bit - # define QT_HAS_BUILTIN_CTZS --Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW -+Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW - { - return qt_builtin_ctz(v); - } - #define QT_HAS_BUILTIN_CLZS --Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW -+Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW - { - return qt_builtin_clz(v) - 16U; - } - #define QALGORITHMS_USE_BUILTIN_POPCOUNT --Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint32 v) Q_DECL_NOTHROW -+Q_ALWAYS_INLINE uint qt_builtin_popcount(quint32 v) Q_DECL_NOTHROW - { - return __popcnt(v); - } --Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint8 v) Q_DECL_NOTHROW -+Q_ALWAYS_INLINE uint qt_builtin_popcount(quint8 v) Q_DECL_NOTHROW - { - return __popcnt16(v); - } --Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint16 v) Q_DECL_NOTHROW -+Q_ALWAYS_INLINE uint qt_builtin_popcount(quint16 v) Q_DECL_NOTHROW - { - return __popcnt16(v); - } - #if Q_PROCESSOR_WORDSIZE == 8 - #define QALGORITHMS_USE_BUILTIN_POPCOUNTLL --Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NOTHROW -+Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NOTHROW - { - return __popcnt64(v); - } -@@ -660,9 +661,13 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NO - #endif // MSVC - #endif // QT_HAS_CONSTEXPR_BUILTINS - -+#ifndef QT_POPCOUNT_CONSTEXPR -+#define QT_POPCOUNT_CONSTEXPR Q_DECL_CONSTEXPR -+#endif -+ - } //namespace QAlgorithmsPrivate - --Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint32 v) Q_DECL_NOTHROW -+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint32 v) Q_DECL_NOTHROW - { - #ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT - return QAlgorithmsPrivate::qt_builtin_popcount(v); -@@ -675,7 +680,7 @@ Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint32 v) Q - #endif - } - --Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint8 v) Q_DECL_NOTHROW -+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint8 v) Q_DECL_NOTHROW - { - #ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT - return QAlgorithmsPrivate::qt_builtin_popcount(v); -@@ -685,7 +690,7 @@ Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint8 v) Q_ - #endif - } - --Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint16 v) Q_DECL_NOTHROW -+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint16 v) Q_DECL_NOTHROW - { - #ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT - return QAlgorithmsPrivate::qt_builtin_popcount(v); -@@ -696,7 +701,7 @@ Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint16 v) Q - #endif - } - --Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint64 v) Q_DECL_NOTHROW -+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint64 v) Q_DECL_NOTHROW - { - #ifdef QALGORITHMS_USE_BUILTIN_POPCOUNTLL - return QAlgorithmsPrivate::qt_builtin_popcountll(v); -@@ -711,7 +716,7 @@ Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint64 v) Q - #endif - } - --Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(long unsigned int v) Q_DECL_NOTHROW -+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(long unsigned int v) Q_DECL_NOTHROW - { - return qPopulationCount(static_cast(v)); - } -@@ -719,6 +724,7 @@ Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(long unsigne - #if defined(Q_CC_GNU) && !defined(Q_CC_CLANG) - #undef QALGORITHMS_USE_BUILTIN_POPCOUNT - #endif -+#undef QT_POPCOUNT_CONSTEXPR - - Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint32 v) Q_DECL_NOTHROW - { diff --git a/ports/qt5/fixcmake.py b/ports/qt5/fixcmake.py deleted file mode 100644 index b081af58e..000000000 --- a/ports/qt5/fixcmake.py +++ /dev/null @@ -1,63 +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") - for line in openedfile: - if "_install_prefix}/bin/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line - builder += " else()" - builder += "\n " + line.replace("/bin/", "/debug/bin/") - builder += " endif()\n" - elif "_install_prefix}/lib/${LIB_LOCATION}" in line: - # Qt5AxServer(d).lib has been moved to manual-link: - if '_qt5AxServer_install_prefix' in line: - line = line.replace('/lib/', '/lib/manual-link/') - - 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}/lib/qtmaind.lib" in line: - # qtmaind.lib has been moved to manual-link: - builder += line.replace("/lib/", "/debug/lib/manual-link/") - 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 "_install_prefix}/lib/qtmain.lib" in line: - # qtmain(d).lib has been moved to manual-link: - builder += line.replace("/lib/", "/lib/manual-link/") - builder += " set(imported_location_debug \"${_qt5Core_install_prefix}/debug/lib/manual-link/qtmaind.lib\")\n" - builder += "\n" - builder += " set_target_properties(Qt5::WinMain PROPERTIES\n" - builder += " IMPORTED_LOCATION_DEBUG ${imported_location_debug}\n" - builder += " )\n" - elif dllpattern.search(line) != None: - builder += line.replace("/bin/", "/debug/bin/") - elif libpattern.search(line) != None: - builder += line.replace("/lib/", "/debug/lib/") - elif exepattern.search(line) != None: - builder += line.replace("/bin/", "/tools/qt5/") - else: - builder += line - new_file = open(f, "w") - new_file.write(builder) - new_file.close() \ No newline at end of file diff --git a/ports/qt5/install_qt.cmake b/ports/qt5/install_qt.cmake deleted file mode 100644 index 1b0bec935..000000000 --- a/ports/qt5/install_qt.cmake +++ /dev/null @@ -1,45 +0,0 @@ -function(install_qt) - cmake_parse_arguments(_bc "DISABLE_PARALLEL" "" "" ${ARGN}) - - if (_bc_DISABLE_PARALLEL) - set(JOBS "1") - else() - set(JOBS "$ENV{NUMBER_OF_PROCESSORS}") - endif() - - vcpkg_find_acquire_program(JOM) - vcpkg_find_acquire_program(PYTHON3) - get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) - - set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") - set(_path "$ENV{PATH}") - - message(STATUS "Package ${TARGET_TRIPLET}-rel") - set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/bin;${_path}") - vcpkg_execute_required_process( - COMMAND ${JOM} /J ${JOBS} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME build-${TARGET_TRIPLET}-rel - ) - vcpkg_execute_required_process( - COMMAND ${JOM} /J ${JOBS} install - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME package-${TARGET_TRIPLET}-rel - ) - message(STATUS "Package ${TARGET_TRIPLET}-rel done") - - message(STATUS "Package ${TARGET_TRIPLET}-dbg") - set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/bin;${_path}") - vcpkg_execute_required_process( - COMMAND ${JOM} /J ${JOBS} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME build-${TARGET_TRIPLET}-dbg - ) - vcpkg_execute_required_process( - COMMAND ${JOM} /J ${JOBS} install - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME package-${TARGET_TRIPLET}-dbg - ) - set(ENV{PATH} "${_path}") - message(STATUS "Package ${TARGET_TRIPLET}-dbg done") -endfunction() \ No newline at end of file diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake deleted file mode 100644 index 4b852e95c..000000000 --- a/ports/qt5/portfile.cmake +++ /dev/null @@ -1,147 +0,0 @@ -include(vcpkg_common_functions) - -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 27) - 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}) -include(configure_qt) -include(install_qt) - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/qt-5.8.0) -vcpkg_download_distfile(ARCHIVE_FILE - URLS "http://download.qt.io/official_releases/qt/5.8/5.8.0/single/qt-everywhere-opensource-src-5.8.0.7z" - FILENAME "qt-5.8.0.7z" - SHA512 4c8e7931f0c48318871242c12c2d6f5406be40e037f18690017198a79ef40a72d4319ecb1b8fb5f97c080dbe30174ceb5fd604b3fab22489f977cbeee3e8abe7 -) -vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.8.0) - file(RENAME ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.8.0 ${CURRENT_BUILDTREES_DIR}/src/qt-5.8.0) -endif() - -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-qalgorithms-vs2017.patch" "${CMAKE_CURRENT_LIST_DIR}/fix-commandline-overrides.patch" -) - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -configure_qt( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -confirm-license - -opensource - -system-zlib - -system-libjpeg - -system-libpng - -system-freetype - -system-pcre - -system-harfbuzz - -system-doubleconversion - -system-sqlite - -sql-sqlite - -sql-psql - -nomake examples -nomake tests - -skip webengine - -opengl desktop # other options are "-no-opengl" and "-opengl angle" - -mp - LIBJPEG_LIBS="-ljpeg" - OPTIONS_RELEASE - ZLIB_LIBS="-lzlib" - LIBPNG_LIBS="-llibpng16" - OPTIONS_DEBUG - ZLIB_LIBS="-lzlibd" - LIBPNG_LIBS="-llibpng16d" - PCRE_LIBS="-lpcre16d" - PSQL_LIBS="-llibpqd" - FREETYPE_LIBS="-lfreetyped" -) -install_qt() - -vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_PACKAGES_DIR}/lib/cmake - PATCHES "${CMAKE_CURRENT_LIST_DIR}/add-private-header-paths.patch" -) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -file(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(REMOVE ${BINARY_TOOLS}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/cmake - LOGNAME fix-cmake -) - -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) - - -#--------------------------------------------------------------------------- -# Qt5Bootstrap: a release-only dependency -#--------------------------------------------------------------------------- -# Remove release-only Qt5Bootstrap.lib from debug folders: -#file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.lib) -#file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.prl) -# Above approach does not work: -# check_matching_debug_and_release_binaries(dbg_libs, rel_libs) -# requires the two sets to be of equal size! -# Alt. approach, create dummy folder instead: -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/dont-use) -file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/dont-use) -file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.prl DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/dont-use) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.lib) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.prl) -#--------------------------------------------------------------------------- - -#--------------------------------------------------------------------------- -# qtmain(d) vs. Qt5AxServer(d) -#--------------------------------------------------------------------------- -# Qt applications have to either link to qtmain(d) or to Qt5AxServer(d), -# never both. See http://doc.qt.io/qt-5/activeqt-server.html for more info. -# -# Create manual-link folders: -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) -# -# Either have users explicitly link against qtmain.lib, qtmaind.lib: -file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) -file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) -file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib) -file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl) -file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) -file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl) -# -# ... or have users explicitly link against Qt5AxServer.lib, Qt5AxServerd.lib: -file(COPY ${CURRENT_PACKAGES_DIR}/lib/Qt5AxServer.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) -file(COPY ${CURRENT_PACKAGES_DIR}/lib/Qt5AxServer.prl DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) -file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/Qt5AxServer.lib) -file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/Qt5AxServer.prl) -file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5AxServerd.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) -file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5AxServerd.prl DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5AxServerd.lib) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5AxServerd.prl) -#--------------------------------------------------------------------------- - -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5 RENAME copyright) -if(EXISTS ${CURRENT_PACKAGES_DIR}/plugins) - file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/qtdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/plugins) -endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/plugins) - file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/qtdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/debug/plugins) -endif() diff --git a/ports/qt5/qtdeploy.ps1 b/ports/qt5/qtdeploy.ps1 deleted file mode 100644 index 9d514e411..000000000 --- a/ports/qt5/qtdeploy.ps1 +++ /dev/null @@ -1,68 +0,0 @@ -# This script is based on the implementation of windeployqt for qt5.7.1 -# -# Qt's plugin deployment strategy is that each main Qt Module has a hardcoded -# set of plugin subdirectories. Each of these subdirectories is deployed in -# full if that Module is referenced. -# -# This hardcoded list is found inside qttools\src\windeployqt\main.cpp. For -# updating, inspect the symbols qtModuleEntries and qtModuleForPlugin. - -# Note: this function signature and behavior is depended upon by applocal.ps1 -function deployPluginsIfQt([string]$targetBinaryDir, [string]$QtPluginsDir, [string]$targetBinaryName) { - - function deployPlugins([string]$pluginSubdirName) { - if (Test-Path "$QtPluginsDir\$pluginSubdirName") { - Write-Verbose " Deploying plugins directory '$pluginSubdirName'" - New-Item "$targetBinaryDir\$pluginSubdirName" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null - Get-ChildItem "$QtPluginsDir\$pluginSubdirName\*.dll" | % { - deployBinary "$targetBinaryDir\$pluginSubdirName" "$QtPluginsDir\$pluginSubdirName" $_.Name - } - } else { - Write-Verbose " Skipping plugins directory '$pluginSubdirName': doesn't exist" - } - } - - # We detect Qt modules in use via the DLLs themselves. See qtModuleEntries in Qt to find the mapping. - if ($targetBinaryName -like "Qt5Gui*.dll") { - Write-Verbose " Deploying platforms" - New-Item "$targetBinaryDir\platforms" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null - Get-ChildItem "$QtPluginsDir\platforms\qwindows*.dll" | % { - deployBinary "$targetBinaryDir\platforms" "$QtPluginsDir\platforms" $_.Name - } - - deployPlugins "accessible" - deployPlugins "imageformats" - deployPlugins "iconengines" - deployPlugins "platforminputcontexts" - } elseif ($targetBinaryName -like "Qt5Network*.dll") { - deployPlugins "bearer" - } elseif ($targetBinaryName -like "Qt5Sql*.dll") { - deployPlugins "sqldrivers" - } elseif ($targetBinaryName -like "Qt5Multimedia*.dll") { - deployPlugins "audio" - deployPlugins "mediaservice" - deployPlugins "playlistformats" - } elseif ($targetBinaryName -like "Qt5PrintSupport*.dll") { - deployPlugins "printsupport" - } elseif ($targetBinaryName -like "Qt5Quick*.dll") { - deployPlugins "scenegraph" - deployPlugins "qmltooling" - } elseif ($targetBinaryName -like "Qt5Declarative*.dll") { - deployPlugins "qml1tooling" - } elseif ($targetBinaryName -like "Qt5Positioning*.dll") { - deployPlugins "position" - } elseif ($targetBinaryName -like "Qt5Location*.dll") { - deployPlugins "geoservices" - } elseif ($targetBinaryName -like "Qt5Sensors*.dll") { - deployPlugins "sensors" - deployPlugins "sensorgestures" - } elseif ($targetBinaryName -like "Qt5WebEngineCore*.dll") { - deployPlugins "qtwebengine" - } elseif ($targetBinaryName -like "Qt53DRenderer*.dll") { - deployPlugins "sceneparsers" - } elseif ($targetBinaryName -like "Qt5TextToSpeech*.dll") { - deployPlugins "texttospeech" - } elseif ($targetBinaryName -like "Qt5SerialBus*.dll") { - deployPlugins "canbus" - } -} -- cgit v1.2.3 From 3ba22c17540fc761c4fb3410ccd75cecb0f1f8b5 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 16 Oct 2017 23:04:16 +1100 Subject: working qt tools build --- ports/qt5base/configure_qt.cmake | 5 +- ports/qt5base/fix-debug-qmakespecs.patch | 62 +++++++++++++++++++++++ ports/qt5base/portfile.cmake | 27 +++------- ports/qt5declarative/CONTROL | 4 ++ ports/qt5declarative/portfile.cmake | 44 ++++++++++++++++ ports/qt5doc/CONTROL | 4 ++ ports/qt5doc/portfile.cmake | 44 ++++++++++++++++ ports/qt5tools/portfile.cmake | 19 ++++--- ports/qt5winextras/CONTROL | 4 ++ ports/qt5winextras/portfile.cmake | 44 ++++++++++++++++ scripts/cmake/vcpkg_build_qmake.cmake | 4 +- scripts/cmake/vcpkg_build_qmake_debug.cmake | 29 +++++++++++ scripts/cmake/vcpkg_build_qmake_release.cmake | 29 +++++++++++ scripts/cmake/vcpkg_common_functions.cmake | 4 ++ scripts/cmake/vcpkg_configure_qmake_debug.cmake | 41 +++++++++++++++ scripts/cmake/vcpkg_configure_qmake_release.cmake | 43 ++++++++++++++++ 16 files changed, 377 insertions(+), 30 deletions(-) create mode 100644 ports/qt5base/fix-debug-qmakespecs.patch create mode 100644 ports/qt5declarative/CONTROL create mode 100644 ports/qt5declarative/portfile.cmake create mode 100644 ports/qt5doc/CONTROL create mode 100644 ports/qt5doc/portfile.cmake create mode 100644 ports/qt5winextras/CONTROL create mode 100644 ports/qt5winextras/portfile.cmake create mode 100644 scripts/cmake/vcpkg_build_qmake_debug.cmake create mode 100644 scripts/cmake/vcpkg_build_qmake_release.cmake create mode 100644 scripts/cmake/vcpkg_configure_qmake_debug.cmake create mode 100644 scripts/cmake/vcpkg_configure_qmake_release.cmake diff --git a/ports/qt5base/configure_qt.cmake b/ports/qt5base/configure_qt.cmake index fea8de923..315c48bdf 100644 --- a/ports/qt5base/configure_qt.cmake +++ b/ports/qt5base/configure_qt.cmake @@ -29,10 +29,11 @@ function(configure_qt) -debug -prefix ${CURRENT_PACKAGES_DIR}/debug -hostbindir ${CURRENT_PACKAGES_DIR}/debug/tools/qt5 - -archdatadir ${CURRENT_PACKAGES_DIR}/debug/share/qt5 - -datadir ${CURRENT_PACKAGES_DIR}/debug/share/qt5 + -archdatadir ${CURRENT_PACKAGES_DIR}/share/qt5/debug + -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 -I ${CURRENT_INSTALLED_DIR}/include -L ${CURRENT_INSTALLED_DIR}/debug/lib -platform ${PLATFORM} diff --git a/ports/qt5base/fix-debug-qmakespecs.patch b/ports/qt5base/fix-debug-qmakespecs.patch new file mode 100644 index 000000000..2e069cfeb --- /dev/null +++ b/ports/qt5base/fix-debug-qmakespecs.patch @@ -0,0 +1,62 @@ +diff --git a/mkspecs/modules/qt_lib_gui_private.pri b/mkspecs/modules/qt_lib_gui_private.pri +index 5473e78..c5e7448 100644 +--- a/mkspecs/modules/qt_lib_gui_private.pri ++++ b/mkspecs/modules/qt_lib_gui_private.pri +@@ -11,4 +11,9 @@ QT.gui_private.enabled_features = direct2d directwrite directwrite2 freetype gif + QT.gui_private.disabled_features = xcb accessibility-atspi-bridge angle_d3d11_qdtd directfb egl egl_x11 eglfs eglfs_brcm eglfs_egldevice eglfs_gbm eglfs_mali eglfs_viv eglfs_viv_wl evdev fontconfig integrityfb integrityhid kms libinput libinput-axis-api linuxfb mirclient mtdev system-freetype system-xcb tslib vnc xkbcommon-evdev xlib + QMAKE_LIBS_HARFBUZZ = -lharfbuzz + QMAKE_LIBS_LIBJPEG = -ljpeg +-QMAKE_LIBS_LIBPNG = -llibpng16 ++CONFIG(release, debug|release) { ++ QMAKE_LIBS_LIBPNG = -llibpng16 ++} ++CONFIG(debug, debug|release) { ++ QMAKE_LIBS_LIBPNG = -llibpng16d ++} +diff --git a/mkspecs/qconfig.pri b/mkspecs/qconfig.pri +index 2af37df..646b8e5 100644 +--- a/mkspecs/qconfig.pri ++++ b/mkspecs/qconfig.pri +@@ -2,8 +2,14 @@ QT_ARCH = x86_64 + QT_BUILDABI = x86_64-little_endian-lp64 + QT.global.enabled_features = shared c++11 concurrent + QT.global.disabled_features = cross_compile framework rpath appstore-compliant debug_and_release simulator_and_device build_all c++14 c++1z pkg-config force_asserts separate_debug_info static +-QT_CONFIG += shared release c++11 concurrent dbus no-pkg-config stl +-CONFIG += shared release no_plugin_manifest ++CONFIG(release, debug|release) { ++ QT_CONFIG += shared release c++11 concurrent dbus no-pkg-config stl ++ CONFIG += shared release no_plugin_manifest ++} ++CONFIG(debug, debug|release) { ++ QT_CONFIG += shared debug c++11 concurrent dbus no-pkg-config release_tools stl ++ CONFIG += shared debug no_plugin_manifest ++} + QT_VERSION = 5.9.2 + QT_MAJOR_VERSION = 5 + QT_MINOR_VERSION = 9 +diff --git a/mkspecs/qmodule.pri b/mkspecs/qmodule.pri +index 3e213d4..00a37ca 100644 +--- a/mkspecs/qmodule.pri ++++ b/mkspecs/qmodule.pri +@@ -1,10 +1,17 @@ + EXTRA_INCLUDEPATH += C:/vcpkg/installed/x64-windows/include +-EXTRA_LIBDIR += C:/vcpkg/installed/x64-windows/lib ++CONFIG(release, debug|release) { ++ EXTRA_LIBDIR += C:/vcpkg/installed/x64-windows/lib ++ QT.global_private.enabled_features = alloca_malloc_h alloca sse2 dbus gui network qml-debug sql system-zlib testlib widgets xml ++ QT.global_private.disabled_features = alloca_h android-style-assets private_tests dbus-linked libudev posix_fallocate reduce_exports reduce_relocations release_tools stack-protector-strong ++ QMAKE_LIBS_ZLIB = -lzlib ++} ++CONFIG(debug, debug|release) { ++ QT.global_private.enabled_features = alloca_malloc_h alloca sse2 dbus gui network qml-debug release_tools sql system-zlib testlib widgets xml ++ QT.global_private.disabled_features = alloca_h android-style-assets private_tests dbus-linked libudev posix_fallocate reduce_exports reduce_relocations stack-protector-strong ++ QMAKE_LIBS_ZLIB = -lzlibd ++} + QT_CPU_FEATURES.x86_64 = sse sse2 +-QT.global_private.enabled_features = alloca_malloc_h alloca sse2 dbus gui network qml-debug sql system-zlib testlib widgets xml +-QT.global_private.disabled_features = alloca_h android-style-assets private_tests dbus-linked libudev posix_fallocate reduce_exports reduce_relocations release_tools stack-protector-strong + QT_COORD_TYPE = double +-QMAKE_LIBS_ZLIB = -lzlib + CONFIG += sse2 sse3 ssse3 sse4_1 sse4_2 avx avx2 compile_examples f16c largefile msvc_mp precompile_header + QT_BUILD_PARTS += libs tools + QT_HOST_CFLAGS_DBUS += diff --git a/ports/qt5base/portfile.cmake b/ports/qt5base/portfile.cmake index 359c81990..047f167fb 100644 --- a/ports/qt5base/portfile.cmake +++ b/ports/qt5base/portfile.cmake @@ -70,16 +70,22 @@ configure_qt( install_qt() +#vcpkg_apply_patches( +# SOURCE_PATH ${CURRENT_PACKAGES_DIR}/share/qt5 +# PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-debug-qmakespecs.patch" +#) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +#file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +#file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) 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}) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) vcpkg_execute_required_process( COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py @@ -89,21 +95,4 @@ vcpkg_execute_required_process( vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) -#--------------------------------------------------------------------------- -# Qt5Bootstrap: a release-only dependency -#--------------------------------------------------------------------------- -# Remove release-only Qt5Bootstrap.lib from debug folders: -#file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.lib) -#file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.prl) -# Above approach does not work: -# check_matching_debug_and_release_binaries(dbg_libs, rel_libs) -# requires the two sets to be of equal size! -# Alt. approach, create dummy folder instead: -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/dont-use) -file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/dont-use) -file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.prl DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/dont-use) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.lib) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.prl) -#--------------------------------------------------------------------------- - file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5base RENAME copyright) \ No newline at end of file diff --git a/ports/qt5declarative/CONTROL b/ports/qt5declarative/CONTROL new file mode 100644 index 000000000..67ffc3212 --- /dev/null +++ b/ports/qt5declarative/CONTROL @@ -0,0 +1,4 @@ +Source: qt5declarative +Version: 5.9.2-0 +Description: Qt5 Declarative (Quick 2) +Build-Depends: qt5base \ No newline at end of file diff --git a/ports/qt5declarative/portfile.cmake b/ports/qt5declarative/portfile.cmake new file mode 100644 index 000000000..b6a24946b --- /dev/null +++ b/ports/qt5declarative/portfile.cmake @@ -0,0 +1,44 @@ +include(vcpkg_common_functions) + +string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) +if(BUILDTREES_PATH_LENGTH GREATER 27) + 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 "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") + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) + +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") + +vcpkg_configure_qmake( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} + OPTIONS "CONFIG+=debug_and_release" +) + +vcpkg_build_qmake() diff --git a/ports/qt5doc/CONTROL b/ports/qt5doc/CONTROL new file mode 100644 index 000000000..aef693586 --- /dev/null +++ b/ports/qt5doc/CONTROL @@ -0,0 +1,4 @@ +Source: qt5doc +Version: 5.9.2-0 +Description: Qt5 Document Creation Module +Build-Depends: qt5base \ No newline at end of file diff --git a/ports/qt5doc/portfile.cmake b/ports/qt5doc/portfile.cmake new file mode 100644 index 000000000..9cacc8166 --- /dev/null +++ b/ports/qt5doc/portfile.cmake @@ -0,0 +1,44 @@ +include(vcpkg_common_functions) + +string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) +if(BUILDTREES_PATH_LENGTH GREATER 27) + 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 "qtdoc-5.9.2") +set(ARCHIVE_NAME "qtdoc-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 9352856d5ef48afa28771f05cbf5bc7b3a49181b4696bd018a8294cbfc3a6d25de6625830f0ba776689deb098d7eb549dd19b362cbb5ecfda1b2d6d2e15ef43f +) +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") + +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release() diff --git a/ports/qt5tools/portfile.cmake b/ports/qt5tools/portfile.cmake index 6d01d6333..2a2e5cd4d 100644 --- a/ports/qt5tools/portfile.cmake +++ b/ports/qt5tools/portfile.cmake @@ -31,19 +31,24 @@ endif() # This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings set(ENV{_CL_} "/utf-8") -#Clean up build directories -file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() -vcpkg_configure_qmake( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} - OPTIONS "CONFIG+=release" +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} ) -vcpkg_build_qmake() +vcpkg_build_qmake_release() -file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/bin/*.exe") +file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/*.exe") file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) file(REMOVE ${BINARY_TOOLS}) +file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/bin/*.exe") +file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/qt5) +file(REMOVE ${BINARY_TOOLS}) file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5tools RENAME copyright) diff --git a/ports/qt5winextras/CONTROL b/ports/qt5winextras/CONTROL new file mode 100644 index 000000000..67117a9fa --- /dev/null +++ b/ports/qt5winextras/CONTROL @@ -0,0 +1,4 @@ +Source: qt5winextras +Version: 5.9.2-0 +Description: Qt5 Windows extras +Build-Depends: qt5base, atlmfc \ No newline at end of file diff --git a/ports/qt5winextras/portfile.cmake b/ports/qt5winextras/portfile.cmake new file mode 100644 index 000000000..678a8a214 --- /dev/null +++ b/ports/qt5winextras/portfile.cmake @@ -0,0 +1,44 @@ +include(vcpkg_common_functions) + +string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) +if(BUILDTREES_PATH_LENGTH GREATER 27) + 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 "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") + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release() + +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index bee5da7c9..693f7841e 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -15,7 +15,7 @@ function(vcpkg_build_qmake) vcpkg_find_acquire_program(JOM) # Make sure that the linker finds the libraries used - set(ENV_PATH_BACKUP ENV{PATH}) + set(ENV_PATH_BACKUP "$ENV{PATH}") set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;$ENV{PATH}") message(STATUS "Package ${TARGET_TRIPLET}") @@ -27,5 +27,5 @@ function(vcpkg_build_qmake) message(STATUS "Package ${TARGET_TRIPLET} done") # Restore the original value of ENV{PATH} - set(ENV{PATH} ENV_PATH_BACKUP) + set(ENV{PATH} "${ENV_PATH_BACKUP}") endfunction() diff --git a/scripts/cmake/vcpkg_build_qmake_debug.cmake b/scripts/cmake/vcpkg_build_qmake_debug.cmake new file mode 100644 index 000000000..7e5625850 --- /dev/null +++ b/scripts/cmake/vcpkg_build_qmake_debug.cmake @@ -0,0 +1,29 @@ +#.rst: +# .. command:: vcpkg_build_qmake_debug +# +# Build a qmake-based project, previously configured using vcpkg_configure_qmake_debug. +# +# :: +# vcpkg_build_qmake_debug() +# +# +# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html + +function(vcpkg_build_qmake_debug) + vcpkg_find_acquire_program(JOM) + + # Make sure that the linker finds the libraries used + set(ENV_PATH_BACKUP "$ENV{PATH}") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/debug/tools/qt5;$ENV{PATH}") + + message(STATUS "Package ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND ${JOM} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME package-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Package ${TARGET_TRIPLET}-dbg done") + + # Restore the original value of ENV{PATH} + set(ENV{PATH} "${ENV_PATH_BACKUP}") +endfunction() diff --git a/scripts/cmake/vcpkg_build_qmake_release.cmake b/scripts/cmake/vcpkg_build_qmake_release.cmake new file mode 100644 index 000000000..6cfbcdc91 --- /dev/null +++ b/scripts/cmake/vcpkg_build_qmake_release.cmake @@ -0,0 +1,29 @@ +#.rst: +# .. command:: vcpkg_build_qmake_release +# +# Build a qmake-based project, previously configured using vcpkg_configure_qmake_release. +# +# :: +# vcpkg_build_qmake_release() +# +# +# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html + +function(vcpkg_build_qmake_release) + vcpkg_find_acquire_program(JOM) + + # Make sure that the linker finds the libraries used + set(ENV_PATH_BACKUP "$ENV{PATH}") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;$ENV{PATH}") + + message(STATUS "Package ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND ${JOM} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME package-${TARGET_TRIPLET}-rel + ) + message(STATUS "Package ${TARGET_TRIPLET}-rel done") + + # Restore the original value of ENV{PATH} + set(ENV{PATH} "${ENV_PATH_BACKUP}") +endfunction() diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 81e8e5813..5dabd446e 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -10,11 +10,15 @@ include(vcpkg_from_bitbucket) include(vcpkg_build_cmake) include(vcpkg_build_msbuild) include(vcpkg_build_qmake) +include(vcpkg_build_qmake_debug) +include(vcpkg_build_qmake_release) include(vcpkg_install_cmake) include(vcpkg_install_meson) include(vcpkg_configure_cmake) include(vcpkg_configure_meson) include(vcpkg_configure_qmake) +include(vcpkg_configure_qmake_debug) +include(vcpkg_configure_qmake_release) include(vcpkg_apply_patches) include(vcpkg_copy_pdbs) include(vcpkg_copy_tool_dependencies) diff --git a/scripts/cmake/vcpkg_configure_qmake_debug.cmake b/scripts/cmake/vcpkg_configure_qmake_debug.cmake new file mode 100644 index 000000000..0166973d2 --- /dev/null +++ b/scripts/cmake/vcpkg_configure_qmake_debug.cmake @@ -0,0 +1,41 @@ +#.rst: +# .. command:: vcpkg_configure_qmake_debug +# +# Configure a qmake-based project. +# This sets the config variable to debug and outputs to +# a debug triplet directory. +# +# :: +# vcpkg_configure_qmake_debug(SOURCE_PATH +# [OPTIONS arg1 [arg2 ...]] +# ) +# +# ``SOURCE_PATH`` +# The path to the *.pro qmake project file. +# ``OPTIONS`` +# The options passed to qmake. +# +# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html + +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) + + if(NOT QMAKE_COMMAND) + message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") + endif() + + # Cleanup build directories + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + + 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} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") +endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_configure_qmake_release.cmake b/scripts/cmake/vcpkg_configure_qmake_release.cmake new file mode 100644 index 000000000..67bdbdfb0 --- /dev/null +++ b/scripts/cmake/vcpkg_configure_qmake_release.cmake @@ -0,0 +1,43 @@ +#.rst: +# .. command:: vcpkg_configure_qmake_release +# +# Configure a qmake-based project. +# This sets the config variable to release and outputs to +# a release triplet directory. +# +# :: +# vcpkg_configure_qmake_release(SOURCE_PATH +# [OPTIONS arg1 [arg2 ...]] +# ) +# +# ``SOURCE_PATH`` +# The path to the *.pro qmake project file. +# ``OPTIONS`` +# The options passed to qmake. +# +# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html + +function(vcpkg_configure_qmake_release) + cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) + + # 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() + + # Cleanup build directories + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + + 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} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME config-${TARGET_TRIPLET}-rel + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + unset(QMAKE_COMMAND PARENT_SCOPE) + unset(QMAKE_COMMAND CACHE) +endfunction() \ No newline at end of file -- cgit v1.2.3 From d28de4a13edca249086e3ccf8d34e92ecb10006d Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 16 Oct 2017 23:56:47 +1100 Subject: qt5winextras --- ports/qt5base/fix-debug-qmakespecs.patch | 62 ----------------------- ports/qt5base/install_qt.cmake | 1 - ports/qt5base/portfile.cmake | 7 --- ports/qt5winextras/fixcmake.py | 48 ++++++++++++++++++ ports/qt5winextras/portfile.cmake | 41 +++++++++++++-- scripts/cmake/vcpkg_configure_qmake_debug.cmake | 3 ++ scripts/cmake/vcpkg_configure_qmake_release.cmake | 1 + 7 files changed, 90 insertions(+), 73 deletions(-) delete mode 100644 ports/qt5base/fix-debug-qmakespecs.patch create mode 100644 ports/qt5winextras/fixcmake.py diff --git a/ports/qt5base/fix-debug-qmakespecs.patch b/ports/qt5base/fix-debug-qmakespecs.patch deleted file mode 100644 index 2e069cfeb..000000000 --- a/ports/qt5base/fix-debug-qmakespecs.patch +++ /dev/null @@ -1,62 +0,0 @@ -diff --git a/mkspecs/modules/qt_lib_gui_private.pri b/mkspecs/modules/qt_lib_gui_private.pri -index 5473e78..c5e7448 100644 ---- a/mkspecs/modules/qt_lib_gui_private.pri -+++ b/mkspecs/modules/qt_lib_gui_private.pri -@@ -11,4 +11,9 @@ QT.gui_private.enabled_features = direct2d directwrite directwrite2 freetype gif - QT.gui_private.disabled_features = xcb accessibility-atspi-bridge angle_d3d11_qdtd directfb egl egl_x11 eglfs eglfs_brcm eglfs_egldevice eglfs_gbm eglfs_mali eglfs_viv eglfs_viv_wl evdev fontconfig integrityfb integrityhid kms libinput libinput-axis-api linuxfb mirclient mtdev system-freetype system-xcb tslib vnc xkbcommon-evdev xlib - QMAKE_LIBS_HARFBUZZ = -lharfbuzz - QMAKE_LIBS_LIBJPEG = -ljpeg --QMAKE_LIBS_LIBPNG = -llibpng16 -+CONFIG(release, debug|release) { -+ QMAKE_LIBS_LIBPNG = -llibpng16 -+} -+CONFIG(debug, debug|release) { -+ QMAKE_LIBS_LIBPNG = -llibpng16d -+} -diff --git a/mkspecs/qconfig.pri b/mkspecs/qconfig.pri -index 2af37df..646b8e5 100644 ---- a/mkspecs/qconfig.pri -+++ b/mkspecs/qconfig.pri -@@ -2,8 +2,14 @@ QT_ARCH = x86_64 - QT_BUILDABI = x86_64-little_endian-lp64 - QT.global.enabled_features = shared c++11 concurrent - QT.global.disabled_features = cross_compile framework rpath appstore-compliant debug_and_release simulator_and_device build_all c++14 c++1z pkg-config force_asserts separate_debug_info static --QT_CONFIG += shared release c++11 concurrent dbus no-pkg-config stl --CONFIG += shared release no_plugin_manifest -+CONFIG(release, debug|release) { -+ QT_CONFIG += shared release c++11 concurrent dbus no-pkg-config stl -+ CONFIG += shared release no_plugin_manifest -+} -+CONFIG(debug, debug|release) { -+ QT_CONFIG += shared debug c++11 concurrent dbus no-pkg-config release_tools stl -+ CONFIG += shared debug no_plugin_manifest -+} - QT_VERSION = 5.9.2 - QT_MAJOR_VERSION = 5 - QT_MINOR_VERSION = 9 -diff --git a/mkspecs/qmodule.pri b/mkspecs/qmodule.pri -index 3e213d4..00a37ca 100644 ---- a/mkspecs/qmodule.pri -+++ b/mkspecs/qmodule.pri -@@ -1,10 +1,17 @@ - EXTRA_INCLUDEPATH += C:/vcpkg/installed/x64-windows/include --EXTRA_LIBDIR += C:/vcpkg/installed/x64-windows/lib -+CONFIG(release, debug|release) { -+ EXTRA_LIBDIR += C:/vcpkg/installed/x64-windows/lib -+ QT.global_private.enabled_features = alloca_malloc_h alloca sse2 dbus gui network qml-debug sql system-zlib testlib widgets xml -+ QT.global_private.disabled_features = alloca_h android-style-assets private_tests dbus-linked libudev posix_fallocate reduce_exports reduce_relocations release_tools stack-protector-strong -+ QMAKE_LIBS_ZLIB = -lzlib -+} -+CONFIG(debug, debug|release) { -+ QT.global_private.enabled_features = alloca_malloc_h alloca sse2 dbus gui network qml-debug release_tools sql system-zlib testlib widgets xml -+ QT.global_private.disabled_features = alloca_h android-style-assets private_tests dbus-linked libudev posix_fallocate reduce_exports reduce_relocations stack-protector-strong -+ QMAKE_LIBS_ZLIB = -lzlibd -+} - QT_CPU_FEATURES.x86_64 = sse sse2 --QT.global_private.enabled_features = alloca_malloc_h alloca sse2 dbus gui network qml-debug sql system-zlib testlib widgets xml --QT.global_private.disabled_features = alloca_h android-style-assets private_tests dbus-linked libudev posix_fallocate reduce_exports reduce_relocations release_tools stack-protector-strong - QT_COORD_TYPE = double --QMAKE_LIBS_ZLIB = -lzlib - CONFIG += sse2 sse3 ssse3 sse4_1 sse4_2 avx avx2 compile_examples f16c largefile msvc_mp precompile_header - QT_BUILD_PARTS += libs tools - QT_HOST_CFLAGS_DBUS += diff --git a/ports/qt5base/install_qt.cmake b/ports/qt5base/install_qt.cmake index 1b0bec935..922303aba 100644 --- a/ports/qt5base/install_qt.cmake +++ b/ports/qt5base/install_qt.cmake @@ -10,7 +10,6 @@ function(install_qt) vcpkg_find_acquire_program(JOM) vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) - set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") set(_path "$ENV{PATH}") diff --git a/ports/qt5base/portfile.cmake b/ports/qt5base/portfile.cmake index 047f167fb..5368c3a4a 100644 --- a/ports/qt5base/portfile.cmake +++ b/ports/qt5base/portfile.cmake @@ -70,15 +70,8 @@ configure_qt( install_qt() -#vcpkg_apply_patches( -# SOURCE_PATH ${CURRENT_PACKAGES_DIR}/share/qt5 -# PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-debug-qmakespecs.patch" -#) - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) -#file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -#file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) diff --git a/ports/qt5winextras/fixcmake.py b/ports/qt5winextras/fixcmake.py new file mode 100644 index 000000000..d55ca7754 --- /dev/null +++ b/ports/qt5winextras/fixcmake.py @@ -0,0 +1,48 @@ +import os +import re +from glob import glob + +files = [y for x in os.walk('.') for y in glob(os.path.join(x[0], '*.cmake'))] + +for f in files: + openedfile = open(f, "r") + builder = "" + dllpattern = re.compile("_install_prefix}/bin/Qt5.*d.dll") + libpattern = re.compile("_install_prefix}/lib/Qt5.*d.lib") + exepattern = re.compile("_install_prefix}/bin/[a-z]+.exe") + for line in openedfile: + if "_install_prefix}/bin/${LIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/bin/", "/debug/bin/") + builder += " endif()\n" + elif "_install_prefix}/lib/${LIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/lib/", "/debug/lib/") + builder += " endif()\n" + elif "_install_prefix}/lib/${IMPLIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/lib/", "/debug/lib/") + builder += " endif()\n" + elif "_install_prefix}/plugins/${PLUGIN_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/plugins/", "/debug/plugins/") + builder += " endif()\n" + elif dllpattern.search(line) != None: + builder += line.replace("/bin/", "/debug/bin/") + elif libpattern.search(line) != None: + builder += line.replace("/lib/", "/debug/lib/") + elif exepattern.search(line) != None: + builder += line.replace("/bin/", "/tools/qt5/") + else: + builder += line + new_file = open(f, "w") + new_file.write(builder) + new_file.close() \ No newline at end of file diff --git a/ports/qt5winextras/portfile.cmake b/ports/qt5winextras/portfile.cmake index 678a8a214..800e3490b 100644 --- a/ports/qt5winextras/portfile.cmake +++ b/ports/qt5winextras/portfile.cmake @@ -31,14 +31,49 @@ endif() # This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings set(ENV{_CL_} "/utf-8") +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + vcpkg_configure_qmake_release( SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} ) vcpkg_build_qmake_release() -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") +set(_path "$ENV{PATH}") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake ) -vcpkg_build_qmake_debug() \ No newline at end of file +set(ENV{PATH} "${_path}") + +file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") +file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") +file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5winextras RENAME copyright) \ No newline at end of file diff --git a/scripts/cmake/vcpkg_configure_qmake_debug.cmake b/scripts/cmake/vcpkg_configure_qmake_debug.cmake index 0166973d2..e3dfb0777 100644 --- a/scripts/cmake/vcpkg_configure_qmake_debug.cmake +++ b/scripts/cmake/vcpkg_configure_qmake_debug.cmake @@ -38,4 +38,7 @@ function(vcpkg_configure_qmake_debug) LOGNAME config-${TARGET_TRIPLET}-dbg ) message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + unset(QMAKE_COMMAND) + unset(QMAKE_COMMAND PARENT_SCOPE) + unset(QMAKE_COMMAND CACHE) endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_configure_qmake_release.cmake b/scripts/cmake/vcpkg_configure_qmake_release.cmake index 67bdbdfb0..8ab5340e9 100644 --- a/scripts/cmake/vcpkg_configure_qmake_release.cmake +++ b/scripts/cmake/vcpkg_configure_qmake_release.cmake @@ -38,6 +38,7 @@ function(vcpkg_configure_qmake_release) LOGNAME config-${TARGET_TRIPLET}-rel ) message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + unset(QMAKE_COMMAND) unset(QMAKE_COMMAND PARENT_SCOPE) unset(QMAKE_COMMAND CACHE) endfunction() \ No newline at end of file -- cgit v1.2.3 From c147fc78c919d6084e5f98a574484346d590f00d Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 17 Oct 2017 03:15:30 +1100 Subject: further fixes --- ports/qt5base/qt_debug.conf | 13 +++++++ ports/qt5base/qt_release.conf | 13 +++++++ ports/qt5declarative/fixcmake.py | 48 ++++++++++++++++++++++++++ ports/qt5declarative/portfile.cmake | 49 ++++++++++++++++++++++++--- ports/qt5doc/CONTROL | 4 --- ports/qt5doc/portfile.cmake | 44 ------------------------ ports/qt5docs/CONTROL | 4 +++ ports/qt5docs/portfile.cmake | 40 ++++++++++++++++++++++ ports/qt5tools/fixcmake.py | 48 ++++++++++++++++++++++++++ ports/qt5tools/portfile.cmake | 32 +++++++++++++++++ ports/qt5winextras/portfile.cmake | 6 ++-- scripts/cmake/vcpkg_build_qmake_debug.cmake | 3 +- scripts/cmake/vcpkg_build_qmake_release.cmake | 5 +-- 13 files changed, 251 insertions(+), 58 deletions(-) create mode 100644 ports/qt5base/qt_debug.conf create mode 100644 ports/qt5base/qt_release.conf create mode 100644 ports/qt5declarative/fixcmake.py delete mode 100644 ports/qt5doc/CONTROL delete mode 100644 ports/qt5doc/portfile.cmake create mode 100644 ports/qt5docs/CONTROL create mode 100644 ports/qt5docs/portfile.cmake create mode 100644 ports/qt5tools/fixcmake.py diff --git a/ports/qt5base/qt_debug.conf b/ports/qt5base/qt_debug.conf new file mode 100644 index 000000000..96e4a2a4d --- /dev/null +++ b/ports/qt5base/qt_debug.conf @@ -0,0 +1,13 @@ +[Paths] +Prefix = C:/vcpkg/installed/x64-windows +Documentation = share/qt5/debug/doc +Headers = share/qt5/debug/include +Libraries = debug/lib +Binaries = debug/tools/qt5 +LibraryExecutables = debug/tools/qt5 +Plugins = debug/plugins +Qml2Imports = qml +Data = share/qt5/debug +ArchData = share/qt5/debug +HostData = share/qt5/debug +HostBinaries = debug/tools/qt5 \ No newline at end of file diff --git a/ports/qt5base/qt_release.conf b/ports/qt5base/qt_release.conf new file mode 100644 index 000000000..ddd9d1880 --- /dev/null +++ b/ports/qt5base/qt_release.conf @@ -0,0 +1,13 @@ +[Paths] +Prefix = C:/vcpkg/installed/x64-windows +Documentation = share/qt5/doc +Headers = include +Libraries = lib +Binaries = tools/qt5 +LibraryExecutables = tools/qt5 +Plugins = plugins +Qml2Imports = qml +Data = share/qt5 +ArchData = share/qt5 +HostData = share/qt5 +HostBinaries = tools/qt5 \ No newline at end of file diff --git a/ports/qt5declarative/fixcmake.py b/ports/qt5declarative/fixcmake.py new file mode 100644 index 000000000..d55ca7754 --- /dev/null +++ b/ports/qt5declarative/fixcmake.py @@ -0,0 +1,48 @@ +import os +import re +from glob import glob + +files = [y for x in os.walk('.') for y in glob(os.path.join(x[0], '*.cmake'))] + +for f in files: + openedfile = open(f, "r") + builder = "" + dllpattern = re.compile("_install_prefix}/bin/Qt5.*d.dll") + libpattern = re.compile("_install_prefix}/lib/Qt5.*d.lib") + exepattern = re.compile("_install_prefix}/bin/[a-z]+.exe") + for line in openedfile: + if "_install_prefix}/bin/${LIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/bin/", "/debug/bin/") + builder += " endif()\n" + elif "_install_prefix}/lib/${LIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/lib/", "/debug/lib/") + builder += " endif()\n" + elif "_install_prefix}/lib/${IMPLIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/lib/", "/debug/lib/") + builder += " endif()\n" + elif "_install_prefix}/plugins/${PLUGIN_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/plugins/", "/debug/plugins/") + builder += " endif()\n" + elif dllpattern.search(line) != None: + builder += line.replace("/bin/", "/debug/bin/") + elif libpattern.search(line) != None: + builder += line.replace("/lib/", "/debug/lib/") + elif exepattern.search(line) != None: + builder += line.replace("/bin/", "/tools/qt5/") + else: + builder += line + new_file = open(f, "w") + new_file.write(builder) + new_file.close() \ No newline at end of file diff --git a/ports/qt5declarative/portfile.cmake b/ports/qt5declarative/portfile.cmake index b6a24946b..48ab900ce 100644 --- a/ports/qt5declarative/portfile.cmake +++ b/ports/qt5declarative/portfile.cmake @@ -33,12 +33,53 @@ set(ENV{_CL_} "/utf-8") vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) - set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") -vcpkg_configure_qmake( +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + +vcpkg_configure_qmake_release( SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} - OPTIONS "CONFIG+=debug_and_release" ) -vcpkg_build_qmake() +vcpkg_build_qmake_release() + +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake +) + +set(ENV{PATH} "${_path}") + +file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/*.exe") +file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) +file(REMOVE ${BINARY_TOOLS}) +file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/bin/*.exe") +file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/qt5) +file(REMOVE ${BINARY_TOOLS}) + +file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") +file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") +file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5declarative RENAME copyright) \ No newline at end of file diff --git a/ports/qt5doc/CONTROL b/ports/qt5doc/CONTROL deleted file mode 100644 index aef693586..000000000 --- a/ports/qt5doc/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5doc -Version: 5.9.2-0 -Description: Qt5 Document Creation Module -Build-Depends: qt5base \ No newline at end of file diff --git a/ports/qt5doc/portfile.cmake b/ports/qt5doc/portfile.cmake deleted file mode 100644 index 9cacc8166..000000000 --- a/ports/qt5doc/portfile.cmake +++ /dev/null @@ -1,44 +0,0 @@ -include(vcpkg_common_functions) - -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 27) - 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 "qtdoc-5.9.2") -set(ARCHIVE_NAME "qtdoc-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 9352856d5ef48afa28771f05cbf5bc7b3a49181b4696bd018a8294cbfc3a6d25de6625830f0ba776689deb098d7eb549dd19b362cbb5ecfda1b2d6d2e15ef43f -) -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") - -vcpkg_configure_qmake_debug( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -vcpkg_build_qmake_debug() - -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -vcpkg_build_qmake_release() diff --git a/ports/qt5docs/CONTROL b/ports/qt5docs/CONTROL new file mode 100644 index 000000000..32d85ef37 --- /dev/null +++ b/ports/qt5docs/CONTROL @@ -0,0 +1,4 @@ +Source: qt5docs +Version: 5.9.2-0 +Description: Qt5 Documentation +Build-Depends: qt5base, qt5tools \ No newline at end of file diff --git a/ports/qt5docs/portfile.cmake b/ports/qt5docs/portfile.cmake new file mode 100644 index 000000000..6b177dda1 --- /dev/null +++ b/ports/qt5docs/portfile.cmake @@ -0,0 +1,40 @@ +include(vcpkg_common_functions) + +string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) +if(BUILDTREES_PATH_LENGTH GREATER 27) + 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 "qtdoc-5.9.2") +set(ARCHIVE_NAME "qtdoc-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 9352856d5ef48afa28771f05cbf5bc7b3a49181b4696bd018a8294cbfc3a6d25de6625830f0ba776689deb098d7eb549dd19b362cbb5ecfda1b2d6d2e15ef43f +) +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") + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release( + TARGETS docs +) diff --git a/ports/qt5tools/fixcmake.py b/ports/qt5tools/fixcmake.py new file mode 100644 index 000000000..d55ca7754 --- /dev/null +++ b/ports/qt5tools/fixcmake.py @@ -0,0 +1,48 @@ +import os +import re +from glob import glob + +files = [y for x in os.walk('.') for y in glob(os.path.join(x[0], '*.cmake'))] + +for f in files: + openedfile = open(f, "r") + builder = "" + dllpattern = re.compile("_install_prefix}/bin/Qt5.*d.dll") + libpattern = re.compile("_install_prefix}/lib/Qt5.*d.lib") + exepattern = re.compile("_install_prefix}/bin/[a-z]+.exe") + for line in openedfile: + if "_install_prefix}/bin/${LIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/bin/", "/debug/bin/") + builder += " endif()\n" + elif "_install_prefix}/lib/${LIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/lib/", "/debug/lib/") + builder += " endif()\n" + elif "_install_prefix}/lib/${IMPLIB_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/lib/", "/debug/lib/") + builder += " endif()\n" + elif "_install_prefix}/plugins/${PLUGIN_LOCATION}" in line: + builder += " if (${Configuration} STREQUAL \"RELEASE\")" + builder += "\n " + line + builder += " else()" + builder += "\n " + line.replace("/plugins/", "/debug/plugins/") + builder += " endif()\n" + elif dllpattern.search(line) != None: + builder += line.replace("/bin/", "/debug/bin/") + elif libpattern.search(line) != None: + builder += line.replace("/lib/", "/debug/lib/") + elif exepattern.search(line) != None: + builder += line.replace("/bin/", "/tools/qt5/") + else: + builder += line + new_file = open(f, "w") + new_file.write(builder) + new_file.close() \ No newline at end of file diff --git a/ports/qt5tools/portfile.cmake b/ports/qt5tools/portfile.cmake index 2a2e5cd4d..ebcdb6b12 100644 --- a/ports/qt5tools/portfile.cmake +++ b/ports/qt5tools/portfile.cmake @@ -43,6 +43,21 @@ vcpkg_configure_qmake_release( vcpkg_build_qmake_release() +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") + +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake +) + +set(ENV{PATH} "${_path}") + file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/*.exe") file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) file(REMOVE ${BINARY_TOOLS}) @@ -50,6 +65,23 @@ file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/bin/*.ex file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/qt5) file(REMOVE ${BINARY_TOOLS}) +file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") +file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") +file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) + file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5tools RENAME copyright) #touch an empty include file - qt tools does not create any and this is an error in vcpkg diff --git a/ports/qt5winextras/portfile.cmake b/ports/qt5winextras/portfile.cmake index 800e3490b..5d7b85909 100644 --- a/ports/qt5winextras/portfile.cmake +++ b/ports/qt5winextras/portfile.cmake @@ -43,14 +43,14 @@ vcpkg_configure_qmake_release( vcpkg_build_qmake_release() -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") set(_path "$ENV{PATH}") +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake diff --git a/scripts/cmake/vcpkg_build_qmake_debug.cmake b/scripts/cmake/vcpkg_build_qmake_debug.cmake index 7e5625850..a734e63cf 100644 --- a/scripts/cmake/vcpkg_build_qmake_debug.cmake +++ b/scripts/cmake/vcpkg_build_qmake_debug.cmake @@ -10,6 +10,7 @@ # [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html function(vcpkg_build_qmake_debug) + cmake_parse_arguments(_csc "" "" "TARGETS" ${ARGN}) vcpkg_find_acquire_program(JOM) # Make sure that the linker finds the libraries used @@ -18,7 +19,7 @@ function(vcpkg_build_qmake_debug) message(STATUS "Package ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${JOM} + COMMAND ${JOM} ${_csc_TARGETS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME package-${TARGET_TRIPLET}-dbg ) diff --git a/scripts/cmake/vcpkg_build_qmake_release.cmake b/scripts/cmake/vcpkg_build_qmake_release.cmake index 6cfbcdc91..3daf9201b 100644 --- a/scripts/cmake/vcpkg_build_qmake_release.cmake +++ b/scripts/cmake/vcpkg_build_qmake_release.cmake @@ -10,15 +10,16 @@ # [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html function(vcpkg_build_qmake_release) + cmake_parse_arguments(_csc "" "" "TARGETS" ${ARGN}) vcpkg_find_acquire_program(JOM) - + # Make sure that the linker finds the libraries used set(ENV_PATH_BACKUP "$ENV{PATH}") set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;$ENV{PATH}") message(STATUS "Package ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${JOM} + COMMAND ${JOM} ${_csc_TARGETS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME package-${TARGET_TRIPLET}-rel ) -- cgit v1.2.3 From 62b62d9f35cfb1e81971f56d4f33f369ed9af53c Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 17 Oct 2017 20:02:26 +1100 Subject: minor clean up and configuration --- ports/qt5base/install_qt.cmake | 30 +++++++++-------- ports/qt5base/portfile.cmake | 5 +++ ports/qt5base/qt_debug.conf | 2 +- ports/qt5base/qt_release.conf | 2 +- ports/qt5docs/CONTROL | 4 --- ports/qt5docs/portfile.cmake | 40 ----------------------- ports/qt5tools/portfile.cmake | 5 +-- scripts/cmake/vcpkg_configure_qmake_release.cmake | 1 - 8 files changed, 24 insertions(+), 65 deletions(-) delete mode 100644 ports/qt5docs/CONTROL delete mode 100644 ports/qt5docs/portfile.cmake diff --git a/ports/qt5base/install_qt.cmake b/ports/qt5base/install_qt.cmake index 922303aba..37528e4e6 100644 --- a/ports/qt5base/install_qt.cmake +++ b/ports/qt5base/install_qt.cmake @@ -13,6 +13,20 @@ function(install_qt) set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") set(_path "$ENV{PATH}") + message(STATUS "Package ${TARGET_TRIPLET}-dbg") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/bin;${_path}") + vcpkg_execute_required_process( + COMMAND ${JOM} /J ${JOBS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME build-${TARGET_TRIPLET}-dbg + ) + vcpkg_execute_required_process( + COMMAND ${JOM} /J ${JOBS} install + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME package-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Package ${TARGET_TRIPLET}-dbg done") + message(STATUS "Package ${TARGET_TRIPLET}-rel") set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/bin;${_path}") vcpkg_execute_required_process( @@ -26,19 +40,7 @@ function(install_qt) LOGNAME package-${TARGET_TRIPLET}-rel ) message(STATUS "Package ${TARGET_TRIPLET}-rel done") - - message(STATUS "Package ${TARGET_TRIPLET}-dbg") - set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/bin;${_path}") - vcpkg_execute_required_process( - COMMAND ${JOM} /J ${JOBS} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME build-${TARGET_TRIPLET}-dbg - ) - vcpkg_execute_required_process( - COMMAND ${JOM} /J ${JOBS} install - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME package-${TARGET_TRIPLET}-dbg - ) + set(ENV{PATH} "${_path}") - message(STATUS "Package ${TARGET_TRIPLET}-dbg done") + endfunction() \ No newline at end of file diff --git a/ports/qt5base/portfile.cmake b/ports/qt5base/portfile.cmake index 5368c3a4a..623ff29c2 100644 --- a/ports/qt5base/portfile.cmake +++ b/ports/qt5base/portfile.cmake @@ -80,6 +80,11 @@ 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) + vcpkg_execute_required_process( COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/cmake diff --git a/ports/qt5base/qt_debug.conf b/ports/qt5base/qt_debug.conf index 96e4a2a4d..3bed4b725 100644 --- a/ports/qt5base/qt_debug.conf +++ b/ports/qt5base/qt_debug.conf @@ -1,5 +1,5 @@ [Paths] -Prefix = C:/vcpkg/installed/x64-windows +Prefix = ${QT_DEBUG_PREFIX_PATH} Documentation = share/qt5/debug/doc Headers = share/qt5/debug/include Libraries = debug/lib diff --git a/ports/qt5base/qt_release.conf b/ports/qt5base/qt_release.conf index ddd9d1880..99356fc26 100644 --- a/ports/qt5base/qt_release.conf +++ b/ports/qt5base/qt_release.conf @@ -1,5 +1,5 @@ [Paths] -Prefix = C:/vcpkg/installed/x64-windows +Prefix = ${QT_RELEASE_PREFIX_PATH} Documentation = share/qt5/doc Headers = include Libraries = lib diff --git a/ports/qt5docs/CONTROL b/ports/qt5docs/CONTROL deleted file mode 100644 index 32d85ef37..000000000 --- a/ports/qt5docs/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5docs -Version: 5.9.2-0 -Description: Qt5 Documentation -Build-Depends: qt5base, qt5tools \ No newline at end of file diff --git a/ports/qt5docs/portfile.cmake b/ports/qt5docs/portfile.cmake deleted file mode 100644 index 6b177dda1..000000000 --- a/ports/qt5docs/portfile.cmake +++ /dev/null @@ -1,40 +0,0 @@ -include(vcpkg_common_functions) - -string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 27) - 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 "qtdoc-5.9.2") -set(ARCHIVE_NAME "qtdoc-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 9352856d5ef48afa28771f05cbf5bc7b3a49181b4696bd018a8294cbfc3a6d25de6625830f0ba776689deb098d7eb549dd19b362cbb5ecfda1b2d6d2e15ef43f -) -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") - -vcpkg_configure_qmake_release( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} -) - -vcpkg_build_qmake_release( - TARGETS docs -) diff --git a/ports/qt5tools/portfile.cmake b/ports/qt5tools/portfile.cmake index ebcdb6b12..84c00d0c8 100644 --- a/ports/qt5tools/portfile.cmake +++ b/ports/qt5tools/portfile.cmake @@ -82,7 +82,4 @@ file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5tools RENAME copyright) - -#touch an empty include file - qt tools does not create any and this is an error in vcpkg -file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5tools RENAME copyright) \ No newline at end of file diff --git a/scripts/cmake/vcpkg_configure_qmake_release.cmake b/scripts/cmake/vcpkg_configure_qmake_release.cmake index 8ab5340e9..cf9eacbd5 100644 --- a/scripts/cmake/vcpkg_configure_qmake_release.cmake +++ b/scripts/cmake/vcpkg_configure_qmake_release.cmake @@ -22,7 +22,6 @@ 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() -- cgit v1.2.3 From ddc421acbc8bc9dd1d448190ac173b9d11e942dd Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 17 Oct 2017 20:23:20 +1100 Subject: update descriptions --- ports/qt5base/CONTROL | 2 +- ports/qt5declarative/CONTROL | 2 +- ports/qt5tools/CONTROL | 2 +- ports/qt5winextras/CONTROL | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/qt5base/CONTROL b/ports/qt5base/CONTROL index 0b9e4792a..79523a21f 100644 --- a/ports/qt5base/CONTROL +++ b/ports/qt5base/CONTROL @@ -1,4 +1,4 @@ Source: qt5base Version: 5.9.2-0 -Description: Qt5 application framework base components. Webengine, examples and tests not included. +Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components. Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion diff --git a/ports/qt5declarative/CONTROL b/ports/qt5declarative/CONTROL index 67ffc3212..cd86bb413 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) +Description: Qt5 Declarative (Quick 2) Module. Includes QtQuick, QtQuickParticles, QtQuickWidgets, QtQml, and QtPacketProtocol. Build-Depends: qt5base \ No newline at end of file diff --git a/ports/qt5tools/CONTROL b/ports/qt5tools/CONTROL index 7bdb5c1db..20c100ce9 100644 --- a/ports/qt5tools/CONTROL +++ b/ports/qt5tools/CONTROL @@ -1,4 +1,4 @@ Source: qt5tools Version: 5.9.2-0 -Description: Qt5 tools +Description: Qt5 Tools Module. Includes deployment tools and helpers, Qt Designer, Assistant, and other applications Build-Depends: qt5base diff --git a/ports/qt5winextras/CONTROL b/ports/qt5winextras/CONTROL index 67117a9fa..1c212d9b5 100644 --- a/ports/qt5winextras/CONTROL +++ b/ports/qt5winextras/CONTROL @@ -1,4 +1,4 @@ Source: qt5winextras Version: 5.9.2-0 -Description: Qt5 Windows extras +Description: Qt5 Windows Extras Module. Provides platform-specific APIs for Windows. Build-Depends: qt5base, atlmfc \ No newline at end of file -- cgit v1.2.3 From 222f59ed84d67f54f1768d59dd3a481ad6a64b15 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Fri, 20 Oct 2017 09:56:54 +1100 Subject: add qt5speech, fix plugin installation, fix dlls paths in cmake --- ports/qt5base/fixcmake.py | 11 ++++++++++- ports/qt5declarative/fixcmake.py | 11 ++++++++++- ports/qt5declarative/portfile.cmake | 2 ++ ports/qt5tools/fixcmake.py | 11 ++++++++++- ports/qt5winextras/fixcmake.py | 11 ++++++++++- 5 files changed, 42 insertions(+), 4 deletions(-) diff --git a/ports/qt5base/fixcmake.py b/ports/qt5base/fixcmake.py index d55ca7754..923e600bc 100644 --- a/ports/qt5base/fixcmake.py +++ b/ports/qt5base/fixcmake.py @@ -10,8 +10,15 @@ for f in files: 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}/bin/${LIB_LOCATION}" in line: + 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()" @@ -39,6 +46,8 @@ for f in files: 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: diff --git a/ports/qt5declarative/fixcmake.py b/ports/qt5declarative/fixcmake.py index d55ca7754..923e600bc 100644 --- a/ports/qt5declarative/fixcmake.py +++ b/ports/qt5declarative/fixcmake.py @@ -10,8 +10,15 @@ for f in files: 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}/bin/${LIB_LOCATION}" in line: + 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()" @@ -39,6 +46,8 @@ for f in files: 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: diff --git a/ports/qt5declarative/portfile.cmake b/ports/qt5declarative/portfile.cmake index 48ab900ce..614eecd37 100644 --- a/ports/qt5declarative/portfile.cmake +++ b/ports/qt5declarative/portfile.cmake @@ -67,11 +67,13 @@ file(REMOVE ${BINARY_TOOLS}) file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) diff --git a/ports/qt5tools/fixcmake.py b/ports/qt5tools/fixcmake.py index d55ca7754..923e600bc 100644 --- a/ports/qt5tools/fixcmake.py +++ b/ports/qt5tools/fixcmake.py @@ -10,8 +10,15 @@ for f in files: 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}/bin/${LIB_LOCATION}" in line: + 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()" @@ -39,6 +46,8 @@ for f in files: 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: diff --git a/ports/qt5winextras/fixcmake.py b/ports/qt5winextras/fixcmake.py index d55ca7754..923e600bc 100644 --- a/ports/qt5winextras/fixcmake.py +++ b/ports/qt5winextras/fixcmake.py @@ -10,8 +10,15 @@ for f in files: 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}/bin/${LIB_LOCATION}" in line: + 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()" @@ -39,6 +46,8 @@ for f in files: 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: -- cgit v1.2.3 From dba0884fb4a45d99e513f0538da20f5b895bead2 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Fri, 20 Oct 2017 09:57:25 +1100 Subject: add qt5speech --- ports/qt5speech/CONTROL | 4 +++ ports/qt5speech/fixcmake.py | 57 +++++++++++++++++++++++++++++ ports/qt5speech/portfile.cmake | 81 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 ports/qt5speech/CONTROL create mode 100644 ports/qt5speech/fixcmake.py create mode 100644 ports/qt5speech/portfile.cmake diff --git a/ports/qt5speech/CONTROL b/ports/qt5speech/CONTROL new file mode 100644 index 000000000..0013556d7 --- /dev/null +++ b/ports/qt5speech/CONTROL @@ -0,0 +1,4 @@ +Source: qt5speech +Version: 5.9.2-0 +Description: Qt5 Speech Module +Build-Depends: qt5base, atlmfc \ No newline at end of file diff --git a/ports/qt5speech/fixcmake.py b/ports/qt5speech/fixcmake.py new file mode 100644 index 000000000..923e600bc --- /dev/null +++ b/ports/qt5speech/fixcmake.py @@ -0,0 +1,57 @@ +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 new file mode 100644 index 000000000..fab35389e --- /dev/null +++ b/ports/qt5speech/portfile.cmake @@ -0,0 +1,81 @@ +include(vcpkg_common_functions) + +string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) +if(BUILDTREES_PATH_LENGTH GREATER 27) + 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 "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") + +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release() + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") +set(_path "$ENV{PATH}") + +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake +) + +set(ENV{PATH} "${_path}") + +file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") +file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") +file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5speech RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From 9ed2fc546cd9896340706f25c04aab93ddf45e45 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Sun, 5 Nov 2017 18:00:01 +1100 Subject: qt5 - serial, svg, charts, and 3d modules --- ports/qt53d/CONTROL | 4 ++ ports/qt53d/fixcmake.py | 57 +++++++++++++++++++++++++++ ports/qt53d/portfile.cmake | 88 ++++++++++++++++++++++++++++++++++++++++++ ports/qt5charts/CONTROL | 4 ++ ports/qt5charts/fixcmake.py | 57 +++++++++++++++++++++++++++ ports/qt5charts/portfile.cmake | 79 +++++++++++++++++++++++++++++++++++++ ports/qt5serial/CONTROL | 4 ++ ports/qt5serial/fixcmake.py | 57 +++++++++++++++++++++++++++ ports/qt5serial/portfile.cmake | 79 +++++++++++++++++++++++++++++++++++++ ports/qt5svg/CONTROL | 4 ++ ports/qt5svg/fixcmake.py | 57 +++++++++++++++++++++++++++ ports/qt5svg/portfile.cmake | 81 ++++++++++++++++++++++++++++++++++++++ 12 files changed, 571 insertions(+) create mode 100644 ports/qt53d/CONTROL create mode 100644 ports/qt53d/fixcmake.py create mode 100644 ports/qt53d/portfile.cmake create mode 100644 ports/qt5charts/CONTROL create mode 100644 ports/qt5charts/fixcmake.py create mode 100644 ports/qt5charts/portfile.cmake create mode 100644 ports/qt5serial/CONTROL create mode 100644 ports/qt5serial/fixcmake.py create mode 100644 ports/qt5serial/portfile.cmake create mode 100644 ports/qt5svg/CONTROL create mode 100644 ports/qt5svg/fixcmake.py create mode 100644 ports/qt5svg/portfile.cmake diff --git a/ports/qt53d/CONTROL b/ports/qt53d/CONTROL new file mode 100644 index 000000000..d8130de6e --- /dev/null +++ b/ports/qt53d/CONTROL @@ -0,0 +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 diff --git a/ports/qt53d/fixcmake.py b/ports/qt53d/fixcmake.py new file mode 100644 index 000000000..923e600bc --- /dev/null +++ b/ports/qt53d/fixcmake.py @@ -0,0 +1,57 @@ +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/qt53d/portfile.cmake b/ports/qt53d/portfile.cmake new file mode 100644 index 000000000..cb0ac87ef --- /dev/null +++ b/ports/qt53d/portfile.cmake @@ -0,0 +1,88 @@ +include(vcpkg_common_functions) + +string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) +if(BUILDTREES_PATH_LENGTH GREATER 27) + 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 "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") + +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release() + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") +set(_path "$ENV{PATH}") + +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake +) + +set(ENV{PATH} "${_path}") + +file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(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}) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") +file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") +file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt53d RENAME copyright) \ No newline at end of file diff --git a/ports/qt5charts/CONTROL b/ports/qt5charts/CONTROL new file mode 100644 index 000000000..d1a2eb844 --- /dev/null +++ b/ports/qt5charts/CONTROL @@ -0,0 +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 diff --git a/ports/qt5charts/fixcmake.py b/ports/qt5charts/fixcmake.py new file mode 100644 index 000000000..923e600bc --- /dev/null +++ b/ports/qt5charts/fixcmake.py @@ -0,0 +1,57 @@ +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 new file mode 100644 index 000000000..2ff08e715 --- /dev/null +++ b/ports/qt5charts/portfile.cmake @@ -0,0 +1,79 @@ +include(vcpkg_common_functions) + +string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) +if(BUILDTREES_PATH_LENGTH GREATER 27) + 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 "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") + +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release() + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") +set(_path "$ENV{PATH}") + +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake +) + +set(ENV{PATH} "${_path}") + +file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") +file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") +file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) + +file(INSTALL ${SOURCE_PATH}/LICENSE.GPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5charts RENAME copyright) \ No newline at end of file diff --git a/ports/qt5serial/CONTROL b/ports/qt5serial/CONTROL new file mode 100644 index 000000000..386fc8e6c --- /dev/null +++ b/ports/qt5serial/CONTROL @@ -0,0 +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 diff --git a/ports/qt5serial/fixcmake.py b/ports/qt5serial/fixcmake.py new file mode 100644 index 000000000..923e600bc --- /dev/null +++ b/ports/qt5serial/fixcmake.py @@ -0,0 +1,57 @@ +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 new file mode 100644 index 000000000..732675337 --- /dev/null +++ b/ports/qt5serial/portfile.cmake @@ -0,0 +1,79 @@ +include(vcpkg_common_functions) + +string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) +if(BUILDTREES_PATH_LENGTH GREATER 27) + 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 "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") + +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release() + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") +set(_path "$ENV{PATH}") + +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake +) + +set(ENV{PATH} "${_path}") + +file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") +file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") +file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5serial RENAME copyright) \ No newline at end of file diff --git a/ports/qt5svg/CONTROL b/ports/qt5svg/CONTROL new file mode 100644 index 000000000..f56df4b51 --- /dev/null +++ b/ports/qt5svg/CONTROL @@ -0,0 +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 diff --git a/ports/qt5svg/fixcmake.py b/ports/qt5svg/fixcmake.py new file mode 100644 index 000000000..923e600bc --- /dev/null +++ b/ports/qt5svg/fixcmake.py @@ -0,0 +1,57 @@ +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 new file mode 100644 index 000000000..e06c6ef85 --- /dev/null +++ b/ports/qt5svg/portfile.cmake @@ -0,0 +1,81 @@ +include(vcpkg_common_functions) + +string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) +if(BUILDTREES_PATH_LENGTH GREATER 27) + 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 "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") + +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release() + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") +set(_path "$ENV{PATH}") + +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake +) + +set(ENV{PATH} "${_path}") + +file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") +file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") +file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5svg RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From 938a8fe401ebf88de37e6149a4e9818a8f130a7e Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Sun, 5 Nov 2017 19:44:44 +1100 Subject: fix path lengths limit for qt source, add qt5 modules: datavis3d, imageformats, multimedia, xmlpatterns --- ports/cairomm/cmake/FindSigC++.cmake | 2 +- ports/qt53d/portfile.cmake | 2 +- ports/qt5base/portfile.cmake | 2 +- ports/qt5charts/portfile.cmake | 2 +- ports/qt5datavisualization3d/CONTROL | 4 ++ ports/qt5datavisualization3d/fixcmake.py | 57 +++++++++++++++++++ ports/qt5datavisualization3d/portfile.cmake | 79 ++++++++++++++++++++++++++ ports/qt5declarative/portfile.cmake | 2 +- ports/qt5imageformats/CONTROL | 4 ++ ports/qt5imageformats/fixcmake.py | 57 +++++++++++++++++++ ports/qt5imageformats/portfile.cmake | 73 ++++++++++++++++++++++++ ports/qt5multimedia/CONTROL | 4 ++ ports/qt5multimedia/fixcmake.py | 57 +++++++++++++++++++ ports/qt5multimedia/portfile.cmake | 81 +++++++++++++++++++++++++++ ports/qt5serial/portfile.cmake | 2 +- ports/qt5speech/portfile.cmake | 2 +- ports/qt5svg/portfile.cmake | 2 +- ports/qt5tools/portfile.cmake | 2 +- ports/qt5winextras/portfile.cmake | 2 +- ports/qt5xmlpatterns/CONTROL | 4 ++ ports/qt5xmlpatterns/fixcmake.py | 57 +++++++++++++++++++ ports/qt5xmlpatterns/portfile.cmake | 86 +++++++++++++++++++++++++++++ 22 files changed, 573 insertions(+), 10 deletions(-) create mode 100644 ports/qt5datavisualization3d/CONTROL create mode 100644 ports/qt5datavisualization3d/fixcmake.py create mode 100644 ports/qt5datavisualization3d/portfile.cmake create mode 100644 ports/qt5imageformats/CONTROL create mode 100644 ports/qt5imageformats/fixcmake.py create mode 100644 ports/qt5imageformats/portfile.cmake create mode 100644 ports/qt5multimedia/CONTROL create mode 100644 ports/qt5multimedia/fixcmake.py create mode 100644 ports/qt5multimedia/portfile.cmake create mode 100644 ports/qt5xmlpatterns/CONTROL create mode 100644 ports/qt5xmlpatterns/fixcmake.py create mode 100644 ports/qt5xmlpatterns/portfile.cmake diff --git a/ports/cairomm/cmake/FindSigC++.cmake b/ports/cairomm/cmake/FindSigC++.cmake index ed16ef93f..8d65f70d9 100644 --- a/ports/cairomm/cmake/FindSigC++.cmake +++ b/ports/cairomm/cmake/FindSigC++.cmake @@ -108,4 +108,4 @@ find_package_handle_standard_args(SIGC++ FAIL_MESSAGE "Could NOT find SIGC++, try to set the path to SIGC++ root folder in the system variable SIGC++" ) -MARK_AS_ADVANCED(SIGC++_CONFIG_INCLUDE_DIR SIGC++_INCLUDE_DIR SIGC++_INCLUDE_DIRS SIGC++_LIBRARY SIGC++_LIBRARIES) \ No newline at end of file +MARK_AS_ADVANCED(SIGC++_CONFIG_INCLUDE_DIR SIGC++_INCLUDE_DIR SIGC++_INCLUDE_DIRS SIGC++_LIBRARY SIGC++_LIBRARIES) diff --git a/ports/qt53d/portfile.cmake b/ports/qt53d/portfile.cmake index cb0ac87ef..d31904043 100644 --- a/ports/qt53d/portfile.cmake +++ b/ports/qt53d/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 27) +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." ) diff --git a/ports/qt5base/portfile.cmake b/ports/qt5base/portfile.cmake index 623ff29c2..3c18a13f6 100644 --- a/ports/qt5base/portfile.cmake +++ b/ports/qt5base/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 27) +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." ) diff --git a/ports/qt5charts/portfile.cmake b/ports/qt5charts/portfile.cmake index 2ff08e715..e9b0d9dda 100644 --- a/ports/qt5charts/portfile.cmake +++ b/ports/qt5charts/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 27) +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." ) diff --git a/ports/qt5datavisualization3d/CONTROL b/ports/qt5datavisualization3d/CONTROL new file mode 100644 index 000000000..f48b02579 --- /dev/null +++ b/ports/qt5datavisualization3d/CONTROL @@ -0,0 +1,4 @@ +Source: qt5datavisualization3d +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 diff --git a/ports/qt5datavisualization3d/fixcmake.py b/ports/qt5datavisualization3d/fixcmake.py new file mode 100644 index 000000000..923e600bc --- /dev/null +++ b/ports/qt5datavisualization3d/fixcmake.py @@ -0,0 +1,57 @@ +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 new file mode 100644 index 000000000..85bd0e21b --- /dev/null +++ b/ports/qt5datavisualization3d/portfile.cmake @@ -0,0 +1,79 @@ +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") + +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release() + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") +set(_path "$ENV{PATH}") + +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake +) + +set(ENV{PATH} "${_path}") + +file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") +file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") +file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) + +file(INSTALL ${SOURCE_PATH}/LICENSE.GPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5datavisualization3d RENAME copyright) \ No newline at end of file diff --git a/ports/qt5declarative/portfile.cmake b/ports/qt5declarative/portfile.cmake index 614eecd37..70c502dfa 100644 --- a/ports/qt5declarative/portfile.cmake +++ b/ports/qt5declarative/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 27) +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." ) diff --git a/ports/qt5imageformats/CONTROL b/ports/qt5imageformats/CONTROL new file mode 100644 index 000000000..bcafa4558 --- /dev/null +++ b/ports/qt5imageformats/CONTROL @@ -0,0 +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 diff --git a/ports/qt5imageformats/fixcmake.py b/ports/qt5imageformats/fixcmake.py new file mode 100644 index 000000000..923e600bc --- /dev/null +++ b/ports/qt5imageformats/fixcmake.py @@ -0,0 +1,57 @@ +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 new file mode 100644 index 000000000..0dfe68b8d --- /dev/null +++ b/ports/qt5imageformats/portfile.cmake @@ -0,0 +1,73 @@ +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 "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") + +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release() + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") +set(_path "$ENV{PATH}") + +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake +) + +set(ENV{PATH} "${_path}") + +file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(INSTALL ${RELEASE_DIR}/lib/cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share) + +#Create an empty include file so that vcpkg doesn't complain +file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty "") + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5imageformats RENAME copyright) \ No newline at end of file diff --git a/ports/qt5multimedia/CONTROL b/ports/qt5multimedia/CONTROL new file mode 100644 index 000000000..3a4d01030 --- /dev/null +++ b/ports/qt5multimedia/CONTROL @@ -0,0 +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 diff --git a/ports/qt5multimedia/fixcmake.py b/ports/qt5multimedia/fixcmake.py new file mode 100644 index 000000000..923e600bc --- /dev/null +++ b/ports/qt5multimedia/fixcmake.py @@ -0,0 +1,57 @@ +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 new file mode 100644 index 000000000..d326bb783 --- /dev/null +++ b/ports/qt5multimedia/portfile.cmake @@ -0,0 +1,81 @@ +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 "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") + +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release() + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") +set(_path "$ENV{PATH}") + +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake +) + +set(ENV{PATH} "${_path}") + +file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") +file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") +file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5multimedia RENAME copyright) \ No newline at end of file diff --git a/ports/qt5serial/portfile.cmake b/ports/qt5serial/portfile.cmake index 732675337..edcd4b20a 100644 --- a/ports/qt5serial/portfile.cmake +++ b/ports/qt5serial/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 27) +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." ) diff --git a/ports/qt5speech/portfile.cmake b/ports/qt5speech/portfile.cmake index fab35389e..39b52ff58 100644 --- a/ports/qt5speech/portfile.cmake +++ b/ports/qt5speech/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 27) +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." ) diff --git a/ports/qt5svg/portfile.cmake b/ports/qt5svg/portfile.cmake index e06c6ef85..13ea3d1e7 100644 --- a/ports/qt5svg/portfile.cmake +++ b/ports/qt5svg/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 27) +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." ) diff --git a/ports/qt5tools/portfile.cmake b/ports/qt5tools/portfile.cmake index 84c00d0c8..b0bf93f29 100644 --- a/ports/qt5tools/portfile.cmake +++ b/ports/qt5tools/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 27) +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." ) diff --git a/ports/qt5winextras/portfile.cmake b/ports/qt5winextras/portfile.cmake index 5d7b85909..b5842494a 100644 --- a/ports/qt5winextras/portfile.cmake +++ b/ports/qt5winextras/portfile.cmake @@ -1,7 +1,7 @@ include(vcpkg_common_functions) string(LENGTH "${CURRENT_BUILDTREES_DIR}" BUILDTREES_PATH_LENGTH) -if(BUILDTREES_PATH_LENGTH GREATER 27) +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." ) diff --git a/ports/qt5xmlpatterns/CONTROL b/ports/qt5xmlpatterns/CONTROL new file mode 100644 index 000000000..baef1b3fd --- /dev/null +++ b/ports/qt5xmlpatterns/CONTROL @@ -0,0 +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 diff --git a/ports/qt5xmlpatterns/fixcmake.py b/ports/qt5xmlpatterns/fixcmake.py new file mode 100644 index 000000000..923e600bc --- /dev/null +++ b/ports/qt5xmlpatterns/fixcmake.py @@ -0,0 +1,57 @@ +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 new file mode 100644 index 000000000..0bf42b19d --- /dev/null +++ b/ports/qt5xmlpatterns/portfile.cmake @@ -0,0 +1,86 @@ +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 "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") + +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release() + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") +set(_path "$ENV{PATH}") + +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake +) + +set(ENV{PATH} "${_path}") + +file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(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}) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") +file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") +file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5xmlpatterns RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From 6b83925dd6b88233410f1511993350bab6ef984a Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Sun, 5 Nov 2017 20:13:12 +1100 Subject: qt5 modules: gamepad, scxml, virtual keyboard, websockets --- ports/qt5gamepad/CONTROL | 4 ++ ports/qt5gamepad/fixcmake.py | 57 ++++++++++++++++++++++ ports/qt5gamepad/portfile.cmake | 81 +++++++++++++++++++++++++++++++ ports/qt5imageformats/portfile.cmake | 2 +- ports/qt5scxml/CONTROL | 4 ++ ports/qt5scxml/fixcmake.py | 57 ++++++++++++++++++++++ ports/qt5scxml/portfile.cmake | 86 +++++++++++++++++++++++++++++++++ ports/qt5virtualkeyboard/CONTROL | 4 ++ ports/qt5virtualkeyboard/fixcmake.py | 57 ++++++++++++++++++++++ ports/qt5virtualkeyboard/portfile.cmake | 73 ++++++++++++++++++++++++++++ ports/qt5websockets/CONTROL | 4 ++ ports/qt5websockets/fixcmake.py | 57 ++++++++++++++++++++++ ports/qt5websockets/portfile.cmake | 79 ++++++++++++++++++++++++++++++ 13 files changed, 564 insertions(+), 1 deletion(-) create mode 100644 ports/qt5gamepad/CONTROL create mode 100644 ports/qt5gamepad/fixcmake.py create mode 100644 ports/qt5gamepad/portfile.cmake create mode 100644 ports/qt5scxml/CONTROL create mode 100644 ports/qt5scxml/fixcmake.py create mode 100644 ports/qt5scxml/portfile.cmake create mode 100644 ports/qt5virtualkeyboard/CONTROL create mode 100644 ports/qt5virtualkeyboard/fixcmake.py create mode 100644 ports/qt5virtualkeyboard/portfile.cmake create mode 100644 ports/qt5websockets/CONTROL create mode 100644 ports/qt5websockets/fixcmake.py create mode 100644 ports/qt5websockets/portfile.cmake diff --git a/ports/qt5gamepad/CONTROL b/ports/qt5gamepad/CONTROL new file mode 100644 index 000000000..051deb634 --- /dev/null +++ b/ports/qt5gamepad/CONTROL @@ -0,0 +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 diff --git a/ports/qt5gamepad/fixcmake.py b/ports/qt5gamepad/fixcmake.py new file mode 100644 index 000000000..923e600bc --- /dev/null +++ b/ports/qt5gamepad/fixcmake.py @@ -0,0 +1,57 @@ +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 new file mode 100644 index 000000000..3492e78de --- /dev/null +++ b/ports/qt5gamepad/portfile.cmake @@ -0,0 +1,81 @@ +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 "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") + +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release() + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") +set(_path "$ENV{PATH}") + +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake +) + +set(ENV{PATH} "${_path}") + +file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") +file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") +file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5gamepad RENAME copyright) \ No newline at end of file diff --git a/ports/qt5imageformats/portfile.cmake b/ports/qt5imageformats/portfile.cmake index 0dfe68b8d..059f8ae6a 100644 --- a/ports/qt5imageformats/portfile.cmake +++ b/ports/qt5imageformats/portfile.cmake @@ -68,6 +68,6 @@ file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt file(INSTALL ${RELEASE_DIR}/lib/cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share) #Create an empty include file so that vcpkg doesn't complain -file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty "") +file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_qt5imageformats "") file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5imageformats RENAME copyright) \ No newline at end of file diff --git a/ports/qt5scxml/CONTROL b/ports/qt5scxml/CONTROL new file mode 100644 index 000000000..974bce77c --- /dev/null +++ b/ports/qt5scxml/CONTROL @@ -0,0 +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 diff --git a/ports/qt5scxml/fixcmake.py b/ports/qt5scxml/fixcmake.py new file mode 100644 index 000000000..923e600bc --- /dev/null +++ b/ports/qt5scxml/fixcmake.py @@ -0,0 +1,57 @@ +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 new file mode 100644 index 000000000..db2f385af --- /dev/null +++ b/ports/qt5scxml/portfile.cmake @@ -0,0 +1,86 @@ +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 "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") + +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release() + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") +set(_path "$ENV{PATH}") + +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake +) + +set(ENV{PATH} "${_path}") + +file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/*.exe") +file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) +file(REMOVE ${BINARY_TOOLS}) +file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/bin/*.exe") +file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/qt5) +file(REMOVE ${BINARY_TOOLS}) + +file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") +file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") +file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5scxml RENAME copyright) \ No newline at end of file diff --git a/ports/qt5virtualkeyboard/CONTROL b/ports/qt5virtualkeyboard/CONTROL new file mode 100644 index 000000000..7f5649f31 --- /dev/null +++ b/ports/qt5virtualkeyboard/CONTROL @@ -0,0 +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 diff --git a/ports/qt5virtualkeyboard/fixcmake.py b/ports/qt5virtualkeyboard/fixcmake.py new file mode 100644 index 000000000..923e600bc --- /dev/null +++ b/ports/qt5virtualkeyboard/fixcmake.py @@ -0,0 +1,57 @@ +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 new file mode 100644 index 000000000..6a4c921cb --- /dev/null +++ b/ports/qt5virtualkeyboard/portfile.cmake @@ -0,0 +1,73 @@ +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 "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") + +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release() + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") +set(_path "$ENV{PATH}") + +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake +) + +set(ENV{PATH} "${_path}") + +file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(INSTALL ${RELEASE_DIR}/lib/cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share) + +#Create an empty include file so that vcpkg doesn't complain +file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_qt5virtualkeyboard "") + +file(INSTALL ${SOURCE_PATH}/LICENSE.GPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5virtualkeyboard RENAME copyright) \ No newline at end of file diff --git a/ports/qt5websockets/CONTROL b/ports/qt5websockets/CONTROL new file mode 100644 index 000000000..51497f6ec --- /dev/null +++ b/ports/qt5websockets/CONTROL @@ -0,0 +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 diff --git a/ports/qt5websockets/fixcmake.py b/ports/qt5websockets/fixcmake.py new file mode 100644 index 000000000..923e600bc --- /dev/null +++ b/ports/qt5websockets/fixcmake.py @@ -0,0 +1,57 @@ +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 new file mode 100644 index 000000000..333483a74 --- /dev/null +++ b/ports/qt5websockets/portfile.cmake @@ -0,0 +1,79 @@ +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 "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") + +vcpkg_configure_qmake_debug( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_debug() + +vcpkg_configure_qmake_release( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} +) + +vcpkg_build_qmake_release() + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) +set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") +set(_path "$ENV{PATH}") + +set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") +set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + +vcpkg_execute_required_process( + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake +) + +set(ENV{PATH} "${_path}") + +file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) +file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) + +file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") +file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") +file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5websockets RENAME copyright) \ No newline at end of file -- cgit v1.2.3 From 9bb4817e32a14647093876cabaf62bbd2be63fc6 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 6 Nov 2017 00:24:29 +1100 Subject: use install target in Makefiles; make all portfile uniform --- ports/qt53d/portfile.cmake | 145 ++++++++++++++++++++-------- ports/qt5charts/portfile.cmake | 130 ++++++++++++++++++++----- ports/qt5datavisualization3d/portfile.cmake | 130 ++++++++++++++++++++----- ports/qt5declarative/portfile.cmake | 141 ++++++++++++++++++++------- ports/qt5gamepad/portfile.cmake | 132 +++++++++++++++++++------ ports/qt5imageformats/portfile.cmake | 124 ++++++++++++++++++++---- ports/qt5multimedia/portfile.cmake | 132 +++++++++++++++++++------ ports/qt5scxml/portfile.cmake | 137 +++++++++++++++++++------- ports/qt5serial/portfile.cmake | 130 ++++++++++++++++++++----- ports/qt5speech/portfile.cmake | 132 +++++++++++++++++++------ ports/qt5svg/portfile.cmake | 132 +++++++++++++++++++------ ports/qt5tools/CONTROL | 4 +- ports/qt5tools/portfile.cmake | 140 ++++++++++++++++++++------- ports/qt5virtualkeyboard/portfile.cmake | 124 ++++++++++++++++++++---- ports/qt5websockets/portfile.cmake | 130 ++++++++++++++++++++----- ports/qt5winextras/portfile.cmake | 130 ++++++++++++++++++++----- ports/qt5xmlpatterns/portfile.cmake | 137 +++++++++++++++++++------- scripts/cmake/vcpkg_common_functions.cmake | 1 + scripts/cmake/vcpkg_replace_string.cmake | 14 +++ 19 files changed, 1689 insertions(+), 456 deletions(-) create mode 100644 scripts/cmake/vcpkg_replace_string.cmake diff --git a/ports/qt53d/portfile.cmake b/ports/qt53d/portfile.cmake index d31904043..dd9751650 100644 --- a/ports/qt53d/portfile.cmake +++ b/ports/qt53d/portfile.cmake @@ -31,58 +31,127 @@ 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() -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}") +#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(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#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() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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}") -file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) - -file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) - -file(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}) - -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) - -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt53d RENAME copyright) \ No newline at end of file +#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/qt5charts/portfile.cmake b/ports/qt5charts/portfile.cmake index e9b0d9dda..6e43f92b5 100644 --- a/ports/qt5charts/portfile.cmake +++ b/ports/qt5charts/portfile.cmake @@ -31,49 +31,127 @@ 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() -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}") +#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(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#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() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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}") -file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) - -file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) +#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() -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +#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() -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) +#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() -file(INSTALL ${SOURCE_PATH}/LICENSE.GPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5charts RENAME copyright) \ No newline at end of file +#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/qt5datavisualization3d/portfile.cmake b/ports/qt5datavisualization3d/portfile.cmake index 85bd0e21b..8a067c524 100644 --- a/ports/qt5datavisualization3d/portfile.cmake +++ b/ports/qt5datavisualization3d/portfile.cmake @@ -31,49 +31,127 @@ 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() -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}") +#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(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#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() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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}") -file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) - -file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) +#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() -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +#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() -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) +#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() -file(INSTALL ${SOURCE_PATH}/LICENSE.GPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5datavisualization3d RENAME copyright) \ No newline at end of file +#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/portfile.cmake b/ports/qt5declarative/portfile.cmake index 70c502dfa..29ff3e759 100644 --- a/ports/qt5declarative/portfile.cmake +++ b/ports/qt5declarative/portfile.cmake @@ -31,57 +31,130 @@ 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() -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#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() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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}") -file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/*.exe") -file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) -file(REMOVE ${BINARY_TOOLS}) -file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/bin/*.exe") -file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/qt5) -file(REMOVE ${BINARY_TOOLS}) - -file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) - -file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) - -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) - -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5declarative RENAME copyright) \ No newline at end of file +#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 diff --git a/ports/qt5gamepad/portfile.cmake b/ports/qt5gamepad/portfile.cmake index 3492e78de..68ab01e6d 100644 --- a/ports/qt5gamepad/portfile.cmake +++ b/ports/qt5gamepad/portfile.cmake @@ -31,51 +31,127 @@ 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() -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}") +#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(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#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() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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}") -file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) - -file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) +#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() -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +#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() -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) +#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() -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5gamepad RENAME copyright) \ No newline at end of file +#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/qt5imageformats/portfile.cmake b/ports/qt5imageformats/portfile.cmake index 059f8ae6a..612178ff8 100644 --- a/ports/qt5imageformats/portfile.cmake +++ b/ports/qt5imageformats/portfile.cmake @@ -31,43 +31,127 @@ 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() -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}") +#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(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#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() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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}") -file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) - -file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) +#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() -file(INSTALL ${RELEASE_DIR}/lib/cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share) +#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() -#Create an empty include file so that vcpkg doesn't complain -file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_qt5imageformats "") +#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() -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5imageformats RENAME copyright) \ No newline at end of file +#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/qt5multimedia/portfile.cmake b/ports/qt5multimedia/portfile.cmake index d326bb783..5eb7c4ff1 100644 --- a/ports/qt5multimedia/portfile.cmake +++ b/ports/qt5multimedia/portfile.cmake @@ -31,51 +31,127 @@ 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() -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}") +#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(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#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() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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}") -file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) - -file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) +#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() -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +#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() -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) +#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() -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5multimedia RENAME copyright) \ No newline at end of file +#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/qt5scxml/portfile.cmake b/ports/qt5scxml/portfile.cmake index db2f385af..03de826cf 100644 --- a/ports/qt5scxml/portfile.cmake +++ b/ports/qt5scxml/portfile.cmake @@ -31,56 +31,127 @@ 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} ) -vcpkg_build_qmake_release() +#First generate the makefiles so we can modify them +vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) -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}") +#Store release makefile path +file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#Build release +vcpkg_build_qmake_release() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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(ENV{PATH} "${_path}") +#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() -file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/*.exe") -file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) -file(REMOVE ${BINARY_TOOLS}) -file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/bin/*.exe") -file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/qt5) -file(REMOVE ${BINARY_TOOLS}) +#Install the module files +vcpkg_build_qmake_debug(TARGETS install) +vcpkg_build_qmake_release(TARGETS install) -file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +#Reset the path to the baseline +set(ENV{PATH} "${_path}") -file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) +#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() -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +#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() -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) +#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() -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5scxml RENAME copyright) \ No newline at end of file +#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/qt5serial/portfile.cmake b/ports/qt5serial/portfile.cmake index edcd4b20a..1d47b5d0a 100644 --- a/ports/qt5serial/portfile.cmake +++ b/ports/qt5serial/portfile.cmake @@ -31,49 +31,127 @@ 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() -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}") +#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(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#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() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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}") -file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) - -file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) +#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() -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +#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() -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) +#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() -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5serial RENAME copyright) \ No newline at end of file +#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/qt5speech/portfile.cmake b/ports/qt5speech/portfile.cmake index 39b52ff58..fa80da81d 100644 --- a/ports/qt5speech/portfile.cmake +++ b/ports/qt5speech/portfile.cmake @@ -31,51 +31,127 @@ 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() -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}") +#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(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#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() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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}") -file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) - -file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) +#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() -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +#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() -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) +#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() -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5speech RENAME copyright) \ No newline at end of file +#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/qt5svg/portfile.cmake b/ports/qt5svg/portfile.cmake index 13ea3d1e7..2b838714e 100644 --- a/ports/qt5svg/portfile.cmake +++ b/ports/qt5svg/portfile.cmake @@ -31,51 +31,127 @@ 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() -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}") +#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(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#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() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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}") -file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) - -file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) +#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() -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +#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() -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) +#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() -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5svg RENAME copyright) \ No newline at end of file +#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/qt5tools/CONTROL b/ports/qt5tools/CONTROL index 20c100ce9..702d4d68e 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 +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 diff --git a/ports/qt5tools/portfile.cmake b/ports/qt5tools/portfile.cmake index b0bf93f29..2dcd4a3c3 100644 --- a/ports/qt5tools/portfile.cmake +++ b/ports/qt5tools/portfile.cmake @@ -31,55 +31,127 @@ 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} + 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} + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} ) -vcpkg_build_qmake_release() +#First generate the makefiles so we can modify them +vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) -vcpkg_find_acquire_program(PYTHON3) -get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) -set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") +#Store release makefile path +file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#Build release +vcpkg_build_qmake_release() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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(ENV{PATH} "${_path}") +#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() -file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/*.exe") -file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) -file(REMOVE ${BINARY_TOOLS}) -file(GLOB BINARY_TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/bin/*.exe") -file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/qt5) -file(REMOVE ${BINARY_TOOLS}) +#Install the module files +vcpkg_build_qmake_debug(TARGETS install) +vcpkg_build_qmake_release(TARGETS install) -file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +#Reset the path to the baseline +set(ENV{PATH} "${_path}") -file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) +#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() -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +#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() -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) +#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() -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5tools RENAME copyright) \ No newline at end of file +#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/qt5virtualkeyboard/portfile.cmake b/ports/qt5virtualkeyboard/portfile.cmake index 6a4c921cb..a2f0b1999 100644 --- a/ports/qt5virtualkeyboard/portfile.cmake +++ b/ports/qt5virtualkeyboard/portfile.cmake @@ -31,43 +31,127 @@ 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() -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}") +#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(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#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() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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}") -file(INSTALL ${DEBUG_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) - -file(INSTALL ${RELEASE_DIR}/plugins DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) +#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() -file(INSTALL ${RELEASE_DIR}/lib/cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share) +#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() -#Create an empty include file so that vcpkg doesn't complain -file(WRITE ${CURRENT_PACKAGES_DIR}/include/.empty_qt5virtualkeyboard "") +#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() -file(INSTALL ${SOURCE_PATH}/LICENSE.GPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5virtualkeyboard RENAME copyright) \ No newline at end of file +#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/qt5websockets/portfile.cmake b/ports/qt5websockets/portfile.cmake index 333483a74..64f9bf374 100644 --- a/ports/qt5websockets/portfile.cmake +++ b/ports/qt5websockets/portfile.cmake @@ -31,49 +31,127 @@ 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() -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}") +#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(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#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() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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}") -file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) - -file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) +#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() -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +#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() -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) +#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() -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPL3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5websockets RENAME copyright) \ No newline at end of file +#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/qt5winextras/portfile.cmake b/ports/qt5winextras/portfile.cmake index b5842494a..04b55327f 100644 --- a/ports/qt5winextras/portfile.cmake +++ b/ports/qt5winextras/portfile.cmake @@ -31,49 +31,127 @@ 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() -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}") +#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(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#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() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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}") -file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) - -file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) +#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() -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +#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() -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) +#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() -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5winextras RENAME copyright) \ No newline at end of file +#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/qt5xmlpatterns/portfile.cmake b/ports/qt5xmlpatterns/portfile.cmake index 0bf42b19d..764628c5e 100644 --- a/ports/qt5xmlpatterns/portfile.cmake +++ b/ports/qt5xmlpatterns/portfile.cmake @@ -31,56 +31,127 @@ 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} ) -vcpkg_build_qmake_release() +#First generate the makefiles so we can modify them +vcpkg_build_qmake_release(TARGETS sub-src-qmake_all) -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}") +#Store release makefile path +file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) -set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") -set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") +#Build release +vcpkg_build_qmake_release() -vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake -) +#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(ENV{PATH} "${_path}") +#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() -file(INSTALL ${DEBUG_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) -file(INSTALL ${DEBUG_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) -file(INSTALL ${DEBUG_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5/debug) +#Install the module files +vcpkg_build_qmake_debug(TARGETS install) +vcpkg_build_qmake_release(TARGETS install) -file(INSTALL ${RELEASE_DIR}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(INSTALL ${RELEASE_DIR}/mkspecs DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5) +#Reset the path to the baseline +set(ENV{PATH} "${_path}") -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}) +#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() -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) +#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() -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -file(REMOVE ${RELEASE_DLLS} ${DEBUG_DLLS}) +#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() -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5xmlpatterns RENAME copyright) \ No newline at end of file +#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/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 5dabd446e..e48b5e442 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -26,3 +26,4 @@ include(vcpkg_get_program_files_32_bit) include(vcpkg_get_program_files_platform_bitness) include(vcpkg_get_windows_sdk) include(vcpkg_acquire_depot_tools) +include(vcpkg_replace_string) diff --git a/scripts/cmake/vcpkg_replace_string.cmake b/scripts/cmake/vcpkg_replace_string.cmake new file mode 100644 index 000000000..3eb18d0bf --- /dev/null +++ b/scripts/cmake/vcpkg_replace_string.cmake @@ -0,0 +1,14 @@ +#.rst: +# .. command:: vcpkg_replace_string +# +# Replace a string in a file. +# +# :: +# vcpkg_replace_string(filename match_string replace_string) +# +# +function(vcpkg_replace_string filename match_string replace_string) + file(READ ${filename} _contents) + string(REPLACE "${match_string}" "${replace_string}" _contents "${_contents}") + file(WRITE ${filename} "${_contents}") +endfunction() -- cgit v1.2.3 From 76837a91b4af5cf5cce8ff1feb847ce4c96b8e05 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 6 Nov 2017 00:26:06 +1100 Subject: update modules dependent on qt5 to use qt5base --- ports/qca/CONTROL | 2 +- ports/qscintilla/CONTROL | 2 +- ports/qwt/CONTROL | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/qca/CONTROL b/ports/qca/CONTROL index 7d757297c..beddbaa37 100644 --- a/ports/qca/CONTROL +++ b/ports/qca/CONTROL @@ -1,4 +1,4 @@ Source: qca Version: 2.2.0-1 Description: Qt Cryptographic Architecture (QCA). Sources: https://cgit.kde.org/qca.git/ -Build-Depends: qt5 +Build-Depends: qt5base diff --git a/ports/qscintilla/CONTROL b/ports/qscintilla/CONTROL index 22a30137c..9ebe3ba04 100644 --- a/ports/qscintilla/CONTROL +++ b/ports/qscintilla/CONTROL @@ -1,4 +1,4 @@ Source: qscintilla Version: 2.10-1 Description: QScintilla is a port to Qt of the Scintilla editing component. Features syntax highlighting, code-completion and much more (Barebone build without python bindings (missing dependeny PyQt) and without QtDesigner plugin) -Build-Depends: qt5 +Build-Depends: qt5base diff --git a/ports/qwt/CONTROL b/ports/qwt/CONTROL index dd6400764..60539483b 100644 --- a/ports/qwt/CONTROL +++ b/ports/qwt/CONTROL @@ -1,4 +1,4 @@ Source: qwt Version: 6.1.3-2 Description: Qt widgets library for technical applications -Build-Depends: qt5 +Build-Depends: qt5base -- cgit v1.2.3 From 3a5b383bbec74dbaf0f1056e1a5d315e43d79375 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 6 Nov 2017 00:31:24 +1100 Subject: resolve conflict on non-existant vcpkg_acquire_depot_tools --- scripts/cmake/vcpkg_common_functions.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index e48b5e442..40111542d 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -25,5 +25,4 @@ include(vcpkg_copy_tool_dependencies) include(vcpkg_get_program_files_32_bit) include(vcpkg_get_program_files_platform_bitness) include(vcpkg_get_windows_sdk) -include(vcpkg_acquire_depot_tools) include(vcpkg_replace_string) -- cgit v1.2.3 From eec26f68fc0f380118b2de7670c98f7a639d9d4b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 20 Nov 2017 17:07:03 -0800 Subject: [qt5] Reduce duplication in modular build by extracting qt5modularscripts --- ports/qt5/CONTROL | 4 + ports/qt5/portfile.cmake | 1 + ports/qt53d/CONTROL | 2 +- ports/qt53d/fixcmake.py | 57 ------- ports/qt53d/portfile.cmake | 156 +------------------ ports/qt5base/configure_qt.cmake | 2 +- ports/qt5base/portfile.cmake | 9 +- ports/qt5base/qt_debug.conf | 6 +- ports/qt5base/qt_release.conf | 2 +- ports/qt5charts/CONTROL | 2 +- ports/qt5charts/fixcmake.py | 57 ------- ports/qt5charts/portfile.cmake | 156 +------------------ ports/qt5datavis3d/CONTROL | 4 + ports/qt5datavis3d/portfile.cmake | 5 + ports/qt5datavisualization3d/CONTROL | 4 - ports/qt5datavisualization3d/fixcmake.py | 57 ------- ports/qt5datavisualization3d/portfile.cmake | 157 ------------------- ports/qt5declarative/CONTROL | 2 +- ports/qt5declarative/fixcmake.py | 57 ------- ports/qt5declarative/portfile.cmake | 159 +------------------- ports/qt5gamepad/CONTROL | 2 +- ports/qt5gamepad/fixcmake.py | 57 ------- ports/qt5gamepad/portfile.cmake | 156 +------------------ ports/qt5imageformats/CONTROL | 2 +- ports/qt5imageformats/fixcmake.py | 57 ------- ports/qt5imageformats/portfile.cmake | 156 +------------------ ports/qt5modularscripts/CONTROL | 3 + ports/qt5modularscripts/fixcmake.py | 57 +++++++ ports/qt5modularscripts/portfile.cmake | 9 ++ ports/qt5modularscripts/qt_modular_library.cmake | 174 ++++++++++++++++++++++ ports/qt5multimedia/CONTROL | 2 +- ports/qt5multimedia/fixcmake.py | 57 ------- ports/qt5multimedia/portfile.cmake | 156 +------------------ ports/qt5scxml/CONTROL | 2 +- ports/qt5scxml/fixcmake.py | 57 ------- ports/qt5scxml/portfile.cmake | 156 +------------------ ports/qt5serial/CONTROL | 2 +- ports/qt5serial/fixcmake.py | 57 ------- ports/qt5serial/portfile.cmake | 156 +------------------ ports/qt5speech/CONTROL | 2 +- ports/qt5speech/fixcmake.py | 57 ------- ports/qt5speech/portfile.cmake | 156 +------------------ ports/qt5svg/CONTROL | 2 +- ports/qt5svg/fixcmake.py | 57 ------- ports/qt5svg/portfile.cmake | 156 +------------------ ports/qt5tools/CONTROL | 2 +- ports/qt5tools/fixcmake.py | 57 ------- ports/qt5tools/portfile.cmake | 156 +------------------ ports/qt5virtualkeyboard/CONTROL | 2 +- ports/qt5virtualkeyboard/fixcmake.py | 57 ------- ports/qt5virtualkeyboard/portfile.cmake | 156 +------------------ ports/qt5websockets/CONTROL | 2 +- ports/qt5websockets/fixcmake.py | 57 ------- ports/qt5websockets/portfile.cmake | 156 +------------------ ports/qt5winextras/CONTROL | 2 +- ports/qt5winextras/fixcmake.py | 57 ------- ports/qt5winextras/portfile.cmake | 156 +------------------ ports/qt5xmlpatterns/CONTROL | 2 +- ports/qt5xmlpatterns/fixcmake.py | 57 ------- ports/qt5xmlpatterns/portfile.cmake | 156 +------------------ scripts/cmake/vcpkg_configure_qmake_debug.cmake | 6 +- scripts/cmake/vcpkg_configure_qmake_release.cmake | 5 +- 62 files changed, 320 insertions(+), 3413 deletions(-) create mode 100644 ports/qt5/CONTROL create mode 100644 ports/qt5/portfile.cmake delete mode 100644 ports/qt53d/fixcmake.py delete mode 100644 ports/qt5charts/fixcmake.py create mode 100644 ports/qt5datavis3d/CONTROL create mode 100644 ports/qt5datavis3d/portfile.cmake delete mode 100644 ports/qt5datavisualization3d/CONTROL delete mode 100644 ports/qt5datavisualization3d/fixcmake.py delete mode 100644 ports/qt5datavisualization3d/portfile.cmake delete mode 100644 ports/qt5declarative/fixcmake.py delete mode 100644 ports/qt5gamepad/fixcmake.py delete mode 100644 ports/qt5imageformats/fixcmake.py create mode 100644 ports/qt5modularscripts/CONTROL create mode 100644 ports/qt5modularscripts/fixcmake.py create mode 100644 ports/qt5modularscripts/portfile.cmake create mode 100644 ports/qt5modularscripts/qt_modular_library.cmake delete mode 100644 ports/qt5multimedia/fixcmake.py delete mode 100644 ports/qt5scxml/fixcmake.py delete mode 100644 ports/qt5serial/fixcmake.py delete mode 100644 ports/qt5speech/fixcmake.py delete mode 100644 ports/qt5svg/fixcmake.py delete mode 100644 ports/qt5tools/fixcmake.py delete mode 100644 ports/qt5virtualkeyboard/fixcmake.py delete mode 100644 ports/qt5websockets/fixcmake.py delete mode 100644 ports/qt5winextras/fixcmake.py delete mode 100644 ports/qt5xmlpatterns/fixcmake.py 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/fixcmake.py b/ports/qt53d/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt53d/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/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/qt5datavis3d/CONTROL b/ports/qt5datavis3d/CONTROL new file mode 100644 index 000000000..c3f2157f8 --- /dev/null +++ b/ports/qt5datavis3d/CONTROL @@ -0,0 +1,4 @@ +Source: qt5datavis3d +Version: 5.9.2-0 +Description: Qt5 Data Visualization 3d Module - UI Components for creating 3D data visualizations +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/CONTROL b/ports/qt5datavisualization3d/CONTROL deleted file mode 100644 index f48b02579..000000000 --- a/ports/qt5datavisualization3d/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5datavisualization3d -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 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/qt5modularscripts/fixcmake.py b/ports/qt5modularscripts/fixcmake.py new file mode 100644 index 000000000..923e600bc --- /dev/null +++ b/ports/qt5modularscripts/fixcmake.py @@ -0,0 +1,57 @@ +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/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 ) -- cgit v1.2.3 From 768acf196685e6662b50fa87396d496d374ace61 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Sun, 3 Dec 2017 10:30:13 +1100 Subject: re-add debug tools: --- ports/qt5base/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/qt5base/portfile.cmake b/ports/qt5base/portfile.cmake index 5cb7c6b82..c5ec1ea9d 100644 --- a/ports/qt5base/portfile.cmake +++ b/ports/qt5base/portfile.cmake @@ -77,6 +77,7 @@ 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}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/qt_debug.conf ${CMAKE_CURRENT_LIST_DIR}/qt_release.conf DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) -- cgit v1.2.3 From c6a82f27f197b1129eddb561eb14d26f67b4cd36 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Sun, 3 Dec 2017 19:19:08 +1100 Subject: put qtmain in manual link directory, resolve resultant build issues with qtdeclarative --- ports/qt5base/fixcmake.py | 11 +++++++++++ ports/qt5base/portfile.cmake | 20 ++++++++++++++++++++ ports/qt5modularscripts/qt_modular_library.cmake | 21 ++++++++++++++------- 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/ports/qt5base/fixcmake.py b/ports/qt5base/fixcmake.py index 923e600bc..bcfb12ac5 100644 --- a/ports/qt5base/fixcmake.py +++ b/ports/qt5base/fixcmake.py @@ -42,6 +42,17 @@ for f in files: builder += " else()" builder += "\n " + line.replace("/plugins/", "/debug/plugins/") builder += " endif()\n" + elif "_install_prefix}/lib/qtmaind.lib" in line: + # qtmaind.lib has been moved to manual-link: + builder += line.replace("/lib/", "/debug/lib/manual-link/") + elif "_install_prefix}/lib/qtmain.lib" in line: + # qtmain(d).lib has been moved to manual-link: + builder += line.replace("/lib/", "/lib/manual-link/") + builder += " set(imported_location_debug \"${_qt5Core_install_prefix}/debug/lib/manual-link/qtmaind.lib\")\n" + builder += "\n" + builder += " set_target_properties(Qt5::WinMain PROPERTIES\n" + builder += " IMPORTED_LOCATION_DEBUG ${imported_location_debug}\n" + builder += " )\n" elif dllpattern.search(line) != None: builder += line.replace("/bin/", "/debug/bin/") elif libpattern.search(line) != None: diff --git a/ports/qt5base/portfile.cmake b/ports/qt5base/portfile.cmake index c5ec1ea9d..02122f9cc 100644 --- a/ports/qt5base/portfile.cmake +++ b/ports/qt5base/portfile.cmake @@ -91,4 +91,24 @@ vcpkg_execute_required_process( vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/qt5) +#--------------------------------------------------------------------------- +# qtmain(d) vs. Qt5AxServer(d) +#--------------------------------------------------------------------------- +# Qt applications have to either link to qtmain(d) or to Qt5AxServer(d), +# never both. See http://doc.qt.io/qt-5/activeqt-server.html for more info. +# +# Create manual-link folders: +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +# +# Either have users explicitly link against qtmain.lib, qtmaind.lib: +file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib) +file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl) +file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl) + file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5base RENAME copyright) diff --git a/ports/qt5modularscripts/qt_modular_library.cmake b/ports/qt5modularscripts/qt_modular_library.cmake index 6fa4c20c8..518f226bb 100644 --- a/ports/qt5modularscripts/qt_modular_library.cmake +++ b/ports/qt5modularscripts/qt_modular_library.cmake @@ -41,6 +41,12 @@ function(qt_modular_library NAME HASH) get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") + 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) + #Configure debug vcpkg_configure_qmake_debug( SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} @@ -56,6 +62,7 @@ function(qt_modular_library NAME HASH) 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}") + string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib qtmaind.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib\\manual-link qtmaind.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib" _contents "${_contents}") file(WRITE "${DEBUG_MAKEFILE}" "${_contents}") endforeach() @@ -73,6 +80,12 @@ function(qt_modular_library NAME HASH) #Store release makefile path file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) + foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) + file(READ "${RELEASE_MAKEFILE}" _contents) + string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\lib qtmain.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib\\manual-link qtmain.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib" _contents "${_contents}") + file(WRITE "${RELEASE_MAKEFILE}" "${_contents}") + endforeach() + #Build release vcpkg_build_qmake_release() @@ -84,13 +97,7 @@ function(qt_modular_library NAME HASH) 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}") -- cgit v1.2.3 From e373beac70dcad693acc7f08c5be829888675eb6 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 5 Dec 2017 08:15:49 +1100 Subject: remove commented sections --- ports/qt53d/CONTROL | 2 +- ports/qt5modularscripts/qt_modular_library.cmake | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/ports/qt53d/CONTROL b/ports/qt53d/CONTROL index b75c6b7bf..d157525ee 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: qt5modularscripts, qt5base \ No newline at end of file +Build-Depends: qt5modularscripts, qt5base, qt5declarative \ No newline at end of file diff --git a/ports/qt5modularscripts/qt_modular_library.cmake b/ports/qt5modularscripts/qt_modular_library.cmake index 518f226bb..7aff90f9b 100644 --- a/ports/qt5modularscripts/qt_modular_library.cmake +++ b/ports/qt5modularscripts/qt_modular_library.cmake @@ -144,26 +144,11 @@ function(qt_modular_library NAME HASH) 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 -- cgit v1.2.3 From eb92719c5d41b3013050b269ba5ec85383789b17 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Fri, 15 Dec 2017 07:02:25 +1100 Subject: fix naming issues --- ports/qt5modularscripts/qt_modular_library.cmake | 2 +- ports/qt5serial/CONTROL | 4 ---- ports/qt5serial/portfile.cmake | 5 ----- ports/qt5serialport/CONTROL | 4 ++++ ports/qt5serialport/portfile.cmake | 5 +++++ 5 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 ports/qt5serial/CONTROL delete mode 100644 ports/qt5serial/portfile.cmake create mode 100644 ports/qt5serialport/CONTROL create mode 100644 ports/qt5serialport/portfile.cmake diff --git a/ports/qt5modularscripts/qt_modular_library.cmake b/ports/qt5modularscripts/qt_modular_library.cmake index 7aff90f9b..b841d9eb7 100644 --- a/ports/qt5modularscripts/qt_modular_library.cmake +++ b/ports/qt5modularscripts/qt_modular_library.cmake @@ -61,7 +61,7 @@ function(qt_modular_library NAME HASH) 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}") + string(REPLACE "installed\\${TARGET_TRIPLET}\\lib" "installed\\${TARGET_TRIPLET}\\debug\\lib" _contents "${_contents}") string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib qtmaind.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib\\manual-link qtmaind.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib" _contents "${_contents}") file(WRITE "${DEBUG_MAKEFILE}" "${_contents}") endforeach() diff --git a/ports/qt5serial/CONTROL b/ports/qt5serial/CONTROL deleted file mode 100644 index 7782e6a53..000000000 --- a/ports/qt5serial/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5serial -Version: 5.9.2-0 -Description: Qt5 Serial Port - provides access to hardware and virtual serial ports -Build-Depends: qt5modularscripts, qt5base \ No newline at end of file diff --git a/ports/qt5serial/portfile.cmake b/ports/qt5serial/portfile.cmake deleted file mode 100644 index f4a42f38f..000000000 --- a/ports/qt5serial/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtserialport cc8899c1ae2ed9fd8cf1c213ab7efaec12b3b16836006fdbf74cb7ea457705505a13e82c2f2873ee9426ae66473ec42259f4e728de64576ee44420f116cc433d) diff --git a/ports/qt5serialport/CONTROL b/ports/qt5serialport/CONTROL new file mode 100644 index 000000000..eb87231e0 --- /dev/null +++ b/ports/qt5serialport/CONTROL @@ -0,0 +1,4 @@ +Source: qt5serialport +Version: 5.9.2-0 +Description: Qt5 Serial Port - provides access to hardware and virtual serial ports +Build-Depends: qt5modularscripts, qt5base \ No newline at end of file diff --git a/ports/qt5serialport/portfile.cmake b/ports/qt5serialport/portfile.cmake new file mode 100644 index 000000000..f4a42f38f --- /dev/null +++ b/ports/qt5serialport/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtserialport cc8899c1ae2ed9fd8cf1c213ab7efaec12b3b16836006fdbf74cb7ea457705505a13e82c2f2873ee9426ae66473ec42259f4e728de64576ee44420f116cc433d) -- cgit v1.2.3 From 54c0f87da73fba58b70a105046abdb55f40d015a Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Fri, 15 Dec 2017 07:07:24 +1100 Subject: change to python2 for future web engine support --- ports/qt5modularscripts/qt_modular_library.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/qt5modularscripts/qt_modular_library.cmake b/ports/qt5modularscripts/qt_modular_library.cmake index b841d9eb7..336a3913d 100644 --- a/ports/qt5modularscripts/qt_modular_library.cmake +++ b/ports/qt5modularscripts/qt_modular_library.cmake @@ -37,9 +37,9 @@ function(qt_modular_library NAME HASH) 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}") + vcpkg_find_acquire_program(PYTHON2) + get_filename_component(PYTHON2_EXE_PATH ${PYTHON2} DIRECTORY) + set(ENV{PATH} "${PYTHON2_EXE_PATH};$ENV{PATH}") file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR) file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR) @@ -92,7 +92,7 @@ function(qt_modular_library NAME HASH) #Fix the cmake files if they exist if(EXISTS ${RELEASE_DIR}/lib/cmake) vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${_qt5base_port_dir}/fixcmake.py + COMMAND ${PYTHON2} ${_qt5base_port_dir}/fixcmake.py WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake LOGNAME fix-cmake ) -- cgit v1.2.3 From 22e9a2b25db21e1d1a1f75786442f2c90ae0db0c Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Fri, 15 Dec 2017 07:15:38 +1100 Subject: change serial module name --- ports/qt5/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index 060b41e3c..e8c7f6f01 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +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 +Build-Depends: qt5base, qt5charts, qt5datavis3d, qt5declarative, qt5gamepad, qt5imageformats, qt5multimedia, qt5scxml, qt5serialport, qt5speech, qt5svg, qt5tools, qt5virtualkeyboard, qt5websockets, qt53d, qt5winextras, qt5xmlpatterns -- cgit v1.2.3 From fe94a33bfe9c23c9ba766a2a689e7afec3bde198 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Sun, 31 Dec 2017 08:25:28 +1100 Subject: qt5 network auth module --- ports/qt5/CONTROL | 2 +- ports/qt5networkauth/CONTROL | 4 ++++ ports/qt5networkauth/portfile.cmake | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 ports/qt5networkauth/CONTROL create mode 100644 ports/qt5networkauth/portfile.cmake diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index 7c87d3806..f8817e1db 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +1,4 @@ Source: qt5 Version: 5.9.2-1 Description: Qt5 Application Framework -Build-Depends: qt5base, qt5charts, qt5datavis3d, qt5declarative, qt5gamepad, qt5imageformats, qt5multimedia, qt5scxml, qt5serialport, qt5speech, qt5svg, qt5tools, qt5virtualkeyboard, qt5websockets, qt53d, qt5winextras, qt5xmlpatterns \ No newline at end of file +Build-Depends: qt5base, qt5charts, qt5datavis3d, qt5declarative, qt5gamepad, qt5imageformats, qt5multimedia, qt5networkauth, qt5scxml, qt5serialport, qt5speech, qt5svg, qt5tools, qt5virtualkeyboard, qt5websockets, qt53d, qt5winextras, qt5xmlpatterns \ No newline at end of file diff --git a/ports/qt5networkauth/CONTROL b/ports/qt5networkauth/CONTROL new file mode 100644 index 000000000..0e5f45f96 --- /dev/null +++ b/ports/qt5networkauth/CONTROL @@ -0,0 +1,4 @@ +Source: qt5networkauth +Version: 5.9.2-0 +Description: Qt5 Network Authorization Module +Build-Depends: qt5modularscripts, qt5base \ No newline at end of file diff --git a/ports/qt5networkauth/portfile.cmake b/ports/qt5networkauth/portfile.cmake new file mode 100644 index 000000000..c9b9db47c --- /dev/null +++ b/ports/qt5networkauth/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtnetworkauth 2e83eefd5db62aa1cdbe451b432ba1937541e435dcc35205d3bb9b947f2ac7e31663dc069a6cfad5bbf34e1fa799d519820f7ed61b9c247016611a533385bebf) \ No newline at end of file -- cgit v1.2.3 From 47189e90d59459be69d4f6a0b039849913031c8e Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Sun, 31 Dec 2017 10:12:22 +1100 Subject: fix qwt build --- ports/qwt/CONTROL | 2 +- ports/qwt/portfile.cmake | 64 +++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 56 insertions(+), 10 deletions(-) diff --git a/ports/qwt/CONTROL b/ports/qwt/CONTROL index 60539483b..c30b97779 100644 --- a/ports/qwt/CONTROL +++ b/ports/qwt/CONTROL @@ -1,4 +1,4 @@ Source: qwt Version: 6.1.3-2 Description: Qt widgets library for technical applications -Build-Depends: qt5base +Build-Depends: qt5base, qt5svg diff --git a/ports/qwt/portfile.cmake b/ports/qwt/portfile.cmake index 99f84425a..f4be871b7 100644 --- a/ports/qwt/portfile.cmake +++ b/ports/qwt/portfile.cmake @@ -24,37 +24,83 @@ endif() # The qwt build requires zlib1.dll SET(ENV{PATH} "$ENV{PATH};${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin") -vcpkg_configure_qmake( +#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}") + +#Configure debug +vcpkg_configure_qmake_debug( + SOURCE_PATH ${SOURCE_PATH} +) + +#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 "installed\\${TARGET_TRIPLET}\\lib" "installed\\${TARGET_TRIPLET}\\debug\\lib" _contents "${_contents}") + string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib qtmaind.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib\\manual-link qtmaind.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib" _contents "${_contents}") + file(WRITE "${DEBUG_MAKEFILE}" "${_contents}") +endforeach() + +#Build debug +vcpkg_build_qmake_debug(TARGETS sub-src-debug_ordered) + +#Configure release +vcpkg_configure_qmake_release( SOURCE_PATH ${SOURCE_PATH} ) -vcpkg_build_qmake() +#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*) + +foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) + file(READ "${RELEASE_MAKEFILE}" _contents) + string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\lib qtmain.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib\\manual-link qtmain.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib" _contents "${_contents}") + file(WRITE "${RELEASE_MAKEFILE}" "${_contents}") +endforeach() + +#Build release +vcpkg_build_qmake_release(TARGETS sub-src-release_ordered) -# Install following vcpkg conventions -set(BUILD_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) +#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 header files file(GLOB HEADER_FILES ${SOURCE_PATH}/src/*.h) file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/qwt) +#Install the module files file(INSTALL - ${BUILD_DIR}/lib/qwt.lib + ${RELEASE_DIR}/lib/qwt.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib ) file(INSTALL - ${BUILD_DIR}/lib/qwtd.lib + ${DEBUG_DIR}/lib/qwtd.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib ) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(INSTALL - ${BUILD_DIR}/lib/qwt.dll + ${RELEASE_DIR}/lib/qwt.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin ) file(INSTALL - ${BUILD_DIR}/lib/qwtd.dll - ${BUILD_DIR}/lib/qwtd.pdb + ${DEBUG_DIR}/lib/qwtd.dll + ${DEBUG_DIR}/lib/qwtd.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin ) endif() -- cgit v1.2.3 From ca9ff199d6024fa0ef26abcba920928215d77f38 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Thu, 18 Jan 2018 10:02:56 +1100 Subject: append hyphen to qt5 module names --- ports/qt5-3d/CONTROL | 4 + ports/qt5-3d/portfile.cmake | 5 + ports/qt5-base/CONTROL | 4 + ports/qt5-base/configure_qt.cmake | 64 +++++++++ ports/qt5-base/fix-system-pcre2.patch | 18 +++ ports/qt5-base/fixcmake.py | 68 +++++++++ ports/qt5-base/install_qt.cmake | 46 ++++++ ports/qt5-base/portfile.cmake | 114 +++++++++++++++ ports/qt5-base/qt_debug.conf | 13 ++ ports/qt5-base/qt_release.conf | 13 ++ ports/qt5-charts/CONTROL | 4 + ports/qt5-charts/portfile.cmake | 5 + ports/qt5-datavis3d/CONTROL | 4 + ports/qt5-datavis3d/portfile.cmake | 5 + ports/qt5-declarative/CONTROL | 4 + ports/qt5-declarative/portfile.cmake | 5 + ports/qt5-gamepad/CONTROL | 4 + ports/qt5-gamepad/portfile.cmake | 5 + ports/qt5-imageformats/CONTROL | 4 + ports/qt5-imageformats/portfile.cmake | 7 + ports/qt5-modularscripts/CONTROL | 3 + ports/qt5-modularscripts/fixcmake.py | 57 ++++++++ ports/qt5-modularscripts/portfile.cmake | 9 ++ ports/qt5-modularscripts/qt_modular_library.cmake | 166 ++++++++++++++++++++++ ports/qt5-multimedia/CONTROL | 4 + ports/qt5-multimedia/portfile.cmake | 5 + ports/qt5-networkauth/CONTROL | 4 + ports/qt5-networkauth/portfile.cmake | 5 + ports/qt5-scxml/CONTROL | 4 + ports/qt5-scxml/portfile.cmake | 5 + ports/qt5-serialport/CONTROL | 4 + ports/qt5-serialport/portfile.cmake | 5 + ports/qt5-speech/CONTROL | 4 + ports/qt5-speech/portfile.cmake | 5 + ports/qt5-svg/CONTROL | 4 + ports/qt5-svg/portfile.cmake | 5 + ports/qt5-tools/CONTROL | 4 + ports/qt5-tools/portfile.cmake | 5 + ports/qt5-virtualkeyboard/CONTROL | 4 + ports/qt5-virtualkeyboard/portfile.cmake | 7 + ports/qt5-websockets/CONTROL | 4 + ports/qt5-websockets/portfile.cmake | 5 + ports/qt5-winextras/CONTROL | 4 + ports/qt5-winextras/portfile.cmake | 5 + ports/qt5-xmlpatterns/CONTROL | 4 + ports/qt5-xmlpatterns/portfile.cmake | 5 + ports/qt5/CONTROL | 2 +- ports/qt53d/CONTROL | 4 - ports/qt53d/portfile.cmake | 5 - ports/qt5base/CONTROL | 4 - ports/qt5base/configure_qt.cmake | 64 --------- ports/qt5base/fix-system-pcre2.patch | 18 --- ports/qt5base/fixcmake.py | 68 --------- ports/qt5base/install_qt.cmake | 46 ------ ports/qt5base/portfile.cmake | 114 --------------- ports/qt5base/qt_debug.conf | 13 -- ports/qt5base/qt_release.conf | 13 -- ports/qt5charts/CONTROL | 4 - ports/qt5charts/portfile.cmake | 5 - ports/qt5datavis3d/CONTROL | 4 - ports/qt5datavis3d/portfile.cmake | 5 - ports/qt5declarative/CONTROL | 4 - ports/qt5declarative/portfile.cmake | 5 - ports/qt5gamepad/CONTROL | 4 - ports/qt5gamepad/portfile.cmake | 5 - ports/qt5imageformats/CONTROL | 4 - ports/qt5imageformats/portfile.cmake | 7 - ports/qt5modularscripts/CONTROL | 3 - ports/qt5modularscripts/fixcmake.py | 57 -------- ports/qt5modularscripts/portfile.cmake | 9 -- ports/qt5modularscripts/qt_modular_library.cmake | 166 ---------------------- ports/qt5multimedia/CONTROL | 4 - ports/qt5multimedia/portfile.cmake | 5 - ports/qt5networkauth/CONTROL | 4 - ports/qt5networkauth/portfile.cmake | 5 - ports/qt5scxml/CONTROL | 4 - ports/qt5scxml/portfile.cmake | 5 - ports/qt5serialport/CONTROL | 4 - ports/qt5serialport/portfile.cmake | 5 - ports/qt5speech/CONTROL | 4 - ports/qt5speech/portfile.cmake | 5 - ports/qt5svg/CONTROL | 4 - ports/qt5svg/portfile.cmake | 5 - ports/qt5tools/CONTROL | 4 - ports/qt5tools/portfile.cmake | 5 - ports/qt5virtualkeyboard/CONTROL | 4 - ports/qt5virtualkeyboard/portfile.cmake | 7 - ports/qt5websockets/CONTROL | 4 - ports/qt5websockets/portfile.cmake | 5 - ports/qt5winextras/CONTROL | 4 - ports/qt5winextras/portfile.cmake | 5 - ports/qt5xmlpatterns/CONTROL | 4 - ports/qt5xmlpatterns/portfile.cmake | 5 - 93 files changed, 733 insertions(+), 733 deletions(-) create mode 100644 ports/qt5-3d/CONTROL create mode 100644 ports/qt5-3d/portfile.cmake create mode 100644 ports/qt5-base/CONTROL create mode 100644 ports/qt5-base/configure_qt.cmake create mode 100644 ports/qt5-base/fix-system-pcre2.patch create mode 100644 ports/qt5-base/fixcmake.py create mode 100644 ports/qt5-base/install_qt.cmake create mode 100644 ports/qt5-base/portfile.cmake create mode 100644 ports/qt5-base/qt_debug.conf create mode 100644 ports/qt5-base/qt_release.conf create mode 100644 ports/qt5-charts/CONTROL create mode 100644 ports/qt5-charts/portfile.cmake create mode 100644 ports/qt5-datavis3d/CONTROL create mode 100644 ports/qt5-datavis3d/portfile.cmake create mode 100644 ports/qt5-declarative/CONTROL create mode 100644 ports/qt5-declarative/portfile.cmake create mode 100644 ports/qt5-gamepad/CONTROL create mode 100644 ports/qt5-gamepad/portfile.cmake create mode 100644 ports/qt5-imageformats/CONTROL create mode 100644 ports/qt5-imageformats/portfile.cmake create mode 100644 ports/qt5-modularscripts/CONTROL create mode 100644 ports/qt5-modularscripts/fixcmake.py create mode 100644 ports/qt5-modularscripts/portfile.cmake create mode 100644 ports/qt5-modularscripts/qt_modular_library.cmake create mode 100644 ports/qt5-multimedia/CONTROL create mode 100644 ports/qt5-multimedia/portfile.cmake create mode 100644 ports/qt5-networkauth/CONTROL create mode 100644 ports/qt5-networkauth/portfile.cmake create mode 100644 ports/qt5-scxml/CONTROL create mode 100644 ports/qt5-scxml/portfile.cmake create mode 100644 ports/qt5-serialport/CONTROL create mode 100644 ports/qt5-serialport/portfile.cmake create mode 100644 ports/qt5-speech/CONTROL create mode 100644 ports/qt5-speech/portfile.cmake create mode 100644 ports/qt5-svg/CONTROL create mode 100644 ports/qt5-svg/portfile.cmake create mode 100644 ports/qt5-tools/CONTROL create mode 100644 ports/qt5-tools/portfile.cmake create mode 100644 ports/qt5-virtualkeyboard/CONTROL create mode 100644 ports/qt5-virtualkeyboard/portfile.cmake create mode 100644 ports/qt5-websockets/CONTROL create mode 100644 ports/qt5-websockets/portfile.cmake create mode 100644 ports/qt5-winextras/CONTROL create mode 100644 ports/qt5-winextras/portfile.cmake create mode 100644 ports/qt5-xmlpatterns/CONTROL create mode 100644 ports/qt5-xmlpatterns/portfile.cmake delete mode 100644 ports/qt53d/CONTROL delete mode 100644 ports/qt53d/portfile.cmake delete mode 100644 ports/qt5base/CONTROL delete mode 100644 ports/qt5base/configure_qt.cmake delete mode 100644 ports/qt5base/fix-system-pcre2.patch delete mode 100644 ports/qt5base/fixcmake.py delete mode 100644 ports/qt5base/install_qt.cmake delete mode 100644 ports/qt5base/portfile.cmake delete mode 100644 ports/qt5base/qt_debug.conf delete mode 100644 ports/qt5base/qt_release.conf delete mode 100644 ports/qt5charts/CONTROL delete mode 100644 ports/qt5charts/portfile.cmake delete mode 100644 ports/qt5datavis3d/CONTROL delete mode 100644 ports/qt5datavis3d/portfile.cmake delete mode 100644 ports/qt5declarative/CONTROL delete mode 100644 ports/qt5declarative/portfile.cmake delete mode 100644 ports/qt5gamepad/CONTROL delete mode 100644 ports/qt5gamepad/portfile.cmake delete mode 100644 ports/qt5imageformats/CONTROL delete mode 100644 ports/qt5imageformats/portfile.cmake delete mode 100644 ports/qt5modularscripts/CONTROL delete mode 100644 ports/qt5modularscripts/fixcmake.py delete mode 100644 ports/qt5modularscripts/portfile.cmake delete mode 100644 ports/qt5modularscripts/qt_modular_library.cmake delete mode 100644 ports/qt5multimedia/CONTROL delete mode 100644 ports/qt5multimedia/portfile.cmake delete mode 100644 ports/qt5networkauth/CONTROL delete mode 100644 ports/qt5networkauth/portfile.cmake delete mode 100644 ports/qt5scxml/CONTROL delete mode 100644 ports/qt5scxml/portfile.cmake delete mode 100644 ports/qt5serialport/CONTROL delete mode 100644 ports/qt5serialport/portfile.cmake delete mode 100644 ports/qt5speech/CONTROL delete mode 100644 ports/qt5speech/portfile.cmake delete mode 100644 ports/qt5svg/CONTROL delete mode 100644 ports/qt5svg/portfile.cmake delete mode 100644 ports/qt5tools/CONTROL delete mode 100644 ports/qt5tools/portfile.cmake delete mode 100644 ports/qt5virtualkeyboard/CONTROL delete mode 100644 ports/qt5virtualkeyboard/portfile.cmake delete mode 100644 ports/qt5websockets/CONTROL delete mode 100644 ports/qt5websockets/portfile.cmake delete mode 100644 ports/qt5winextras/CONTROL delete mode 100644 ports/qt5winextras/portfile.cmake delete mode 100644 ports/qt5xmlpatterns/CONTROL delete mode 100644 ports/qt5xmlpatterns/portfile.cmake diff --git a/ports/qt5-3d/CONTROL b/ports/qt5-3d/CONTROL new file mode 100644 index 000000000..9213e0356 --- /dev/null +++ b/ports/qt5-3d/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-3d +Version: 5.9.2-0 +Description: Qt5 3d Module - Functionality for near-realtime simulation systems with support for 2D and 3D rendering +Build-Depends: qt5-modularscripts, qt5-base, qt5-declarative diff --git a/ports/qt5-3d/portfile.cmake b/ports/qt5-3d/portfile.cmake new file mode 100644 index 000000000..7de7bb5d5 --- /dev/null +++ b/ports/qt5-3d/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qt3d 1c7dbd4e557cdd183ec6e929aae5727ce2ffcb519517942b588594bb81a78cb3d732cde4dae58085a70ec2968a8c2443eae96536125c25938222ff7c89f4f9a2) diff --git a/ports/qt5-base/CONTROL b/ports/qt5-base/CONTROL new file mode 100644 index 000000000..f2a507e19 --- /dev/null +++ b/ports/qt5-base/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-base +Version: 5.9.2-0 +Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components. +Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion diff --git a/ports/qt5-base/configure_qt.cmake b/ports/qt5-base/configure_qt.cmake new file mode 100644 index 000000000..1d4f1e570 --- /dev/null +++ b/ports/qt5-base/configure_qt.cmake @@ -0,0 +1,64 @@ +function(configure_qt) + cmake_parse_arguments(_csc "" "SOURCE_PATH;PLATFORM" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) + + if (_csc_PLATFORM) + set(PLATFORM ${_csc_PLATFORM}) + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v140") + set(PLATFORM "win32-msvc2015") + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(PLATFORM "win32-msvc2017") + endif() + + vcpkg_find_acquire_program(PERL) + get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) + + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}") + + if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) + list(APPEND _csc_OPTIONS + "-static" + "-static-runtime" + ) + endif() + + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + vcpkg_execute_required_process( + COMMAND "${_csc_SOURCE_PATH}/configure.bat" ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} + -debug + -prefix ${CURRENT_PACKAGES_DIR}/debug + -hostbindir ${CURRENT_PACKAGES_DIR}/debug/tools/qt5 + -archdatadir ${CURRENT_PACKAGES_DIR}/share/qt5/debug + -datadir ${CURRENT_PACKAGES_DIR}/share/qt5/debug + -plugindir ${CURRENT_PACKAGES_DIR}/debug/plugins + -qmldir ${CURRENT_PACKAGES_DIR}/debug/qml + -headerdir ${CURRENT_PACKAGES_DIR}/include + -I ${CURRENT_INSTALLED_DIR}/include + -L ${CURRENT_INSTALLED_DIR}/debug/lib + -platform ${PLATFORM} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + vcpkg_execute_required_process( + COMMAND "${_csc_SOURCE_PATH}/configure.bat" ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} + -release + -prefix ${CURRENT_PACKAGES_DIR} + -hostbindir ${CURRENT_PACKAGES_DIR}/tools/qt5 + -archdatadir ${CURRENT_PACKAGES_DIR}/share/qt5 + -datadir ${CURRENT_PACKAGES_DIR}/share/qt5 + -plugindir ${CURRENT_PACKAGES_DIR}/plugins + -qmldir ${CURRENT_PACKAGES_DIR}/qml + -I ${CURRENT_INSTALLED_DIR}/include + -L ${CURRENT_INSTALLED_DIR}/lib + -platform ${PLATFORM} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME config-${TARGET_TRIPLET}-rel + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + +endfunction() \ No newline at end of file diff --git a/ports/qt5-base/fix-system-pcre2.patch b/ports/qt5-base/fix-system-pcre2.patch new file mode 100644 index 000000000..be401d448 --- /dev/null +++ b/ports/qt5-base/fix-system-pcre2.patch @@ -0,0 +1,18 @@ +diff --git a/src/corelib/configure.json b/src/corelib/configure.json +index a5b69a2..01c5cde 100644 +--- a/src/corelib/configure.json ++++ b/src/corelib/configure.json +@@ -159,7 +159,12 @@ + ] + }, + "sources": [ +- "-lpcre2-16" ++ { ++ "builds": { ++ "debug": "-lpcre2-16d", ++ "release": "-lpcre2-16" ++ } ++ } + ] + }, + "pps": { diff --git a/ports/qt5-base/fixcmake.py b/ports/qt5-base/fixcmake.py new file mode 100644 index 000000000..bcfb12ac5 --- /dev/null +++ b/ports/qt5-base/fixcmake.py @@ -0,0 +1,68 @@ +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 "_install_prefix}/lib/qtmaind.lib" in line: + # qtmaind.lib has been moved to manual-link: + builder += line.replace("/lib/", "/debug/lib/manual-link/") + elif "_install_prefix}/lib/qtmain.lib" in line: + # qtmain(d).lib has been moved to manual-link: + builder += line.replace("/lib/", "/lib/manual-link/") + builder += " set(imported_location_debug \"${_qt5Core_install_prefix}/debug/lib/manual-link/qtmaind.lib\")\n" + builder += "\n" + builder += " set_target_properties(Qt5::WinMain PROPERTIES\n" + builder += " IMPORTED_LOCATION_DEBUG ${imported_location_debug}\n" + builder += " )\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/qt5-base/install_qt.cmake b/ports/qt5-base/install_qt.cmake new file mode 100644 index 000000000..37528e4e6 --- /dev/null +++ b/ports/qt5-base/install_qt.cmake @@ -0,0 +1,46 @@ +function(install_qt) + cmake_parse_arguments(_bc "DISABLE_PARALLEL" "" "" ${ARGN}) + + if (_bc_DISABLE_PARALLEL) + set(JOBS "1") + else() + set(JOBS "$ENV{NUMBER_OF_PROCESSORS}") + endif() + + vcpkg_find_acquire_program(JOM) + vcpkg_find_acquire_program(PYTHON3) + get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) + set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") + set(_path "$ENV{PATH}") + + message(STATUS "Package ${TARGET_TRIPLET}-dbg") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/bin;${_path}") + vcpkg_execute_required_process( + COMMAND ${JOM} /J ${JOBS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME build-${TARGET_TRIPLET}-dbg + ) + vcpkg_execute_required_process( + COMMAND ${JOM} /J ${JOBS} install + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME package-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Package ${TARGET_TRIPLET}-dbg done") + + message(STATUS "Package ${TARGET_TRIPLET}-rel") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/bin;${_path}") + vcpkg_execute_required_process( + COMMAND ${JOM} /J ${JOBS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME build-${TARGET_TRIPLET}-rel + ) + vcpkg_execute_required_process( + COMMAND ${JOM} /J ${JOBS} install + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME package-${TARGET_TRIPLET}-rel + ) + message(STATUS "Package ${TARGET_TRIPLET}-rel done") + + set(ENV{PATH} "${_path}") + +endfunction() \ No newline at end of file diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake new file mode 100644 index 000000000..bde933392 --- /dev/null +++ b/ports/qt5-base/portfile.cmake @@ -0,0 +1,114 @@ +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}) +include(configure_qt) +include(install_qt) + +set(SRCDIR_NAME "qtbase-5.9.2") +set(ARCHIVE_NAME "qtbase-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 a2f965871645256f3d019f71f3febb875455a29d03fccc7a3371ddfeb193b0af12394e779df05adf69fd10fe7b0d966f3915a24528ec7eb3bc36c2db6af2b6e7 +) +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() + +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-system-pcre2.patch" +) + +# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings +set(ENV{_CL_} "/utf-8") + +configure_qt( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -confirm-license + -opensource + -system-zlib + -system-libjpeg + -system-libpng + -system-freetype + -system-pcre + -system-harfbuzz + -system-doubleconversion + -system-sqlite + -sql-sqlite + -sql-psql + -feature-freetype + -nomake examples -nomake tests + -opengl desktop # other options are "-no-opengl" and "-opengl angle" + -mp + LIBJPEG_LIBS="-ljpeg" + OPTIONS_RELEASE + ZLIB_LIBS="-lzlib" + LIBPNG_LIBS="-llibpng16" + OPTIONS_DEBUG + ZLIB_LIBS="-lzlibd" + LIBPNG_LIBS="-llibpng16d" + PSQL_LIBS="-llibpqd" + FREETYPE_LIBS="-lfreetyped" +) + +install_qt() + +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +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}) + +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 + WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/cmake + LOGNAME fix-cmake +) + +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/qt5) + +#--------------------------------------------------------------------------- +# qtmain(d) vs. Qt5AxServer(d) +#--------------------------------------------------------------------------- +# Qt applications have to either link to qtmain(d) or to Qt5AxServer(d), +# never both. See http://doc.qt.io/qt-5/activeqt-server.html for more info. +# +# Create manual-link folders: +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +# +# Either have users explicitly link against qtmain.lib, qtmaind.lib: +file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib) +file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl) +file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/qt5-base/qt_debug.conf b/ports/qt5-base/qt_debug.conf new file mode 100644 index 000000000..1314d00b9 --- /dev/null +++ b/ports/qt5-base/qt_debug.conf @@ -0,0 +1,13 @@ +[Paths] +Prefix = ${CURRENT_INSTALLED_DIR} +Documentation = share/qt5/doc +Headers = include +Libraries = debug/lib +Binaries = debug/tools/qt5 +LibraryExecutables = debug/tools/qt5 +Plugins = debug/plugins +Qml2Imports = qml +Data = share/qt5/debug +ArchData = share/qt5/debug +HostData = share/qt5/debug +HostBinaries = debug/tools/qt5 \ No newline at end of file diff --git a/ports/qt5-base/qt_release.conf b/ports/qt5-base/qt_release.conf new file mode 100644 index 000000000..a04aef525 --- /dev/null +++ b/ports/qt5-base/qt_release.conf @@ -0,0 +1,13 @@ +[Paths] +Prefix = ${CURRENT_INSTALLED_DIR} +Documentation = share/qt5/doc +Headers = include +Libraries = lib +Binaries = tools/qt5 +LibraryExecutables = tools/qt5 +Plugins = plugins +Qml2Imports = qml +Data = share/qt5 +ArchData = share/qt5 +HostData = share/qt5 +HostBinaries = tools/qt5 \ No newline at end of file diff --git a/ports/qt5-charts/CONTROL b/ports/qt5-charts/CONTROL new file mode 100644 index 000000000..6f71277b6 --- /dev/null +++ b/ports/qt5-charts/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-charts +Version: 5.9.2-0 +Description: Qt5 Charts Module - UI components for displaying charts, driven by static or dynamic data models +Build-Depends: qt5-modularscripts, qt5-base diff --git a/ports/qt5-charts/portfile.cmake b/ports/qt5-charts/portfile.cmake new file mode 100644 index 000000000..45a53b63d --- /dev/null +++ b/ports/qt5-charts/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtcharts 297547b565dd71b05237bb05ecc1abf1a774a4909668417e78bd65e805c1e47a456a5a06898fe06d4c4614118e4129e19893d4c77598667a9354ab969307a293) diff --git a/ports/qt5-datavis3d/CONTROL b/ports/qt5-datavis3d/CONTROL new file mode 100644 index 000000000..cb4d7e393 --- /dev/null +++ b/ports/qt5-datavis3d/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-datavis3d +Version: 5.9.2-0 +Description: Qt5 Data Visualization 3d Module - UI Components for creating 3D data visualizations +Build-Depends: qt5-modularscripts, qt5-base diff --git a/ports/qt5-datavis3d/portfile.cmake b/ports/qt5-datavis3d/portfile.cmake new file mode 100644 index 000000000..d7a552cba --- /dev/null +++ b/ports/qt5-datavis3d/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/qt5-declarative/CONTROL b/ports/qt5-declarative/CONTROL new file mode 100644 index 000000000..ad3ebf978 --- /dev/null +++ b/ports/qt5-declarative/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-declarative +Version: 5.9.2-0 +Description: Qt5 Declarative (Quick 2) Module. Includes QtQuick, QtQuickParticles, QtQuickWidgets, QtQml, and QtPacketProtocol. +Build-Depends: qt5-modularscripts, qt5-base diff --git a/ports/qt5-declarative/portfile.cmake b/ports/qt5-declarative/portfile.cmake new file mode 100644 index 000000000..63ce79746 --- /dev/null +++ b/ports/qt5-declarative/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtdeclarative 49b8b50932b73ea39da14ac3425044193dfd64eabceadba379aa01cf2fc141177f9870c387caf1cf93ce09e8b197828a54b8d9fcefc4d9cdf400a6c6dd9a9e90) diff --git a/ports/qt5-gamepad/CONTROL b/ports/qt5-gamepad/CONTROL new file mode 100644 index 000000000..977b48a8e --- /dev/null +++ b/ports/qt5-gamepad/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-gamepad +Version: 5.9.2-0 +Description: Qt5 Gamepad Module - Enables Qt applications to support the use of gamepad hardware +Build-Depends: qt5-modularscripts, qt5-base diff --git a/ports/qt5-gamepad/portfile.cmake b/ports/qt5-gamepad/portfile.cmake new file mode 100644 index 000000000..f4b81f4fd --- /dev/null +++ b/ports/qt5-gamepad/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtgamepad 398d6ff0268460358584a4ea8ba0588881970dcc1dff6c5aa91d1630065ba112c86d7a1fe96dceb8ff301b350aef7f74ad1ee6212048a4cdfb26ff5d944d6222) diff --git a/ports/qt5-imageformats/CONTROL b/ports/qt5-imageformats/CONTROL new file mode 100644 index 000000000..0406f0027 --- /dev/null +++ b/ports/qt5-imageformats/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-imageformats +Version: 5.9.2-0 +Description: Qt5 Image Formats Module - Plugins for additional image formats: TIFF, MNG, TGA, WBMP +Build-Depends: qt5-modularscripts, qt5-base diff --git a/ports/qt5-imageformats/portfile.cmake b/ports/qt5-imageformats/portfile.cmake new file mode 100644 index 000000000..ae3025b51 --- /dev/null +++ b/ports/qt5-imageformats/portfile.cmake @@ -0,0 +1,7 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtimageformats 5f1b93c0e5fffa4c2c063d14c12ad97114a452b16814ca9ac45f00ec36308a09770b3b4d137cb5d19bd3aa3a6f576724084df5d0dad75236d49868af9243c9d2) + +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/ports/qt5-modularscripts/CONTROL b/ports/qt5-modularscripts/CONTROL new file mode 100644 index 000000000..ddbdea51e --- /dev/null +++ b/ports/qt5-modularscripts/CONTROL @@ -0,0 +1,3 @@ +Source: qt5-modularscripts +Version: 0 +Description: Vcpkg helpers to package qt5 modules diff --git a/ports/qt5-modularscripts/fixcmake.py b/ports/qt5-modularscripts/fixcmake.py new file mode 100644 index 000000000..923e600bc --- /dev/null +++ b/ports/qt5-modularscripts/fixcmake.py @@ -0,0 +1,57 @@ +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/qt5-modularscripts/portfile.cmake b/ports/qt5-modularscripts/portfile.cmake new file mode 100644 index 000000000..e7149adfc --- /dev/null +++ b/ports/qt5-modularscripts/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/qt5-modularscripts/qt_modular_library.cmake b/ports/qt5-modularscripts/qt_modular_library.cmake new file mode 100644 index 000000000..cdffc58fa --- /dev/null +++ b/ports/qt5-modularscripts/qt_modular_library.cmake @@ -0,0 +1,166 @@ +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(PYTHON2) + get_filename_component(PYTHON2_EXE_PATH ${PYTHON2} DIRECTORY) + set(ENV{PATH} "${PYTHON2_EXE_PATH};$ENV{PATH}") + + 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) + + #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 "installed\\${TARGET_TRIPLET}\\lib" "installed\\${TARGET_TRIPLET}\\debug\\lib" _contents "${_contents}") + string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib qtmaind.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib\\manual-link qtmaind.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\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*) + + foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) + file(READ "${RELEASE_MAKEFILE}" _contents) + string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\lib qtmain.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib\\manual-link qtmain.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib" _contents "${_contents}") + file(WRITE "${RELEASE_MAKEFILE}" "${_contents}") + endforeach() + + #Build release + vcpkg_build_qmake_release() + + #Fix the cmake files if they exist + if(EXISTS ${RELEASE_DIR}/lib/cmake) + vcpkg_execute_required_process( + COMMAND ${PYTHON2} ${_qt5base_port_dir}/fixcmake.py + WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake + LOGNAME fix-cmake + ) + endif() + + #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_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) + endif() + + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/qt5/debug/include) + + 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/qt5-multimedia/CONTROL b/ports/qt5-multimedia/CONTROL new file mode 100644 index 000000000..6e68c399d --- /dev/null +++ b/ports/qt5-multimedia/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-multimedia +Version: 5.9.2-0 +Description: Qt5 Multimedia Module - Classes and widgets for audio, video, radio and camera functionality +Build-Depends: qt5-modularscripts, qt5-base, qt5-declarative diff --git a/ports/qt5-multimedia/portfile.cmake b/ports/qt5-multimedia/portfile.cmake new file mode 100644 index 000000000..878c2b150 --- /dev/null +++ b/ports/qt5-multimedia/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtmultimedia b9fab874706440e97185475bfd0ad769c23d5ddbff5086cc0da9783777e81ed8140fb06fa0e7536ebfb67f2c9db39e1b9f3c2241834e74a9e1fb6ffd5cb7af11) diff --git a/ports/qt5-networkauth/CONTROL b/ports/qt5-networkauth/CONTROL new file mode 100644 index 000000000..97cdfd865 --- /dev/null +++ b/ports/qt5-networkauth/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-networkauth +Version: 5.9.2-0 +Description: Qt5 Network Authorization Module +Build-Depends: qt5-modularscripts, qt5-base diff --git a/ports/qt5-networkauth/portfile.cmake b/ports/qt5-networkauth/portfile.cmake new file mode 100644 index 000000000..c9b9db47c --- /dev/null +++ b/ports/qt5-networkauth/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtnetworkauth 2e83eefd5db62aa1cdbe451b432ba1937541e435dcc35205d3bb9b947f2ac7e31663dc069a6cfad5bbf34e1fa799d519820f7ed61b9c247016611a533385bebf) \ No newline at end of file diff --git a/ports/qt5-scxml/CONTROL b/ports/qt5-scxml/CONTROL new file mode 100644 index 000000000..ed3f93812 --- /dev/null +++ b/ports/qt5-scxml/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-scxml +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: qt5-modularscripts, qt5-base, qt5-declarative diff --git a/ports/qt5-scxml/portfile.cmake b/ports/qt5-scxml/portfile.cmake new file mode 100644 index 000000000..b0827216e --- /dev/null +++ b/ports/qt5-scxml/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtscxml c33db992ab456e5dd8b9be65c5619c503048106bbb1839b0930f2d4df36eed0780dfa1fc2912d7758aa72195269e59cbe8826cbaa414c2f339ca66c565809c88) diff --git a/ports/qt5-serialport/CONTROL b/ports/qt5-serialport/CONTROL new file mode 100644 index 000000000..5887105d8 --- /dev/null +++ b/ports/qt5-serialport/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-serialport +Version: 5.9.2-0 +Description: Qt5 Serial Port - provides access to hardware and virtual serial ports +Build-Depends: qt5-modularscripts, qt5-base diff --git a/ports/qt5-serialport/portfile.cmake b/ports/qt5-serialport/portfile.cmake new file mode 100644 index 000000000..f4a42f38f --- /dev/null +++ b/ports/qt5-serialport/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtserialport cc8899c1ae2ed9fd8cf1c213ab7efaec12b3b16836006fdbf74cb7ea457705505a13e82c2f2873ee9426ae66473ec42259f4e728de64576ee44420f116cc433d) diff --git a/ports/qt5-speech/CONTROL b/ports/qt5-speech/CONTROL new file mode 100644 index 000000000..44b8324f5 --- /dev/null +++ b/ports/qt5-speech/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-speech +Version: 5.9.2-0 +Description: Qt5 Speech Module +Build-Depends: qt5-modularscripts, qt5-base, atlmfc diff --git a/ports/qt5-speech/portfile.cmake b/ports/qt5-speech/portfile.cmake new file mode 100644 index 000000000..8a271b289 --- /dev/null +++ b/ports/qt5-speech/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtspeech 8213ad13d33732fee3fc5b5e408b870970a3003d461be24195222e1d1209210039d1d0cd2f3c537a0db62629fb297d88b33ed4734ecb6c8d74f5406a87e7e0c0) diff --git a/ports/qt5-svg/CONTROL b/ports/qt5-svg/CONTROL new file mode 100644 index 000000000..71abad30c --- /dev/null +++ b/ports/qt5-svg/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-svg +Version: 5.9.2-0 +Description: Qt5 SVG Module - provides classes for displaying the contents of SVG files +Build-Depends: qt5-modularscripts, qt5-base diff --git a/ports/qt5-svg/portfile.cmake b/ports/qt5-svg/portfile.cmake new file mode 100644 index 000000000..83283d376 --- /dev/null +++ b/ports/qt5-svg/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtsvg c21c5a12fa10ff9f91deda88c99c995ee2138bdffa21c793b0c42f25155f01f87ede5206624b9d82713649f8cf1cfdb95f1d5b7e792de62f3848d3a9ec665fdd) diff --git a/ports/qt5-tools/CONTROL b/ports/qt5-tools/CONTROL new file mode 100644 index 000000000..9f3bdaf6d --- /dev/null +++ b/ports/qt5-tools/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-tools +Version: 5.9.2-0 +Description: Qt5 Tools Module; Includes deployment tools and helpers, Qt Designer, Assistant, and other applications +Build-Depends: qt5-modularscripts, qt5-base, qt5-declarative diff --git a/ports/qt5-tools/portfile.cmake b/ports/qt5-tools/portfile.cmake new file mode 100644 index 000000000..10eefa959 --- /dev/null +++ b/ports/qt5-tools/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qttools afce063e167de96dfa264cfd27dc8d80c23ef091a30f4f8119575cae83f39716c3b332427630b340f518b82d6396cca1893f28e00f3c667ba201d7e4fc2aefe1) diff --git a/ports/qt5-virtualkeyboard/CONTROL b/ports/qt5-virtualkeyboard/CONTROL new file mode 100644 index 000000000..6fff91b58 --- /dev/null +++ b/ports/qt5-virtualkeyboard/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-virtualkeyboard +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: qt5-modularscripts, qt5-base diff --git a/ports/qt5-virtualkeyboard/portfile.cmake b/ports/qt5-virtualkeyboard/portfile.cmake new file mode 100644 index 000000000..cceed3894 --- /dev/null +++ b/ports/qt5-virtualkeyboard/portfile.cmake @@ -0,0 +1,7 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtvirtualkeyboard f8c39b789e877e60389ee9aab4a5c17e6018093f72fc57f526ce2584183135206306d4d5a7c7551a6de45969aa6f55444bb39f4ea3324cdf10611533f0bc2b22) + +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) diff --git a/ports/qt5-websockets/CONTROL b/ports/qt5-websockets/CONTROL new file mode 100644 index 000000000..2f43b9d2c --- /dev/null +++ b/ports/qt5-websockets/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-websockets +Version: 5.9.2-0 +Description: Qt5 Web Sockets Module - provides WebSocket communication compliant with RFC 6455 +Build-Depends: qt5-modularscripts, qt5-base diff --git a/ports/qt5-websockets/portfile.cmake b/ports/qt5-websockets/portfile.cmake new file mode 100644 index 000000000..98442f4c0 --- /dev/null +++ b/ports/qt5-websockets/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtwebsockets 9330d6806251bc77d4c2a497a31b1b0e42a1e6bfe3ea7c00cee123052e9e1f9080e33cf4dfcd6ee6e4732c62f41257a77ec25ad607528f4e8ebe61ccaee3e159) diff --git a/ports/qt5-winextras/CONTROL b/ports/qt5-winextras/CONTROL new file mode 100644 index 000000000..d00ad7a0c --- /dev/null +++ b/ports/qt5-winextras/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-winextras +Version: 5.9.2-0 +Description: Qt5 Windows Extras Module. Provides platform-specific APIs for Windows. +Build-Depends: qt5-modularscripts, qt5-base, atlmfc diff --git a/ports/qt5-winextras/portfile.cmake b/ports/qt5-winextras/portfile.cmake new file mode 100644 index 000000000..692683adf --- /dev/null +++ b/ports/qt5-winextras/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtwinextras dbfb89833cc291fade8e9fe2ad9c7b7a78c2032de8dcbca1049d637f829811b99e1852ae39ca73a6eac2960df168765bee28023bb723e69c87e2f3bb50b7ef02) diff --git a/ports/qt5-xmlpatterns/CONTROL b/ports/qt5-xmlpatterns/CONTROL new file mode 100644 index 000000000..5fcec19be --- /dev/null +++ b/ports/qt5-xmlpatterns/CONTROL @@ -0,0 +1,4 @@ +Source: qt5-xmlpatterns +Version: 5.9.2-0 +Description: Qt5 XML Patterns Module - Support for XPath, XQuery, XSLT and XML schema validation +Build-Depends: qt5-modularscripts, qt5-base diff --git a/ports/qt5-xmlpatterns/portfile.cmake b/ports/qt5-xmlpatterns/portfile.cmake new file mode 100644 index 000000000..6fbc69538 --- /dev/null +++ b/ports/qt5-xmlpatterns/portfile.cmake @@ -0,0 +1,5 @@ +include(vcpkg_common_functions) + +include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) + +qt_modular_library(qtxmlpatterns c14dbd97988473ba73b4e21352c5560278aa4dbfdf2be1d12e9119c0b5dbe8a0e4eff9a682052024a01bb21dcf52d40ba00da98947901fb91518af92a225da83) diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index f8817e1db..e56858730 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +1,4 @@ Source: qt5 Version: 5.9.2-1 Description: Qt5 Application Framework -Build-Depends: qt5base, qt5charts, qt5datavis3d, qt5declarative, qt5gamepad, qt5imageformats, qt5multimedia, qt5networkauth, qt5scxml, qt5serialport, qt5speech, qt5svg, qt5tools, qt5virtualkeyboard, qt5websockets, qt53d, qt5winextras, qt5xmlpatterns \ No newline at end of file +Build-Depends: qt5-base, qt5-charts, qt5-datavis3d, qt5-declarative, qt5-gamepad, qt5-imageformats, qt5-multimedia, qt5-networkauth, qt5-scxml, qt5-serialport, qt5-speech, qt5-svg, qt5-tools, qt5-virtualkeyboard, qt5-websockets, qt5-3d, qt5-winextras, qt5-xmlpatterns \ No newline at end of file diff --git a/ports/qt53d/CONTROL b/ports/qt53d/CONTROL deleted file mode 100644 index d157525ee..000000000 --- a/ports/qt53d/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -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: qt5modularscripts, qt5base, qt5declarative \ No newline at end of file diff --git a/ports/qt53d/portfile.cmake b/ports/qt53d/portfile.cmake deleted file mode 100644 index 7de7bb5d5..000000000 --- a/ports/qt53d/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qt3d 1c7dbd4e557cdd183ec6e929aae5727ce2ffcb519517942b588594bb81a78cb3d732cde4dae58085a70ec2968a8c2443eae96536125c25938222ff7c89f4f9a2) diff --git a/ports/qt5base/CONTROL b/ports/qt5base/CONTROL deleted file mode 100644 index 79523a21f..000000000 --- a/ports/qt5base/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5base -Version: 5.9.2-0 -Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components. -Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion diff --git a/ports/qt5base/configure_qt.cmake b/ports/qt5base/configure_qt.cmake deleted file mode 100644 index 1d4f1e570..000000000 --- a/ports/qt5base/configure_qt.cmake +++ /dev/null @@ -1,64 +0,0 @@ -function(configure_qt) - cmake_parse_arguments(_csc "" "SOURCE_PATH;PLATFORM" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) - - if (_csc_PLATFORM) - set(PLATFORM ${_csc_PLATFORM}) - elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v140") - set(PLATFORM "win32-msvc2015") - elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v141") - set(PLATFORM "win32-msvc2017") - endif() - - vcpkg_find_acquire_program(PERL) - get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) - - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - set(ENV{PATH} "$ENV{PATH};${PERL_EXE_PATH}") - - if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) - list(APPEND _csc_OPTIONS - "-static" - "-static-runtime" - ) - endif() - - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - vcpkg_execute_required_process( - COMMAND "${_csc_SOURCE_PATH}/configure.bat" ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} - -debug - -prefix ${CURRENT_PACKAGES_DIR}/debug - -hostbindir ${CURRENT_PACKAGES_DIR}/debug/tools/qt5 - -archdatadir ${CURRENT_PACKAGES_DIR}/share/qt5/debug - -datadir ${CURRENT_PACKAGES_DIR}/share/qt5/debug - -plugindir ${CURRENT_PACKAGES_DIR}/debug/plugins - -qmldir ${CURRENT_PACKAGES_DIR}/debug/qml - -headerdir ${CURRENT_PACKAGES_DIR}/include - -I ${CURRENT_INSTALLED_DIR}/include - -L ${CURRENT_INSTALLED_DIR}/debug/lib - -platform ${PLATFORM} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME config-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") - - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - vcpkg_execute_required_process( - COMMAND "${_csc_SOURCE_PATH}/configure.bat" ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} - -release - -prefix ${CURRENT_PACKAGES_DIR} - -hostbindir ${CURRENT_PACKAGES_DIR}/tools/qt5 - -archdatadir ${CURRENT_PACKAGES_DIR}/share/qt5 - -datadir ${CURRENT_PACKAGES_DIR}/share/qt5 - -plugindir ${CURRENT_PACKAGES_DIR}/plugins - -qmldir ${CURRENT_PACKAGES_DIR}/qml - -I ${CURRENT_INSTALLED_DIR}/include - -L ${CURRENT_INSTALLED_DIR}/lib - -platform ${PLATFORM} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME config-${TARGET_TRIPLET}-rel - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") - -endfunction() \ No newline at end of file diff --git a/ports/qt5base/fix-system-pcre2.patch b/ports/qt5base/fix-system-pcre2.patch deleted file mode 100644 index be401d448..000000000 --- a/ports/qt5base/fix-system-pcre2.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/src/corelib/configure.json b/src/corelib/configure.json -index a5b69a2..01c5cde 100644 ---- a/src/corelib/configure.json -+++ b/src/corelib/configure.json -@@ -159,7 +159,12 @@ - ] - }, - "sources": [ -- "-lpcre2-16" -+ { -+ "builds": { -+ "debug": "-lpcre2-16d", -+ "release": "-lpcre2-16" -+ } -+ } - ] - }, - "pps": { diff --git a/ports/qt5base/fixcmake.py b/ports/qt5base/fixcmake.py deleted file mode 100644 index bcfb12ac5..000000000 --- a/ports/qt5base/fixcmake.py +++ /dev/null @@ -1,68 +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 "_install_prefix}/lib/qtmaind.lib" in line: - # qtmaind.lib has been moved to manual-link: - builder += line.replace("/lib/", "/debug/lib/manual-link/") - elif "_install_prefix}/lib/qtmain.lib" in line: - # qtmain(d).lib has been moved to manual-link: - builder += line.replace("/lib/", "/lib/manual-link/") - builder += " set(imported_location_debug \"${_qt5Core_install_prefix}/debug/lib/manual-link/qtmaind.lib\")\n" - builder += "\n" - builder += " set_target_properties(Qt5::WinMain PROPERTIES\n" - builder += " IMPORTED_LOCATION_DEBUG ${imported_location_debug}\n" - builder += " )\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/qt5base/install_qt.cmake b/ports/qt5base/install_qt.cmake deleted file mode 100644 index 37528e4e6..000000000 --- a/ports/qt5base/install_qt.cmake +++ /dev/null @@ -1,46 +0,0 @@ -function(install_qt) - cmake_parse_arguments(_bc "DISABLE_PARALLEL" "" "" ${ARGN}) - - if (_bc_DISABLE_PARALLEL) - set(JOBS "1") - else() - set(JOBS "$ENV{NUMBER_OF_PROCESSORS}") - endif() - - vcpkg_find_acquire_program(JOM) - vcpkg_find_acquire_program(PYTHON3) - get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) - set(ENV{PATH} "${PYTHON3_EXE_PATH};$ENV{PATH}") - set(_path "$ENV{PATH}") - - message(STATUS "Package ${TARGET_TRIPLET}-dbg") - set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/bin;${_path}") - vcpkg_execute_required_process( - COMMAND ${JOM} /J ${JOBS} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME build-${TARGET_TRIPLET}-dbg - ) - vcpkg_execute_required_process( - COMMAND ${JOM} /J ${JOBS} install - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME package-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Package ${TARGET_TRIPLET}-dbg done") - - message(STATUS "Package ${TARGET_TRIPLET}-rel") - set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/bin;${_path}") - vcpkg_execute_required_process( - COMMAND ${JOM} /J ${JOBS} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME build-${TARGET_TRIPLET}-rel - ) - vcpkg_execute_required_process( - COMMAND ${JOM} /J ${JOBS} install - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME package-${TARGET_TRIPLET}-rel - ) - message(STATUS "Package ${TARGET_TRIPLET}-rel done") - - set(ENV{PATH} "${_path}") - -endfunction() \ No newline at end of file diff --git a/ports/qt5base/portfile.cmake b/ports/qt5base/portfile.cmake deleted file mode 100644 index 02122f9cc..000000000 --- a/ports/qt5base/portfile.cmake +++ /dev/null @@ -1,114 +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}) -include(configure_qt) -include(install_qt) - -set(SRCDIR_NAME "qtbase-5.9.2") -set(ARCHIVE_NAME "qtbase-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 a2f965871645256f3d019f71f3febb875455a29d03fccc7a3371ddfeb193b0af12394e779df05adf69fd10fe7b0d966f3915a24528ec7eb3bc36c2db6af2b6e7 -) -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() - -vcpkg_apply_patches( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${SRCDIR_NAME} - PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-system-pcre2.patch" -) - -# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings -set(ENV{_CL_} "/utf-8") - -configure_qt( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -confirm-license - -opensource - -system-zlib - -system-libjpeg - -system-libpng - -system-freetype - -system-pcre - -system-harfbuzz - -system-doubleconversion - -system-sqlite - -sql-sqlite - -sql-psql - -feature-freetype - -nomake examples -nomake tests - -opengl desktop # other options are "-no-opengl" and "-opengl angle" - -mp - LIBJPEG_LIBS="-ljpeg" - OPTIONS_RELEASE - ZLIB_LIBS="-lzlib" - LIBPNG_LIBS="-llibpng16" - OPTIONS_DEBUG - ZLIB_LIBS="-lzlibd" - LIBPNG_LIBS="-llibpng16d" - PSQL_LIBS="-llibpqd" - FREETYPE_LIBS="-lfreetyped" -) - -install_qt() - -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) - -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}) - -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 - WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/cmake - LOGNAME fix-cmake -) - -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/qt5) - -#--------------------------------------------------------------------------- -# qtmain(d) vs. Qt5AxServer(d) -#--------------------------------------------------------------------------- -# Qt applications have to either link to qtmain(d) or to Qt5AxServer(d), -# never both. See http://doc.qt.io/qt-5/activeqt-server.html for more info. -# -# Create manual-link folders: -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) -# -# Either have users explicitly link against qtmain.lib, qtmaind.lib: -file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) -file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) -file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib) -file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl) -file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) -file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl) - -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 deleted file mode 100644 index 1314d00b9..000000000 --- a/ports/qt5base/qt_debug.conf +++ /dev/null @@ -1,13 +0,0 @@ -[Paths] -Prefix = ${CURRENT_INSTALLED_DIR} -Documentation = share/qt5/doc -Headers = include -Libraries = debug/lib -Binaries = debug/tools/qt5 -LibraryExecutables = debug/tools/qt5 -Plugins = debug/plugins -Qml2Imports = qml -Data = share/qt5/debug -ArchData = share/qt5/debug -HostData = share/qt5/debug -HostBinaries = debug/tools/qt5 \ No newline at end of file diff --git a/ports/qt5base/qt_release.conf b/ports/qt5base/qt_release.conf deleted file mode 100644 index a04aef525..000000000 --- a/ports/qt5base/qt_release.conf +++ /dev/null @@ -1,13 +0,0 @@ -[Paths] -Prefix = ${CURRENT_INSTALLED_DIR} -Documentation = share/qt5/doc -Headers = include -Libraries = lib -Binaries = tools/qt5 -LibraryExecutables = tools/qt5 -Plugins = plugins -Qml2Imports = qml -Data = share/qt5 -ArchData = share/qt5 -HostData = share/qt5 -HostBinaries = tools/qt5 \ No newline at end of file diff --git a/ports/qt5charts/CONTROL b/ports/qt5charts/CONTROL deleted file mode 100644 index 7b97a82b8..000000000 --- a/ports/qt5charts/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -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: qt5modularscripts, qt5base \ No newline at end of file diff --git a/ports/qt5charts/portfile.cmake b/ports/qt5charts/portfile.cmake deleted file mode 100644 index 45a53b63d..000000000 --- a/ports/qt5charts/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtcharts 297547b565dd71b05237bb05ecc1abf1a774a4909668417e78bd65e805c1e47a456a5a06898fe06d4c4614118e4129e19893d4c77598667a9354ab969307a293) diff --git a/ports/qt5datavis3d/CONTROL b/ports/qt5datavis3d/CONTROL deleted file mode 100644 index c3f2157f8..000000000 --- a/ports/qt5datavis3d/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5datavis3d -Version: 5.9.2-0 -Description: Qt5 Data Visualization 3d Module - UI Components for creating 3D data visualizations -Build-Depends: qt5modularscripts, qt5base \ No newline at end of file diff --git a/ports/qt5datavis3d/portfile.cmake b/ports/qt5datavis3d/portfile.cmake deleted file mode 100644 index d7a552cba..000000000 --- a/ports/qt5datavis3d/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtdatavis3d 5f173401ba2f0ebb4bbb1ff65053f1ece44a97a8bf1d9fc8d81540709c588e140c533d5f317d6a9109d538e38aa742d42bf00906f63d433811bc1c8526788dc3) diff --git a/ports/qt5declarative/CONTROL b/ports/qt5declarative/CONTROL deleted file mode 100644 index 93014a591..000000000 --- a/ports/qt5declarative/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5declarative -Version: 5.9.2-0 -Description: Qt5 Declarative (Quick 2) Module. Includes QtQuick, QtQuickParticles, QtQuickWidgets, QtQml, and QtPacketProtocol. -Build-Depends: qt5modularscripts, qt5base \ No newline at end of file diff --git a/ports/qt5declarative/portfile.cmake b/ports/qt5declarative/portfile.cmake deleted file mode 100644 index 63ce79746..000000000 --- a/ports/qt5declarative/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtdeclarative 49b8b50932b73ea39da14ac3425044193dfd64eabceadba379aa01cf2fc141177f9870c387caf1cf93ce09e8b197828a54b8d9fcefc4d9cdf400a6c6dd9a9e90) diff --git a/ports/qt5gamepad/CONTROL b/ports/qt5gamepad/CONTROL deleted file mode 100644 index 5228aa006..000000000 --- a/ports/qt5gamepad/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5gamepad -Version: 5.9.2-0 -Description: Qt5 Gamepad Module - Enables Qt applications to support the use of gamepad hardware -Build-Depends: qt5modularscripts, qt5base \ No newline at end of file diff --git a/ports/qt5gamepad/portfile.cmake b/ports/qt5gamepad/portfile.cmake deleted file mode 100644 index f4b81f4fd..000000000 --- a/ports/qt5gamepad/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtgamepad 398d6ff0268460358584a4ea8ba0588881970dcc1dff6c5aa91d1630065ba112c86d7a1fe96dceb8ff301b350aef7f74ad1ee6212048a4cdfb26ff5d944d6222) diff --git a/ports/qt5imageformats/CONTROL b/ports/qt5imageformats/CONTROL deleted file mode 100644 index 995dc59fc..000000000 --- a/ports/qt5imageformats/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5imageformats -Version: 5.9.2-0 -Description: Qt5 Image Formats Module - Plugins for additional image formats: TIFF, MNG, TGA, WBMP -Build-Depends: qt5modularscripts, qt5base \ No newline at end of file diff --git a/ports/qt5imageformats/portfile.cmake b/ports/qt5imageformats/portfile.cmake deleted file mode 100644 index ae3025b51..000000000 --- a/ports/qt5imageformats/portfile.cmake +++ /dev/null @@ -1,7 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtimageformats 5f1b93c0e5fffa4c2c063d14c12ad97114a452b16814ca9ac45f00ec36308a09770b3b4d137cb5d19bd3aa3a6f576724084df5d0dad75236d49868af9243c9d2) - -set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/ports/qt5modularscripts/CONTROL b/ports/qt5modularscripts/CONTROL deleted file mode 100644 index 88c0379af..000000000 --- a/ports/qt5modularscripts/CONTROL +++ /dev/null @@ -1,3 +0,0 @@ -Source: qt5modularscripts -Version: 0 -Description: Vcpkg helpers to package qt5 modules diff --git a/ports/qt5modularscripts/fixcmake.py b/ports/qt5modularscripts/fixcmake.py deleted file mode 100644 index 923e600bc..000000000 --- a/ports/qt5modularscripts/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/qt5modularscripts/portfile.cmake b/ports/qt5modularscripts/portfile.cmake deleted file mode 100644 index e7149adfc..000000000 --- a/ports/qt5modularscripts/portfile.cmake +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index 336a3913d..000000000 --- a/ports/qt5modularscripts/qt_modular_library.cmake +++ /dev/null @@ -1,166 +0,0 @@ -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(PYTHON2) - get_filename_component(PYTHON2_EXE_PATH ${PYTHON2} DIRECTORY) - set(ENV{PATH} "${PYTHON2_EXE_PATH};$ENV{PATH}") - - 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) - - #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 "installed\\${TARGET_TRIPLET}\\lib" "installed\\${TARGET_TRIPLET}\\debug\\lib" _contents "${_contents}") - string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib qtmaind.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib\\manual-link qtmaind.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\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*) - - foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - file(READ "${RELEASE_MAKEFILE}" _contents) - string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\lib qtmain.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib\\manual-link qtmain.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib" _contents "${_contents}") - file(WRITE "${RELEASE_MAKEFILE}" "${_contents}") - endforeach() - - #Build release - vcpkg_build_qmake_release() - - #Fix the cmake files if they exist - if(EXISTS ${RELEASE_DIR}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON2} ${_qt5base_port_dir}/fixcmake.py - WORKING_DIRECTORY ${RELEASE_DIR}/lib/cmake - LOGNAME fix-cmake - ) - endif() - - #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_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools) - endif() - - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/qt5/debug/include) - - 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 deleted file mode 100644 index b45f3f297..000000000 --- a/ports/qt5multimedia/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5multimedia -Version: 5.9.2-0 -Description: Qt5 Multimedia Module - Classes and widgets for audio, video, radio and camera functionality -Build-Depends: qt5modularscripts, qt5base, qt5declarative diff --git a/ports/qt5multimedia/portfile.cmake b/ports/qt5multimedia/portfile.cmake deleted file mode 100644 index 878c2b150..000000000 --- a/ports/qt5multimedia/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtmultimedia b9fab874706440e97185475bfd0ad769c23d5ddbff5086cc0da9783777e81ed8140fb06fa0e7536ebfb67f2c9db39e1b9f3c2241834e74a9e1fb6ffd5cb7af11) diff --git a/ports/qt5networkauth/CONTROL b/ports/qt5networkauth/CONTROL deleted file mode 100644 index 0e5f45f96..000000000 --- a/ports/qt5networkauth/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5networkauth -Version: 5.9.2-0 -Description: Qt5 Network Authorization Module -Build-Depends: qt5modularscripts, qt5base \ No newline at end of file diff --git a/ports/qt5networkauth/portfile.cmake b/ports/qt5networkauth/portfile.cmake deleted file mode 100644 index c9b9db47c..000000000 --- a/ports/qt5networkauth/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtnetworkauth 2e83eefd5db62aa1cdbe451b432ba1937541e435dcc35205d3bb9b947f2ac7e31663dc069a6cfad5bbf34e1fa799d519820f7ed61b9c247016611a533385bebf) \ No newline at end of file diff --git a/ports/qt5scxml/CONTROL b/ports/qt5scxml/CONTROL deleted file mode 100644 index 4010ca304..000000000 --- a/ports/qt5scxml/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -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: qt5modularscripts, qt5base, qt5declarative diff --git a/ports/qt5scxml/portfile.cmake b/ports/qt5scxml/portfile.cmake deleted file mode 100644 index b0827216e..000000000 --- a/ports/qt5scxml/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtscxml c33db992ab456e5dd8b9be65c5619c503048106bbb1839b0930f2d4df36eed0780dfa1fc2912d7758aa72195269e59cbe8826cbaa414c2f339ca66c565809c88) diff --git a/ports/qt5serialport/CONTROL b/ports/qt5serialport/CONTROL deleted file mode 100644 index eb87231e0..000000000 --- a/ports/qt5serialport/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5serialport -Version: 5.9.2-0 -Description: Qt5 Serial Port - provides access to hardware and virtual serial ports -Build-Depends: qt5modularscripts, qt5base \ No newline at end of file diff --git a/ports/qt5serialport/portfile.cmake b/ports/qt5serialport/portfile.cmake deleted file mode 100644 index f4a42f38f..000000000 --- a/ports/qt5serialport/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtserialport cc8899c1ae2ed9fd8cf1c213ab7efaec12b3b16836006fdbf74cb7ea457705505a13e82c2f2873ee9426ae66473ec42259f4e728de64576ee44420f116cc433d) diff --git a/ports/qt5speech/CONTROL b/ports/qt5speech/CONTROL deleted file mode 100644 index f175d13e7..000000000 --- a/ports/qt5speech/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5speech -Version: 5.9.2-0 -Description: Qt5 Speech Module -Build-Depends: qt5modularscripts, qt5base, atlmfc \ No newline at end of file diff --git a/ports/qt5speech/portfile.cmake b/ports/qt5speech/portfile.cmake deleted file mode 100644 index 8a271b289..000000000 --- a/ports/qt5speech/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtspeech 8213ad13d33732fee3fc5b5e408b870970a3003d461be24195222e1d1209210039d1d0cd2f3c537a0db62629fb297d88b33ed4734ecb6c8d74f5406a87e7e0c0) diff --git a/ports/qt5svg/CONTROL b/ports/qt5svg/CONTROL deleted file mode 100644 index c52ca485c..000000000 --- a/ports/qt5svg/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5svg -Version: 5.9.2-0 -Description: Qt5 SVG Module - provides classes for displaying the contents of SVG files -Build-Depends: qt5modularscripts, qt5base \ No newline at end of file diff --git a/ports/qt5svg/portfile.cmake b/ports/qt5svg/portfile.cmake deleted file mode 100644 index 83283d376..000000000 --- a/ports/qt5svg/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtsvg c21c5a12fa10ff9f91deda88c99c995ee2138bdffa21c793b0c42f25155f01f87ede5206624b9d82713649f8cf1cfdb95f1d5b7e792de62f3848d3a9ec665fdd) diff --git a/ports/qt5tools/CONTROL b/ports/qt5tools/CONTROL deleted file mode 100644 index 4050ac097..000000000 --- a/ports/qt5tools/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5tools -Version: 5.9.2-0 -Description: Qt5 Tools Module; Includes deployment tools and helpers, Qt Designer, Assistant, and other applications -Build-Depends: qt5modularscripts, qt5base, qt5declarative \ No newline at end of file diff --git a/ports/qt5tools/portfile.cmake b/ports/qt5tools/portfile.cmake deleted file mode 100644 index 10eefa959..000000000 --- a/ports/qt5tools/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qttools afce063e167de96dfa264cfd27dc8d80c23ef091a30f4f8119575cae83f39716c3b332427630b340f518b82d6396cca1893f28e00f3c667ba201d7e4fc2aefe1) diff --git a/ports/qt5virtualkeyboard/CONTROL b/ports/qt5virtualkeyboard/CONTROL deleted file mode 100644 index 041e2cdd9..000000000 --- a/ports/qt5virtualkeyboard/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -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: qt5modularscripts, qt5base \ No newline at end of file diff --git a/ports/qt5virtualkeyboard/portfile.cmake b/ports/qt5virtualkeyboard/portfile.cmake deleted file mode 100644 index cceed3894..000000000 --- a/ports/qt5virtualkeyboard/portfile.cmake +++ /dev/null @@ -1,7 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtvirtualkeyboard f8c39b789e877e60389ee9aab4a5c17e6018093f72fc57f526ce2584183135206306d4d5a7c7551a6de45969aa6f55444bb39f4ea3324cdf10611533f0bc2b22) - -set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) diff --git a/ports/qt5websockets/CONTROL b/ports/qt5websockets/CONTROL deleted file mode 100644 index 2ab49879b..000000000 --- a/ports/qt5websockets/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5websockets -Version: 5.9.2-0 -Description: Qt5 Web Sockets Module - provides WebSocket communication compliant with RFC 6455 -Build-Depends: qt5modularscripts, qt5base \ No newline at end of file diff --git a/ports/qt5websockets/portfile.cmake b/ports/qt5websockets/portfile.cmake deleted file mode 100644 index 98442f4c0..000000000 --- a/ports/qt5websockets/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtwebsockets 9330d6806251bc77d4c2a497a31b1b0e42a1e6bfe3ea7c00cee123052e9e1f9080e33cf4dfcd6ee6e4732c62f41257a77ec25ad607528f4e8ebe61ccaee3e159) diff --git a/ports/qt5winextras/CONTROL b/ports/qt5winextras/CONTROL deleted file mode 100644 index 451118c5a..000000000 --- a/ports/qt5winextras/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5winextras -Version: 5.9.2-0 -Description: Qt5 Windows Extras Module. Provides platform-specific APIs for Windows. -Build-Depends: qt5modularscripts, qt5base, atlmfc \ No newline at end of file diff --git a/ports/qt5winextras/portfile.cmake b/ports/qt5winextras/portfile.cmake deleted file mode 100644 index 692683adf..000000000 --- a/ports/qt5winextras/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtwinextras dbfb89833cc291fade8e9fe2ad9c7b7a78c2032de8dcbca1049d637f829811b99e1852ae39ca73a6eac2960df168765bee28023bb723e69c87e2f3bb50b7ef02) diff --git a/ports/qt5xmlpatterns/CONTROL b/ports/qt5xmlpatterns/CONTROL deleted file mode 100644 index 03bd2938e..000000000 --- a/ports/qt5xmlpatterns/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: qt5xmlpatterns -Version: 5.9.2-0 -Description: Qt5 XML Patterns Module - Support for XPath, XQuery, XSLT and XML schema validation -Build-Depends: qt5modularscripts, qt5base \ No newline at end of file diff --git a/ports/qt5xmlpatterns/portfile.cmake b/ports/qt5xmlpatterns/portfile.cmake deleted file mode 100644 index 6fbc69538..000000000 --- a/ports/qt5xmlpatterns/portfile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(vcpkg_common_functions) - -include(${CURRENT_INSTALLED_DIR}/share/qt5modularscripts/qt_modular_library.cmake) - -qt_modular_library(qtxmlpatterns c14dbd97988473ba73b4e21352c5560278aa4dbfdf2be1d12e9119c0b5dbe8a0e4eff9a682052024a01bb21dcf52d40ba00da98947901fb91518af92a225da83) -- cgit v1.2.3 From 7b0cfc6f6c5464e4f008b5ccbd99c9ac01e95bee Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 18 Jan 2018 02:13:50 -0800 Subject: [qt5-base] Remove debug qmake.exe --- ports/qt5-base/CONTROL | 2 +- ports/qt5-base/portfile.cmake | 2 +- ports/qt5-base/qt_debug.conf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/qt5-base/CONTROL b/ports/qt5-base/CONTROL index f2a507e19..039a0b873 100644 --- a/ports/qt5-base/CONTROL +++ b/ports/qt5-base/CONTROL @@ -1,4 +1,4 @@ Source: qt5-base -Version: 5.9.2-0 +Version: 5.9.2-1 Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components. Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index bde933392..0badd0477 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -77,8 +77,8 @@ 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}) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/tools") file(COPY ${CMAKE_CURRENT_LIST_DIR}/qt_debug.conf ${CMAKE_CURRENT_LIST_DIR}/qt_release.conf DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5) diff --git a/ports/qt5-base/qt_debug.conf b/ports/qt5-base/qt_debug.conf index 1314d00b9..45cac7a4b 100644 --- a/ports/qt5-base/qt_debug.conf +++ b/ports/qt5-base/qt_debug.conf @@ -10,4 +10,4 @@ Qml2Imports = qml Data = share/qt5/debug ArchData = share/qt5/debug HostData = share/qt5/debug -HostBinaries = debug/tools/qt5 \ No newline at end of file +HostBinaries = tools/qt5 \ No newline at end of file -- cgit v1.2.3 From d9d3744484b1dbe166d2036764f5d78b486e7290 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 18 Jan 2018 02:32:35 -0800 Subject: [qt5-base] Restore qtdeploy.ps1 --- ports/qt5-base/portfile.cmake | 2 ++ ports/qt5-base/qtdeploy.ps1 | 68 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 ports/qt5-base/qtdeploy.ps1 diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index 0badd0477..9284f09b5 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -111,4 +111,6 @@ file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl DESTINATION ${CURRENT_PA file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl) +file(COPY ${CMAKE_CURRENT_LIST_DIR}/qtdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/plugins) + file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/qt5-base/qtdeploy.ps1 b/ports/qt5-base/qtdeploy.ps1 new file mode 100644 index 000000000..9d514e411 --- /dev/null +++ b/ports/qt5-base/qtdeploy.ps1 @@ -0,0 +1,68 @@ +# This script is based on the implementation of windeployqt for qt5.7.1 +# +# Qt's plugin deployment strategy is that each main Qt Module has a hardcoded +# set of plugin subdirectories. Each of these subdirectories is deployed in +# full if that Module is referenced. +# +# This hardcoded list is found inside qttools\src\windeployqt\main.cpp. For +# updating, inspect the symbols qtModuleEntries and qtModuleForPlugin. + +# Note: this function signature and behavior is depended upon by applocal.ps1 +function deployPluginsIfQt([string]$targetBinaryDir, [string]$QtPluginsDir, [string]$targetBinaryName) { + + function deployPlugins([string]$pluginSubdirName) { + if (Test-Path "$QtPluginsDir\$pluginSubdirName") { + Write-Verbose " Deploying plugins directory '$pluginSubdirName'" + New-Item "$targetBinaryDir\$pluginSubdirName" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null + Get-ChildItem "$QtPluginsDir\$pluginSubdirName\*.dll" | % { + deployBinary "$targetBinaryDir\$pluginSubdirName" "$QtPluginsDir\$pluginSubdirName" $_.Name + } + } else { + Write-Verbose " Skipping plugins directory '$pluginSubdirName': doesn't exist" + } + } + + # We detect Qt modules in use via the DLLs themselves. See qtModuleEntries in Qt to find the mapping. + if ($targetBinaryName -like "Qt5Gui*.dll") { + Write-Verbose " Deploying platforms" + New-Item "$targetBinaryDir\platforms" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null + Get-ChildItem "$QtPluginsDir\platforms\qwindows*.dll" | % { + deployBinary "$targetBinaryDir\platforms" "$QtPluginsDir\platforms" $_.Name + } + + deployPlugins "accessible" + deployPlugins "imageformats" + deployPlugins "iconengines" + deployPlugins "platforminputcontexts" + } elseif ($targetBinaryName -like "Qt5Network*.dll") { + deployPlugins "bearer" + } elseif ($targetBinaryName -like "Qt5Sql*.dll") { + deployPlugins "sqldrivers" + } elseif ($targetBinaryName -like "Qt5Multimedia*.dll") { + deployPlugins "audio" + deployPlugins "mediaservice" + deployPlugins "playlistformats" + } elseif ($targetBinaryName -like "Qt5PrintSupport*.dll") { + deployPlugins "printsupport" + } elseif ($targetBinaryName -like "Qt5Quick*.dll") { + deployPlugins "scenegraph" + deployPlugins "qmltooling" + } elseif ($targetBinaryName -like "Qt5Declarative*.dll") { + deployPlugins "qml1tooling" + } elseif ($targetBinaryName -like "Qt5Positioning*.dll") { + deployPlugins "position" + } elseif ($targetBinaryName -like "Qt5Location*.dll") { + deployPlugins "geoservices" + } elseif ($targetBinaryName -like "Qt5Sensors*.dll") { + deployPlugins "sensors" + deployPlugins "sensorgestures" + } elseif ($targetBinaryName -like "Qt5WebEngineCore*.dll") { + deployPlugins "qtwebengine" + } elseif ($targetBinaryName -like "Qt53DRenderer*.dll") { + deployPlugins "sceneparsers" + } elseif ($targetBinaryName -like "Qt5TextToSpeech*.dll") { + deployPlugins "texttospeech" + } elseif ($targetBinaryName -like "Qt5SerialBus*.dll") { + deployPlugins "canbus" + } +} -- cgit v1.2.3 From d6dc7a078a845bd4e1349a4d4cb77e2070125d4d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 18 Jan 2018 02:33:23 -0800 Subject: [qwt][qscintilla][qca] Use dash in qt modular dependency --- ports/qca/CONTROL | 4 ++-- ports/qscintilla/CONTROL | 4 ++-- ports/qwt/CONTROL | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ports/qca/CONTROL b/ports/qca/CONTROL index beddbaa37..4f484666f 100644 --- a/ports/qca/CONTROL +++ b/ports/qca/CONTROL @@ -1,4 +1,4 @@ Source: qca -Version: 2.2.0-1 +Version: 2.2.0-2 Description: Qt Cryptographic Architecture (QCA). Sources: https://cgit.kde.org/qca.git/ -Build-Depends: qt5base +Build-Depends: qt5-base diff --git a/ports/qscintilla/CONTROL b/ports/qscintilla/CONTROL index 9ebe3ba04..32a11a69b 100644 --- a/ports/qscintilla/CONTROL +++ b/ports/qscintilla/CONTROL @@ -1,4 +1,4 @@ Source: qscintilla -Version: 2.10-1 +Version: 2.10-2 Description: QScintilla is a port to Qt of the Scintilla editing component. Features syntax highlighting, code-completion and much more (Barebone build without python bindings (missing dependeny PyQt) and without QtDesigner plugin) -Build-Depends: qt5base +Build-Depends: qt5-base diff --git a/ports/qwt/CONTROL b/ports/qwt/CONTROL index c30b97779..5bf85ad95 100644 --- a/ports/qwt/CONTROL +++ b/ports/qwt/CONTROL @@ -1,4 +1,4 @@ Source: qwt -Version: 6.1.3-2 +Version: 6.1.3-3 Description: Qt widgets library for technical applications -Build-Depends: qt5base, qt5svg +Build-Depends: qt5-base, qt5-svg -- cgit v1.2.3 From 51da0e25fa5af242331d0a5d8b0d8b4137d98fc5 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 18 Jan 2018 04:22:18 -0800 Subject: [qscintilla] Fix build against new modular qt --- ports/qscintilla/CONTROL | 2 +- ports/qscintilla/portfile.cmake | 65 +++++++++++++++++++++++++++++++++++------ 2 files changed, 57 insertions(+), 10 deletions(-) diff --git a/ports/qscintilla/CONTROL b/ports/qscintilla/CONTROL index 32a11a69b..65fa0cd63 100644 --- a/ports/qscintilla/CONTROL +++ b/ports/qscintilla/CONTROL @@ -1,4 +1,4 @@ Source: qscintilla -Version: 2.10-2 +Version: 2.10-3 Description: QScintilla is a port to Qt of the Scintilla editing component. Features syntax highlighting, code-completion and much more (Barebone build without python bindings (missing dependeny PyQt) and without QtDesigner plugin) Build-Depends: qt5-base diff --git a/ports/qscintilla/portfile.cmake b/ports/qscintilla/portfile.cmake index a03ecb7db..fd60a5957 100644 --- a/ports/qscintilla/portfile.cmake +++ b/ports/qscintilla/portfile.cmake @@ -38,13 +38,60 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) ) endif() -vcpkg_configure_qmake( - SOURCE_PATH "${SOURCE_PATH}/Qt4Qt5" - OPTIONS - ${BUILD_OPTIONS} +SET(ENV{PATH} "$ENV{PATH};${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin") + +#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}") + +#Configure debug +vcpkg_configure_qmake_debug( + SOURCE_PATH ${SOURCE_PATH}/Qt4Qt5 +) + +#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 "installed\\${TARGET_TRIPLET}\\lib" "installed\\${TARGET_TRIPLET}\\debug\\lib" _contents "${_contents}") + string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib qtmaind.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib\\manual-link qtmaind.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib" _contents "${_contents}") + file(WRITE "${DEBUG_MAKEFILE}" "${_contents}") +endforeach() + +#Build debug +vcpkg_build_qmake_debug(TARGETS debug) + +#Configure release +vcpkg_configure_qmake_release( + SOURCE_PATH ${SOURCE_PATH}/Qt4Qt5 ) -vcpkg_build_qmake() +#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*) + +foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) + file(READ "${RELEASE_MAKEFILE}" _contents) + string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\lib qtmain.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib\\manual-link qtmain.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib" _contents "${_contents}") + file(WRITE "${RELEASE_MAKEFILE}" "${_contents}") +endforeach() + +#Build release +vcpkg_build_qmake_release(TARGETS release) + +#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() set(BUILD_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) @@ -52,25 +99,25 @@ file(GLOB HEADER_FILES ${SOURCE_PATH}/Qt4Qt5/Qsci/*) file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/Qsci) file(INSTALL - ${BUILD_DIR}/release/qscintilla2_qt5.lib + ${RELEASE_DIR}/release/qscintilla2_qt5.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib RENAME qscintilla2.lib ) file(INSTALL - ${BUILD_DIR}/debug/qscintilla2_qt5.lib + ${DEBUG_DIR}/debug/qscintilla2_qt5.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib RENAME qscintilla2.lib ) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(INSTALL - ${BUILD_DIR}/release/qscintilla2_qt5.dll + ${RELEASE_DIR}/release/qscintilla2_qt5.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin ) file(INSTALL - ${BUILD_DIR}/debug/qscintilla2_qt5.dll + ${DEBUG_DIR}/debug/qscintilla2_qt5.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin ) -- cgit v1.2.3 From b47b4346f8c5b09cfb9826a083fc2d034a2ea9b4 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 18 Jan 2018 07:36:07 -0800 Subject: [vcpkg-build-qmake][vcpkg-configure-qmake] Collapse config-specific versions. --- ports/qscintilla/CONTROL | 2 +- ports/qscintilla/portfile.cmake | 75 +++------------------- ports/qt5-modularscripts/CONTROL | 2 +- ports/qt5-modularscripts/qt_modular_library.cmake | 56 +++-------------- ports/qwt/CONTROL | 2 +- ports/qwt/portfile.cmake | 54 +++------------- scripts/cmake/vcpkg_build_qmake.cmake | 76 +++++++++++++++++++---- scripts/cmake/vcpkg_build_qmake_debug.cmake | 30 --------- scripts/cmake/vcpkg_build_qmake_release.cmake | 30 --------- scripts/cmake/vcpkg_common_functions.cmake | 4 -- scripts/cmake/vcpkg_configure_qmake.cmake | 41 +++++++----- scripts/cmake/vcpkg_configure_qmake_debug.cmake | 46 -------------- scripts/cmake/vcpkg_configure_qmake_release.cmake | 46 -------------- 13 files changed, 116 insertions(+), 348 deletions(-) delete mode 100644 scripts/cmake/vcpkg_build_qmake_debug.cmake delete mode 100644 scripts/cmake/vcpkg_build_qmake_release.cmake delete mode 100644 scripts/cmake/vcpkg_configure_qmake_debug.cmake delete mode 100644 scripts/cmake/vcpkg_configure_qmake_release.cmake diff --git a/ports/qscintilla/CONTROL b/ports/qscintilla/CONTROL index 65fa0cd63..6453ad643 100644 --- a/ports/qscintilla/CONTROL +++ b/ports/qscintilla/CONTROL @@ -1,4 +1,4 @@ Source: qscintilla -Version: 2.10-3 +Version: 2.10-4 Description: QScintilla is a port to Qt of the Scintilla editing component. Features syntax highlighting, code-completion and much more (Barebone build without python bindings (missing dependeny PyQt) and without QtDesigner plugin) Build-Depends: qt5-base diff --git a/ports/qscintilla/portfile.cmake b/ports/qscintilla/portfile.cmake index fd60a5957..18ff18a97 100644 --- a/ports/qscintilla/portfile.cmake +++ b/ports/qscintilla/portfile.cmake @@ -1,15 +1,3 @@ -# Common Ambient Variables: -# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} -# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} -# CURRENT_PORT DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} -# PORT = current port name (zlib, etc) -# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) -# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic) -# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic) -# VCPKG_ROOT_DIR = -# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) -# - include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/QScintilla_gpl-2.10) vcpkg_download_distfile(ARCHIVE @@ -31,70 +19,24 @@ set(BUILD_OPTIONS CONFIG-=hide_symbols ) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(BUILD_OPTIONS - ${BUILD_OPTIONS} - CONFIG+=staticlib - ) -endif() - SET(ENV{PATH} "$ENV{PATH};${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin") #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}") - -#Configure debug -vcpkg_configure_qmake_debug( +vcpkg_configure_qmake( SOURCE_PATH ${SOURCE_PATH}/Qt4Qt5 + OPTIONS + CONFIG+=build_all + CONFIG-=hide_symbols ) -#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 "installed\\${TARGET_TRIPLET}\\lib" "installed\\${TARGET_TRIPLET}\\debug\\lib" _contents "${_contents}") - string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib qtmaind.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib\\manual-link qtmaind.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib" _contents "${_contents}") - file(WRITE "${DEBUG_MAKEFILE}" "${_contents}") -endforeach() - -#Build debug -vcpkg_build_qmake_debug(TARGETS debug) - -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${SOURCE_PATH}/Qt4Qt5 +vcpkg_build_qmake( + RELEASE_TARGETS release + DEBUG_TARGETS debug ) -#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*) - -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - file(READ "${RELEASE_MAKEFILE}" _contents) - string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\lib qtmain.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib\\manual-link qtmain.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib" _contents "${_contents}") - file(WRITE "${RELEASE_MAKEFILE}" "${_contents}") -endforeach() - -#Build release -vcpkg_build_qmake_release(TARGETS release) - -#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() - -set(BUILD_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) - file(GLOB HEADER_FILES ${SOURCE_PATH}/Qt4Qt5/Qsci/*) file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/Qsci) @@ -120,11 +62,10 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) ${DEBUG_DIR}/debug/qscintilla2_qt5.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin ) +endif() vcpkg_copy_pdbs() -endif() - # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/qscintilla) file(RENAME ${CURRENT_PACKAGES_DIR}/share/qscintilla/LICENSE ${CURRENT_PACKAGES_DIR}/share/qscintilla/copyright) diff --git a/ports/qt5-modularscripts/CONTROL b/ports/qt5-modularscripts/CONTROL index ddbdea51e..bf2ab2734 100644 --- a/ports/qt5-modularscripts/CONTROL +++ b/ports/qt5-modularscripts/CONTROL @@ -1,3 +1,3 @@ Source: qt5-modularscripts -Version: 0 +Version: 1 Description: Vcpkg helpers to package qt5 modules diff --git a/ports/qt5-modularscripts/qt_modular_library.cmake b/ports/qt5-modularscripts/qt_modular_library.cmake index cdffc58fa..0301bcebc 100644 --- a/ports/qt5-modularscripts/qt_modular_library.cmake +++ b/ports/qt5-modularscripts/qt_modular_library.cmake @@ -34,8 +34,6 @@ function(qt_modular_library NAME HASH) 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(PYTHON2) get_filename_component(PYTHON2_EXE_PATH ${PYTHON2} DIRECTORY) @@ -43,51 +41,14 @@ function(qt_modular_library NAME HASH) 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) - #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 "installed\\${TARGET_TRIPLET}\\lib" "installed\\${TARGET_TRIPLET}\\debug\\lib" _contents "${_contents}") - string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib qtmaind.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib\\manual-link qtmaind.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib" _contents "${_contents}") - file(WRITE "${DEBUG_MAKEFILE}" "${_contents}") - endforeach() - - #Build debug - vcpkg_build_qmake_debug() + #Configure debug+release + vcpkg_configure_qmake(SOURCE_PATH ${SOURCE_PATH}) - #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*) - - foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - file(READ "${RELEASE_MAKEFILE}" _contents) - string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\lib qtmain.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib\\manual-link qtmain.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib" _contents "${_contents}") - file(WRITE "${RELEASE_MAKEFILE}" "${_contents}") - endforeach() - - #Build release - vcpkg_build_qmake_release() + vcpkg_build_qmake() #Fix the cmake files if they exist if(EXISTS ${RELEASE_DIR}/lib/cmake) @@ -97,15 +58,16 @@ function(qt_modular_library NAME HASH) LOGNAME fix-cmake ) endif() - + + file(GLOB_RECURSE MAKEFILES ${DEBUG_DIR}/*Makefile* ${RELEASE_DIR}/*Makefile*) + #Set the correct install directory to packages - foreach(MAKEFILE ${RELEASE_MAKEFILES} ${DEBUG_MAKEFILES}) + foreach(MAKEFILE ${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) + vcpkg_build_qmake(TARGETS install SKIP_MAKEFILES BUILD_LOGNAME install) #Remove extra cmake files if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake) diff --git a/ports/qwt/CONTROL b/ports/qwt/CONTROL index 5bf85ad95..9dcf19f5b 100644 --- a/ports/qwt/CONTROL +++ b/ports/qwt/CONTROL @@ -1,4 +1,4 @@ Source: qwt -Version: 6.1.3-3 +Version: 6.1.3-4 Description: Qt widgets library for technical applications Build-Depends: qt5-base, qt5-svg diff --git a/ports/qwt/portfile.cmake b/ports/qwt/portfile.cmake index f4be871b7..918914a01 100644 --- a/ports/qwt/portfile.cmake +++ b/ports/qwt/portfile.cmake @@ -21,57 +21,16 @@ else() ) endif() -# The qwt build requires zlib1.dll -SET(ENV{PATH} "$ENV{PATH};${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin") - -#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}") - -#Configure debug -vcpkg_configure_qmake_debug( - SOURCE_PATH ${SOURCE_PATH} -) - -#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 "installed\\${TARGET_TRIPLET}\\lib" "installed\\${TARGET_TRIPLET}\\debug\\lib" _contents "${_contents}") - string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib qtmaind.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib\\manual-link qtmaind.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib" _contents "${_contents}") - file(WRITE "${DEBUG_MAKEFILE}" "${_contents}") -endforeach() - -#Build debug -vcpkg_build_qmake_debug(TARGETS sub-src-debug_ordered) +vcpkg_configure_qmake(SOURCE_PATH ${SOURCE_PATH}) -#Configure release -vcpkg_configure_qmake_release( - SOURCE_PATH ${SOURCE_PATH} +vcpkg_build_qmake( + RELEASE_TARGETS sub-src-release_ordered + DEBUG_TARGETS sub-src-debug_ordered ) -#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*) - -foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) - file(READ "${RELEASE_MAKEFILE}" _contents) - string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\lib qtmain.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib\\manual-link qtmain.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib" _contents "${_contents}") - file(WRITE "${RELEASE_MAKEFILE}" "${_contents}") -endforeach() - -#Build release -vcpkg_build_qmake_release(TARGETS sub-src-release_ordered) - #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}") @@ -92,7 +51,7 @@ file(INSTALL DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib ) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") file(INSTALL ${RELEASE_DIR}/lib/qwt.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin @@ -100,11 +59,12 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) file(INSTALL ${DEBUG_DIR}/lib/qwtd.dll - ${DEBUG_DIR}/lib/qwtd.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin ) endif() +vcpkg_copy_pdbs() + # Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/qwt) file(RENAME ${CURRENT_PACKAGES_DIR}/share/qwt/COPYING ${CURRENT_PACKAGES_DIR}/share/qwt/copyright) diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index 693f7841e..194ab8206 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -1,31 +1,81 @@ #.rst: # .. command:: vcpkg_build_qmake # -# Build a qmake-based project, previously configured using vcpkg_configure_qmake . -# As the CONFIG qmake option is assumed to be "debug_and_release" (the default value on Windows, see [1]), -# both the debug and release libraries are build in the same build tree. +# Build a qmake-based project, previously configured using vcpkg_configure_qmake. # # :: # vcpkg_build_qmake() # -# -# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html function(vcpkg_build_qmake) + cmake_parse_arguments(_csc "SKIP_MAKEFILES" "BUILD_LOGNAME" "TARGETS;RELEASE_TARGETS;DEBUG_TARGETS" ${ARGN}) vcpkg_find_acquire_program(JOM) # Make sure that the linker finds the libraries used set(ENV_PATH_BACKUP "$ENV{PATH}") - set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;$ENV{PATH}") - message(STATUS "Package ${TARGET_TRIPLET}") - vcpkg_execute_required_process( - COMMAND ${JOM} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} - LOGNAME package-${TARGET_TRIPLET} - ) - message(STATUS "Package ${TARGET_TRIPLET} done") + set(DEBUG_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + set(RELEASE_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR) + + list(APPEND _csc_RELEASE_TARGETS ${_csc_TARGETS}) + list(APPEND _csc_DEBUG_TARGETS ${_csc_TARGETS}) + + if(NOT _csc_BUILD_LOGNAME) + set(_csc_BUILD_LOGNAME build) + endif() + + function(run_jom TARGETS LOG_PREFIX LOG_SUFFIX) + message(STATUS "Package ${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX}") + vcpkg_execute_required_process( + COMMAND ${JOM} ${TARGETS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${LOG_SUFFIX} + LOGNAME package-${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX} + ) + message(STATUS "Package ${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX} done") + endfunction() + + # This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings + set(ENV_CL_BACKUP "$ENV{_CL_}") + set(ENV{_CL_} "/utf-8") + + #First generate the makefiles so we can modify them + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;${ENV_PATH_BACKUP}") + if(NOT _csc_SKIP_MAKEFILES) + run_jom(qmake_all makefiles dbg) + + #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 "installed\\${TARGET_TRIPLET}\\lib" "installed\\${TARGET_TRIPLET}\\debug\\lib" _contents "${_contents}") + string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib qtmaind.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib\\manual-link qtmaind.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib" _contents "${_contents}") + file(WRITE "${DEBUG_MAKEFILE}" "${_contents}") + endforeach() + endif() + + run_jom("${_csc_DEBUG_TARGETS}" ${_csc_BUILD_LOGNAME} dbg) + + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;${ENV_PATH_BACKUP}") + if(NOT _csc_SKIP_MAKEFILES) + run_jom(qmake_all makefiles rel) + + #Store release makefile path + file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) + + foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) + file(READ "${RELEASE_MAKEFILE}" _contents) + string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\lib qtmain.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib\\manual-link qtmain.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib" _contents "${_contents}") + file(WRITE "${RELEASE_MAKEFILE}" "${_contents}") + endforeach() + endif() + + run_jom("${_csc_RELEASE_TARGETS}" ${_csc_BUILD_LOGNAME} rel) # Restore the original value of ENV{PATH} set(ENV{PATH} "${ENV_PATH_BACKUP}") + set(ENV{_CL_} "${ENV_CL_BACKUP}") endfunction() diff --git a/scripts/cmake/vcpkg_build_qmake_debug.cmake b/scripts/cmake/vcpkg_build_qmake_debug.cmake deleted file mode 100644 index a734e63cf..000000000 --- a/scripts/cmake/vcpkg_build_qmake_debug.cmake +++ /dev/null @@ -1,30 +0,0 @@ -#.rst: -# .. command:: vcpkg_build_qmake_debug -# -# Build a qmake-based project, previously configured using vcpkg_configure_qmake_debug. -# -# :: -# vcpkg_build_qmake_debug() -# -# -# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html - -function(vcpkg_build_qmake_debug) - cmake_parse_arguments(_csc "" "" "TARGETS" ${ARGN}) - vcpkg_find_acquire_program(JOM) - - # Make sure that the linker finds the libraries used - set(ENV_PATH_BACKUP "$ENV{PATH}") - set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/debug/tools/qt5;$ENV{PATH}") - - message(STATUS "Package ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND ${JOM} ${_csc_TARGETS} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME package-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Package ${TARGET_TRIPLET}-dbg done") - - # Restore the original value of ENV{PATH} - set(ENV{PATH} "${ENV_PATH_BACKUP}") -endfunction() diff --git a/scripts/cmake/vcpkg_build_qmake_release.cmake b/scripts/cmake/vcpkg_build_qmake_release.cmake deleted file mode 100644 index 3daf9201b..000000000 --- a/scripts/cmake/vcpkg_build_qmake_release.cmake +++ /dev/null @@ -1,30 +0,0 @@ -#.rst: -# .. command:: vcpkg_build_qmake_release -# -# Build a qmake-based project, previously configured using vcpkg_configure_qmake_release. -# -# :: -# vcpkg_build_qmake_release() -# -# -# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html - -function(vcpkg_build_qmake_release) - cmake_parse_arguments(_csc "" "" "TARGETS" ${ARGN}) - vcpkg_find_acquire_program(JOM) - - # Make sure that the linker finds the libraries used - set(ENV_PATH_BACKUP "$ENV{PATH}") - set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;$ENV{PATH}") - - message(STATUS "Package ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND ${JOM} ${_csc_TARGETS} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME package-${TARGET_TRIPLET}-rel - ) - message(STATUS "Package ${TARGET_TRIPLET}-rel done") - - # Restore the original value of ENV{PATH} - set(ENV{PATH} "${ENV_PATH_BACKUP}") -endfunction() diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 258b8f64a..27dd0732d 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -10,15 +10,11 @@ include(vcpkg_from_bitbucket) include(vcpkg_build_cmake) include(vcpkg_build_msbuild) include(vcpkg_build_qmake) -include(vcpkg_build_qmake_debug) -include(vcpkg_build_qmake_release) include(vcpkg_install_cmake) include(vcpkg_install_meson) include(vcpkg_configure_cmake) include(vcpkg_configure_meson) include(vcpkg_configure_qmake) -include(vcpkg_configure_qmake_debug) -include(vcpkg_configure_qmake_release) include(vcpkg_apply_patches) include(vcpkg_copy_pdbs) include(vcpkg_copy_tool_dependencies) diff --git a/scripts/cmake/vcpkg_configure_qmake.cmake b/scripts/cmake/vcpkg_configure_qmake.cmake index 037197e48..4cc7bc9f7 100644 --- a/scripts/cmake/vcpkg_configure_qmake.cmake +++ b/scripts/cmake/vcpkg_configure_qmake.cmake @@ -2,11 +2,6 @@ # .. command:: vcpkg_configure_qmake # # Configure a qmake-based project. -# It is assume that the qmake project CONFIG variable is -# "debug_and_release" (the default value on Windows, see [1]). -# Using this option, only one Makefile for building both Release and Debug -# libraries is generated, that then can be run using the vcpkg_build_qmake -# command. # # :: # vcpkg_configure_qmake(SOURCE_PATH @@ -17,28 +12,44 @@ # The path to the *.pro qmake project file. # ``OPTIONS`` # The options passed to qmake. -# -# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html function(vcpkg_configure_qmake) cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) - # Find qmake exectuable + # Find qmake executable 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() + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + list(APPEND _csc_OPTIONS CONFIG+=staticlib) + endif() + # Cleanup build directories - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - message(STATUS "Configuring ${TARGET_TRIPLET}") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + 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} ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} - LOGNAME config-${TARGET_TRIPLET} + 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 ) - message(STATUS "Configuring ${TARGET_TRIPLET} done") + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + + configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_debug.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/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} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/qt.conf" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_configure_qmake_debug.cmake b/scripts/cmake/vcpkg_configure_qmake_debug.cmake deleted file mode 100644 index 3eeb42cb3..000000000 --- a/scripts/cmake/vcpkg_configure_qmake_debug.cmake +++ /dev/null @@ -1,46 +0,0 @@ -#.rst: -# .. command:: vcpkg_configure_qmake_debug -# -# Configure a qmake-based project. -# This sets the config variable to debug and outputs to -# a debug triplet directory. -# -# :: -# vcpkg_configure_qmake_debug(SOURCE_PATH -# [OPTIONS arg1 [arg2 ...]] -# ) -# -# ``SOURCE_PATH`` -# The path to the *.pro qmake project file. -# ``OPTIONS`` -# The options passed to qmake. -# -# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html - -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}/tools/qt5) - - if(NOT QMAKE_COMMAND) - message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") - endif() - - # 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} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf" - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME config-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") - unset(QMAKE_COMMAND) - unset(QMAKE_COMMAND PARENT_SCOPE) - unset(QMAKE_COMMAND CACHE) -endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_configure_qmake_release.cmake b/scripts/cmake/vcpkg_configure_qmake_release.cmake deleted file mode 100644 index 60750060b..000000000 --- a/scripts/cmake/vcpkg_configure_qmake_release.cmake +++ /dev/null @@ -1,46 +0,0 @@ -#.rst: -# .. command:: vcpkg_configure_qmake_release -# -# Configure a qmake-based project. -# This sets the config variable to release and outputs to -# a release triplet directory. -# -# :: -# vcpkg_configure_qmake_release(SOURCE_PATH -# [OPTIONS arg1 [arg2 ...]] -# ) -# -# ``SOURCE_PATH`` -# The path to the *.pro qmake project file. -# ``OPTIONS`` -# The options passed to qmake. -# -# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html - -function(vcpkg_configure_qmake_release) - cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) - - # 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() - - # 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} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf" - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME config-${TARGET_TRIPLET}-rel - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") - unset(QMAKE_COMMAND) - unset(QMAKE_COMMAND PARENT_SCOPE) - unset(QMAKE_COMMAND CACHE) -endfunction() \ No newline at end of file -- cgit v1.2.3