From 0af6ca8123b280f082ce6286700ee1a6e5b9a0f2 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 25 Oct 2016 02:06:27 +1100 Subject: add qt5 support, working install but static linkage with RT needs to be implemented --- ports/qt5/CONTROL | 4 + ports/qt5/portfile.cmake | 107 +++++++++++++++++++++++++ scripts/cmake/vcpkg_find_acquire_program.cmake | 6 ++ 3 files changed, 117 insertions(+) create mode 100644 ports/qt5/CONTROL create mode 100644 ports/qt5/portfile.cmake diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL new file mode 100644 index 000000000..6afd3e5c5 --- /dev/null +++ b/ports/qt5/CONTROL @@ -0,0 +1,4 @@ +Source: qt5 +Version: 5.7 +Build-Depends: +Description: Qt5 base components. diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake new file mode 100644 index 000000000..53abe8e02 --- /dev/null +++ b/ports/qt5/portfile.cmake @@ -0,0 +1,107 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/qt-5.7.0) +set(ENV{QMAKESPEC} win32-msvc2015) +set(OUTPUT_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) +set(ENV{QTDIR} ${OUTPUT_PATH}/qtbase) +set(ENV{PATH} "${OUTPUT_PATH}/qtbase/bin;$ENV{PATH}") + +find_program(NMAKE nmake) +vcpkg_find_acquire_program(JOM) +get_filename_component(JOM_EXE_PATH ${JOM} DIRECTORY) +set(ENV{PATH} "${JOM_EXE_PATH};$ENV{PATH}") + +vcpkg_download_distfile(ARCHIVE_FILE + URLS "http://download.qt.io/official_releases/qt/5.7/5.7.0/single/qt-everywhere-opensource-src-5.7.0.7z" + FILENAME "qt-5.7.0.7z" + SHA512 96f0b6bd221be0ed819bc9b52eefcee1774945e25b89169fa927148c1c4a2d85faf63b1d09ef5067573bda9bbf1270fce5f181d086bfe585ddbad4cd77f7f418 +) +vcpkg_extract_source_archive(${ARCHIVE_FILE}) +if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.7.0) + file(RENAME ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.7.0 ${CURRENT_BUILDTREES_DIR}/src/qt-5.7.0) +endif() + +file(MAKE_DIRECTORY ${OUTPUT_PATH}) +message(STATUS "Configuring ${TARGET_TRIPLET}") +vcpkg_execute_required_process( + COMMAND "${SOURCE_PATH}/configure.bat" + -confirm-license -opensource + -debug-and-release -force-debug-info + -nomake examples -nomake tests -skip webengine + -prefix "${CURRENT_PACKAGES_DIR}" + WORKING_DIRECTORY ${OUTPUT_PATH} + LOGNAME configure-${TARGET_TRIPLET} +) +message(STATUS "Configure ${TARGET_TRIPLET} done") + +message(STATUS "Building ${TARGET_TRIPLET}") +vcpkg_execute_required_process( + COMMAND ${JOM} + WORKING_DIRECTORY ${OUTPUT_PATH} + LOGNAME build-${TARGET_TRIPLET} +) +message(STATUS "Build ${TARGET_TRIPLET} done") + +message(STATUS "Installing ${TARGET_TRIPLET}") +vcpkg_execute_required_process( + COMMAND ${NMAKE} install + WORKING_DIRECTORY ${OUTPUT_PATH} + LOGNAME install-${TARGET_TRIPLET} +) +message(STATUS "Install ${TARGET_TRIPLET} done") + +message(STATUS "Packaging ${TARGET_TRIPLET}") +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) + +file(INSTALL ${CURRENT_PACKAGES_DIR}/bin + DESTINATION ${CURRENT_PACKAGES_DIR}/debug + FILES_MATCHING PATTERN "*d.dll" +) +file(INSTALL ${CURRENT_PACKAGES_DIR}/bin + DESTINATION ${CURRENT_PACKAGES_DIR}/debug + FILES_MATCHING PATTERN "*d.pdb" +) +file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.dll") +file(REMOVE ${DEBUG_BIN_FILES}) +file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.pdb") +file(REMOVE ${DEBUG_BIN_FILES}) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/Qt5Gamepad.dll ${CURRENT_PACKAGES_DIR}/bin/Qt5Gamepad.dll) + +file(INSTALL ${CURRENT_PACKAGES_DIR}/lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug + FILES_MATCHING PATTERN "*d.lib" +) +file(INSTALL ${CURRENT_PACKAGES_DIR}/lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug + FILES_MATCHING PATTERN "*d.prl" +) +file(INSTALL ${CURRENT_PACKAGES_DIR}/lib + DESTINATION ${CURRENT_PACKAGES_DIR}/debug + FILES_MATCHING PATTERN "*d.pdb" +) +file(GLOB DEBUG_LIB_FILES "${CURRENT_PACKAGES_DIR}/lib/*d.lib") +file(REMOVE ${DEBUG_LIB_FILES}) +file(GLOB DEBUG_LIB_FILES "${CURRENT_PACKAGES_DIR}/lib/*d.prl") +file(REMOVE ${DEBUG_LIB_FILES}) +file(GLOB DEBUG_LIB_FILES "${CURRENT_PACKAGES_DIR}/lib/*d.pdb") +file(REMOVE ${DEBUG_LIB_FILES}) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.lib) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.prl) +file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) +file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) +FILE(REMOVE ${BINARY_TOOLS}) + +set(SHARE_PATH ${CURRENT_PACKAGES_DIR}/share/qt5) +file(MAKE_DIRECTORY ${SHARE_PATH}) +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${SHARE_PATH} RENAME copyright) +file(RENAME ${CURRENT_PACKAGES_DIR}/doc ${SHARE_PATH}/doc) +file(RENAME ${CURRENT_PACKAGES_DIR}/mkspecs ${SHARE_PATH}/mkspecs) +file(RENAME ${CURRENT_PACKAGES_DIR}/phrasebooks ${SHARE_PATH}/phrasebooks) +file(RENAME ${CURRENT_PACKAGES_DIR}/plugins ${SHARE_PATH}/plugins) +file(RENAME ${CURRENT_PACKAGES_DIR}/qml ${SHARE_PATH}/qml) +file(RENAME ${CURRENT_PACKAGES_DIR}/translations ${SHARE_PATH}/translations) +vcpkg_copy_pdbs() diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 8f974240f..230c4b1e7 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -24,6 +24,12 @@ function(vcpkg_find_acquire_program VAR) set(ARCHIVE "yasm.exe") set(NOEXTRACT ON) set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720) +elseif(VAR MATCHES "JOM") +set(PROGNAME jom) +set(PATHS ${DOWNLOADS}/tools/jom/jom-1.1.1) +set(URL "http://download.qt.io/official_releases/jom/jom_1_1_1.zip") +set(ARCHIVE "jom_1_1_1.zip") +set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() -- cgit v1.2.3 From 8dbeacd5ad5d9a1d5719f9e84c1f91ee93a2d37d Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 25 Oct 2016 12:39:50 +1100 Subject: static linkage and jom fixes --- ports/qt5/CONTROL | 2 +- ports/qt5/portfile.cmake | 25 +++++++++++++++++++++++-- scripts/cmake/vcpkg_find_acquire_program.cmake | 10 +++++----- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index 6afd3e5c5..acdfd4ec8 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +1,4 @@ Source: qt5 Version: 5.7 Build-Depends: -Description: Qt5 base components. +Description: Qt5 application framework base components. Webengine, examples and tests not included. diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 53abe8e02..c7358dec6 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -1,7 +1,8 @@ +include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/qt-5.7.0) -set(ENV{QMAKESPEC} win32-msvc2015) set(OUTPUT_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) +set(ENV{QMAKESPEC} win32-msvc2015) set(ENV{QTDIR} ${OUTPUT_PATH}/qtbase) set(ENV{PATH} "${OUTPUT_PATH}/qtbase/bin;$ENV{PATH}") @@ -22,10 +23,16 @@ endif() file(MAKE_DIRECTORY ${OUTPUT_PATH}) message(STATUS "Configuring ${TARGET_TRIPLET}") + +#if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) +# list(APPEND QT_RUNTIME_LINKAGE "-static") +# list(APPEND QT_RUNTIME_LINKAGE "-static-runtime") +#endif() + vcpkg_execute_required_process( COMMAND "${SOURCE_PATH}/configure.bat" -confirm-license -opensource - -debug-and-release -force-debug-info + -debug-and-release -force-debug-info ${QT_RUNTIME_LINKAGE} -nomake examples -nomake tests -skip webengine -prefix "${CURRENT_PACKAGES_DIR}" WORKING_DIRECTORY ${OUTPUT_PATH} @@ -92,6 +99,20 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib ${CURRENT_PACKAGES_ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.prl) file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) +foreach(BINARY ${BINARY_TOOLS}) + execute_process(COMMAND dumpbin /PDBPATH ${BINARY} + COMMAND findstr PDB + OUTPUT_VARIABLE PDB_LINE + ERROR_QUIET + RESULT_VARIABLE error_code + ) + if(NOT error_code AND PDB_LINE MATCHES "PDB file found at") + string(REGEX MATCH '.*' PDB_PATH ${PDB_LINE}) # Extract the path which is in single quotes + string(REPLACE ' "" PDB_PATH ${PDB_PATH}) # Remove single quotes + file(INSTALL ${PDB_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) + file(REMOVE ${PDB_PATH}) + endif() +endforeach() file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) FILE(REMOVE ${BINARY_TOOLS}) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 230c4b1e7..0e993b78b 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -25,11 +25,11 @@ function(vcpkg_find_acquire_program VAR) set(NOEXTRACT ON) set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720) elseif(VAR MATCHES "JOM") -set(PROGNAME jom) -set(PATHS ${DOWNLOADS}/tools/jom/jom-1.1.1) -set(URL "http://download.qt.io/official_releases/jom/jom_1_1_1.zip") -set(ARCHIVE "jom_1_1_1.zip") -set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720) + set(PROGNAME jom) + set(PATHS ${DOWNLOADS}/tools/jom) + set(URL "http://download.qt.io/official_releases/jom/jom_1_1_1.zip") + set(ARCHIVE "jom_1_1_1.zip") + set(HASH 23a26dc7e29979bec5dcd3bfcabf76397b93ace64f5d46f2254d6420158bac5eff1c1a8454e3427e7a2fe2c233c5f2cffc87b376772399e12e40b51be2c065f4) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() -- cgit v1.2.3 From 7e19b17a07c45b3b4b5ab3972e84bac90c0b64f9 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 25 Oct 2016 16:14:21 +1100 Subject: static installation fixes --- ports/qt5/CONTROL | 2 +- ports/qt5/portfile.cmake | 20 ++++++++++++++------ ports/qt5/set-shared-qmakespec.patch | 18 ++++++++++++++++++ ports/qt5/set-static-qmakespec.patch | 18 ++++++++++++++++++ 4 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 ports/qt5/set-shared-qmakespec.patch create mode 100644 ports/qt5/set-static-qmakespec.patch diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index acdfd4ec8..1629819e8 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +1,4 @@ Source: qt5 Version: 5.7 Build-Depends: -Description: Qt5 application framework base components. Webengine, examples and tests not included. +Description: Qt5 application framework main components. Webengine, examples and tests not included. diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index c7358dec6..9a5d7ff03 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -2,7 +2,6 @@ include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/qt-5.7.0) set(OUTPUT_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) -set(ENV{QMAKESPEC} win32-msvc2015) set(ENV{QTDIR} ${OUTPUT_PATH}/qtbase) set(ENV{PATH} "${OUTPUT_PATH}/qtbase/bin;$ENV{PATH}") @@ -24,14 +23,23 @@ endif() file(MAKE_DIRECTORY ${OUTPUT_PATH}) message(STATUS "Configuring ${TARGET_TRIPLET}") -#if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) -# list(APPEND QT_RUNTIME_LINKAGE "-static") -# list(APPEND QT_RUNTIME_LINKAGE "-static-runtime") -#endif() +if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) + list(APPEND QT_RUNTIME_LINKAGE "-static") + list(APPEND QT_RUNTIME_LINKAGE "-static-runtime") + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/set-static-qmakespec.patch" + ) +else() + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/set-shared-qmakespec.patch" + ) +endif() vcpkg_execute_required_process( COMMAND "${SOURCE_PATH}/configure.bat" - -confirm-license -opensource + -confirm-license -opensource -developer-build -platform win32-msvc2015 -debug-and-release -force-debug-info ${QT_RUNTIME_LINKAGE} -nomake examples -nomake tests -skip webengine -prefix "${CURRENT_PACKAGES_DIR}" diff --git a/ports/qt5/set-shared-qmakespec.patch b/ports/qt5/set-shared-qmakespec.patch new file mode 100644 index 000000000..d4b7c2a82 --- /dev/null +++ b/ports/qt5/set-shared-qmakespec.patch @@ -0,0 +1,18 @@ +diff --git a/qtbase/mkspecs/common/msvc-desktop.conf b/qtbase/mkspecs/common/msvc-desktop.conf +index 80fcd9b..1b9d57b 100644 +--- a/qtbase/mkspecs/common/msvc-desktop.conf ++++ b/qtbase/mkspecs/common/msvc-desktop.conf +@@ -29,9 +29,9 @@ + QMAKE_YACCFLAGS = -d + QMAKE_CFLAGS = -nologo -Zc:wchar_t + QMAKE_CFLAGS_WARN_ON = -W3 + QMAKE_CFLAGS_WARN_OFF = -W0 +-QMAKE_CFLAGS_RELEASE = -O2 -MT +-QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi +-QMAKE_CFLAGS_DEBUG = -Zi -MTd ++QMAKE_CFLAGS_RELEASE = -O2 -MD ++QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi ++QMAKE_CFLAGS_DEBUG = -Zi -MDd + QMAKE_CFLAGS_YACC = + QMAKE_CFLAGS_LTCG = -GL + \ No newline at end of file diff --git a/ports/qt5/set-static-qmakespec.patch b/ports/qt5/set-static-qmakespec.patch new file mode 100644 index 000000000..26b312f2f --- /dev/null +++ b/ports/qt5/set-static-qmakespec.patch @@ -0,0 +1,18 @@ +diff --git a/qtbase/mkspecs/common/msvc-desktop.conf b/qtbase/mkspecs/common/msvc-desktop.conf +index 1b9d57b..80fcd9b 100644 +--- a/qtbase/mkspecs/common/msvc-desktop.conf ++++ b/qtbase/mkspecs/common/msvc-desktop.conf +@@ -29,9 +29,9 @@ + QMAKE_YACCFLAGS = -d + QMAKE_CFLAGS = -nologo -Zc:wchar_t + QMAKE_CFLAGS_WARN_ON = -W3 + QMAKE_CFLAGS_WARN_OFF = -W0 +-QMAKE_CFLAGS_RELEASE = -O2 -MD +-QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi +-QMAKE_CFLAGS_DEBUG = -Zi -MDd ++QMAKE_CFLAGS_RELEASE = -O2 -MT ++QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi ++QMAKE_CFLAGS_DEBUG = -Zi -MTd + QMAKE_CFLAGS_YACC = + QMAKE_CFLAGS_LTCG = -GL + \ No newline at end of file -- cgit v1.2.3 From 162ba52f43d2463150bbf81d65ae218a1df11814 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 25 Oct 2016 20:56:02 +1100 Subject: need a function to repeatedly build up to a number of failures, since qt builds are so flaky --- ports/qt5/portfile.cmake | 37 ++++++++++++---------- scripts/cmake/vcpkg_common_functions.cmake | 3 +- .../vcpkg_execute_required_process_repeat.cmake | 28 ++++++++++++++++ scripts/cmake/vcpkg_find_acquire_program.cmake | 2 +- 4 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 scripts/cmake/vcpkg_execute_required_process_repeat.cmake diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 9a5d7ff03..d4f8c84ff 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -21,8 +21,6 @@ if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.7.0) endif() file(MAKE_DIRECTORY ${OUTPUT_PATH}) -message(STATUS "Configuring ${TARGET_TRIPLET}") - if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) list(APPEND QT_RUNTIME_LINKAGE "-static") list(APPEND QT_RUNTIME_LINKAGE "-static-runtime") @@ -37,9 +35,10 @@ else() ) endif() +message(STATUS "Configuring ${TARGET_TRIPLET}") vcpkg_execute_required_process( COMMAND "${SOURCE_PATH}/configure.bat" - -confirm-license -opensource -developer-build -platform win32-msvc2015 + -confirm-license -opensource -platform win32-msvc2015 -debug-and-release -force-debug-info ${QT_RUNTIME_LINKAGE} -nomake examples -nomake tests -skip webengine -prefix "${CURRENT_PACKAGES_DIR}" @@ -49,7 +48,8 @@ vcpkg_execute_required_process( message(STATUS "Configure ${TARGET_TRIPLET} done") message(STATUS "Building ${TARGET_TRIPLET}") -vcpkg_execute_required_process( +vcpkg_execute_required_process_repeat( + COUNT 5 COMMAND ${JOM} WORKING_DIRECTORY ${OUTPUT_PATH} LOGNAME build-${TARGET_TRIPLET} @@ -71,19 +71,21 @@ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) -file(INSTALL ${CURRENT_PACKAGES_DIR}/bin - DESTINATION ${CURRENT_PACKAGES_DIR}/debug - FILES_MATCHING PATTERN "*d.dll" -) -file(INSTALL ${CURRENT_PACKAGES_DIR}/bin - DESTINATION ${CURRENT_PACKAGES_DIR}/debug - FILES_MATCHING PATTERN "*d.pdb" -) -file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.dll") -file(REMOVE ${DEBUG_BIN_FILES}) -file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.pdb") -file(REMOVE ${DEBUG_BIN_FILES}) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/Qt5Gamepad.dll ${CURRENT_PACKAGES_DIR}/bin/Qt5Gamepad.dll) +if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) + file(INSTALL ${CURRENT_PACKAGES_DIR}/bin + DESTINATION ${CURRENT_PACKAGES_DIR}/debug + FILES_MATCHING PATTERN "*d.dll" + ) + file(INSTALL ${CURRENT_PACKAGES_DIR}/bin + DESTINATION ${CURRENT_PACKAGES_DIR}/debug + FILES_MATCHING PATTERN "*d.pdb" + ) + file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.dll") + file(REMOVE ${DEBUG_BIN_FILES}) + file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.pdb") + file(REMOVE ${DEBUG_BIN_FILES}) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/Qt5Gamepad.dll ${CURRENT_PACKAGES_DIR}/bin/Qt5Gamepad.dll) +endif() file(INSTALL ${CURRENT_PACKAGES_DIR}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug @@ -133,4 +135,5 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/phrasebooks ${SHARE_PATH}/phrasebooks) file(RENAME ${CURRENT_PACKAGES_DIR}/plugins ${SHARE_PATH}/plugins) file(RENAME ${CURRENT_PACKAGES_DIR}/qml ${SHARE_PATH}/qml) file(RENAME ${CURRENT_PACKAGES_DIR}/translations ${SHARE_PATH}/translations) +file(RENAME ${CURRENT_PACKAGES_DIR}/qtvirtualkeyboard ${SHARE_PATH}/qtvirtualkeyboard) vcpkg_copy_pdbs() diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 59824eb17..f1bbdb9e3 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -1,10 +1,11 @@ include(vcpkg_download_distfile) include(vcpkg_extract_source_archive) include(vcpkg_execute_required_process) +include(vcpkg_execute_required_process_repeat) include(vcpkg_find_acquire_program) include(vcpkg_build_cmake) include(vcpkg_build_msbuild) include(vcpkg_install_cmake) include(vcpkg_configure_cmake) include(vcpkg_apply_patches) -include(vcpkg_copy_pdbs) \ No newline at end of file +include(vcpkg_copy_pdbs) diff --git a/scripts/cmake/vcpkg_execute_required_process_repeat.cmake b/scripts/cmake/vcpkg_execute_required_process_repeat.cmake new file mode 100644 index 000000000..562265ee2 --- /dev/null +++ b/scripts/cmake/vcpkg_execute_required_process_repeat.cmake @@ -0,0 +1,28 @@ +# Usage: vcpkg_execute_required_process_repeat(COUNT COMMAND [...] WORKING_DIRECTORY LOGNAME ) +function(vcpkg_execute_required_process_repeat) + cmake_parse_arguments(vcpkg_execute_required_process_repeat "" "COUNT;WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN}) + #debug_message("vcpkg_execute_required_process_repeat(${vcpkg_execute_required_process_repeat_COMMAND})") + foreach(loop_count RANGE ${vcpkg_execute_required_process_repeat_COUNT}) + execute_process( + COMMAND ${vcpkg_execute_required_process_repeat_COMMAND} + OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_repeat_LOGNAME}-out.log + ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process__repeat_LOGNAME}-err.log + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY}) + #debug_message("error_code=${error_code}") + file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}" NATIVE_BUILDTREES_DIR) + if(NOT error_code) + set(SUCCESSFUL_EXECUTION TRUE) + break() + endif() + endforeach(loop_count) + if (NOT ${SUCCESSFUL_EXECUTION}) + message(FATAL_ERROR + " Command failed: ${vcpkg_execute_required_process_repeat_COMMAND}\n" + " Working Directory: ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY}\n" + " See logs for more information:\n" + " ${NATIVE_BUILDTREES_DIR}\\${vcpkg_execute_required_process_repeat_LOGNAME}-out.log\n" + " ${NATIVE_BUILDTREES_DIR}\\${vcpkg_execute_required_process_repeat_LOGNAME}-err.log\n" + ) + endif() +endfunction() diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 0e993b78b..337cc04a5 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -24,7 +24,7 @@ function(vcpkg_find_acquire_program VAR) set(ARCHIVE "yasm.exe") set(NOEXTRACT ON) set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720) -elseif(VAR MATCHES "JOM") + elseif(VAR MATCHES "JOM") set(PROGNAME jom) set(PATHS ${DOWNLOADS}/tools/jom) set(URL "http://download.qt.io/official_releases/jom/jom_1_1_1.zip") -- cgit v1.2.3 From ab4aa274c15f792f98a0f6ada3dfc61e444e0011 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 25 Oct 2016 22:27:51 +1100 Subject: virtual keyboard directory isn't created in static builds, no rename required --- ports/qt5/portfile.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index d4f8c84ff..357f7bdff 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -135,5 +135,7 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/phrasebooks ${SHARE_PATH}/phrasebooks) file(RENAME ${CURRENT_PACKAGES_DIR}/plugins ${SHARE_PATH}/plugins) file(RENAME ${CURRENT_PACKAGES_DIR}/qml ${SHARE_PATH}/qml) file(RENAME ${CURRENT_PACKAGES_DIR}/translations ${SHARE_PATH}/translations) -file(RENAME ${CURRENT_PACKAGES_DIR}/qtvirtualkeyboard ${SHARE_PATH}/qtvirtualkeyboard) +if (EXISTS ${CURRENT_PACKAGES_DIR}/qtvirtualkeyboard) + file(RENAME ${CURRENT_PACKAGES_DIR}/qtvirtualkeyboard ${SHARE_PATH}/qtvirtualkeyboard) +endif() vcpkg_copy_pdbs() -- cgit v1.2.3 From 095afa2ff154f67dee28420b0cb5abd426801734 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 25 Oct 2016 22:31:27 +1100 Subject: incorrect error file variable --- scripts/cmake/vcpkg_execute_required_process_repeat.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_execute_required_process_repeat.cmake b/scripts/cmake/vcpkg_execute_required_process_repeat.cmake index 562265ee2..d6fba132d 100644 --- a/scripts/cmake/vcpkg_execute_required_process_repeat.cmake +++ b/scripts/cmake/vcpkg_execute_required_process_repeat.cmake @@ -6,7 +6,7 @@ function(vcpkg_execute_required_process_repeat) execute_process( COMMAND ${vcpkg_execute_required_process_repeat_COMMAND} OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_repeat_LOGNAME}-out.log - ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process__repeat_LOGNAME}-err.log + ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_repeat_LOGNAME}-err.log RESULT_VARIABLE error_code WORKING_DIRECTORY ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY}) #debug_message("error_code=${error_code}") -- cgit v1.2.3 From 9467c1bd81c655b060aa9df5aeb0047b87e93058 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Wed, 26 Oct 2016 12:30:58 +1100 Subject: jom the install, dynamic linkage means tools need the dlls --- ports/qt5/portfile.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 357f7bdff..e2949892b 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -58,7 +58,7 @@ message(STATUS "Build ${TARGET_TRIPLET} done") message(STATUS "Installing ${TARGET_TRIPLET}") vcpkg_execute_required_process( - COMMAND ${NMAKE} install + COMMAND ${JOM} install WORKING_DIRECTORY ${OUTPUT_PATH} LOGNAME install-${TARGET_TRIPLET} ) @@ -126,6 +126,12 @@ endforeach() file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) FILE(REMOVE ${BINARY_TOOLS}) +#if we are using dynamic linkage, the tools also require the dlls and platforms directory to run correctly +if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) + file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/bin/*.dll") + file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) + file(INSTALL ${CURRENT_PACKAGES_DIR}/plugins/platforms DESTINATION ${CURRENT_PACKAGES_DIR}/tools) +endif() set(SHARE_PATH ${CURRENT_PACKAGES_DIR}/share/qt5) file(MAKE_DIRECTORY ${SHARE_PATH}) file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${SHARE_PATH} RENAME copyright) -- cgit v1.2.3 From a79c348045f513de8fb24ffb12532c1b1a396c3c Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Sun, 30 Oct 2016 13:45:09 +1100 Subject: fixes for plugin installation, cmake package files --- ports/qt5/fixcmake.py | 36 ++++++++++++++++++++++++++++++++++++ ports/qt5/portfile.cmake | 34 ++++++++++++++++------------------ 2 files changed, 52 insertions(+), 18 deletions(-) create mode 100644 ports/qt5/fixcmake.py diff --git a/ports/qt5/fixcmake.py b/ports/qt5/fixcmake.py new file mode 100644 index 000000000..dbee0ed16 --- /dev/null +++ b/ports/qt5/fixcmake.py @@ -0,0 +1,36 @@ +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 = "" + 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 exepattern.search(line) != None: + builder += line.replace("/bin/", "/tools/") + else: + builder += line + new_file = open(f, "w") + new_file.write(builder) + new_file.close() diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index e2949892b..81b30767c 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -7,6 +7,7 @@ set(ENV{PATH} "${OUTPUT_PATH}/qtbase/bin;$ENV{PATH}") find_program(NMAKE nmake) vcpkg_find_acquire_program(JOM) +find_program(PYTHON python) get_filename_component(JOM_EXE_PATH ${JOM} DIRECTORY) set(ENV{PATH} "${JOM_EXE_PATH};$ENV{PATH}") @@ -41,7 +42,11 @@ vcpkg_execute_required_process( -confirm-license -opensource -platform win32-msvc2015 -debug-and-release -force-debug-info ${QT_RUNTIME_LINKAGE} -nomake examples -nomake tests -skip webengine - -prefix "${CURRENT_PACKAGES_DIR}" + -prefix ${CURRENT_PACKAGES_DIR} + -bindir ${CURRENT_PACKAGES_DIR}/bin + -hostbindir ${CURRENT_PACKAGES_DIR}/tools + -archdatadir ${CURRENT_PACKAGES_DIR}/share/qt5 + -datadir ${CURRENT_PACKAGES_DIR}/share/qt5 WORKING_DIRECTORY ${OUTPUT_PATH} LOGNAME configure-${TARGET_TRIPLET} ) @@ -68,7 +73,6 @@ message(STATUS "Packaging ${TARGET_TRIPLET}") file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) @@ -108,7 +112,6 @@ file(REMOVE ${DEBUG_LIB_FILES}) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.prl) file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) foreach(BINARY ${BINARY_TOOLS}) execute_process(COMMAND dumpbin /PDBPATH ${BINARY} COMMAND findstr PDB @@ -124,24 +127,19 @@ foreach(BINARY ${BINARY_TOOLS}) endif() endforeach() file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) -FILE(REMOVE ${BINARY_TOOLS}) +file(REMOVE ${BINARY_TOOLS}) -#if we are using dynamic linkage, the tools also require the dlls and platforms directory to run correctly if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/bin/*.dll") file(INSTALL ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) - file(INSTALL ${CURRENT_PACKAGES_DIR}/plugins/platforms DESTINATION ${CURRENT_PACKAGES_DIR}/tools) -endif() -set(SHARE_PATH ${CURRENT_PACKAGES_DIR}/share/qt5) -file(MAKE_DIRECTORY ${SHARE_PATH}) -file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${SHARE_PATH} RENAME copyright) -file(RENAME ${CURRENT_PACKAGES_DIR}/doc ${SHARE_PATH}/doc) -file(RENAME ${CURRENT_PACKAGES_DIR}/mkspecs ${SHARE_PATH}/mkspecs) -file(RENAME ${CURRENT_PACKAGES_DIR}/phrasebooks ${SHARE_PATH}/phrasebooks) -file(RENAME ${CURRENT_PACKAGES_DIR}/plugins ${SHARE_PATH}/plugins) -file(RENAME ${CURRENT_PACKAGES_DIR}/qml ${SHARE_PATH}/qml) -file(RENAME ${CURRENT_PACKAGES_DIR}/translations ${SHARE_PATH}/translations) -if (EXISTS ${CURRENT_PACKAGES_DIR}/qtvirtualkeyboard) - file(RENAME ${CURRENT_PACKAGES_DIR}/qtvirtualkeyboard ${SHARE_PATH}/qtvirtualkeyboard) endif() + +vcpkg_execute_required_process( + COMMAND ${PYTHON} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/cmake + LOGNAME fix-cmake +) + +file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5 RENAME copyright) + vcpkg_copy_pdbs() -- cgit v1.2.3 From b25c13c1551456dc89ca959c7133b1cc6117532e Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 1 Nov 2016 19:19:05 -0400 Subject: made some qt5 fixes --- ports/qt5/fixcmake.py | 10 +++++++++- ports/qt5/portfile.cmake | 20 +++++++++++++++++--- scripts/buildsystems/vcpkg.cmake | 2 ++ scripts/cmake/vcpkg_find_acquire_program.cmake | 6 ++++++ tests/qt5/CMakeLists.txt | 10 ++++++++++ tests/qt5/main.cpp | 9 +++++++++ 6 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 tests/qt5/CMakeLists.txt create mode 100644 tests/qt5/main.cpp diff --git a/ports/qt5/fixcmake.py b/ports/qt5/fixcmake.py index dbee0ed16..bd37c1e54 100644 --- a/ports/qt5/fixcmake.py +++ b/ports/qt5/fixcmake.py @@ -27,10 +27,18 @@ for f in files: builder += " else()" builder += "\n " + line.replace("/lib/", "/debug/lib/") builder += " endif()\n" + elif "_install_prefix}/lib/qtmaind.lib" in line: + builder += line.replace("/lib/", "/debug/lib/") + 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 exepattern.search(line) != None: builder += line.replace("/bin/", "/tools/") else: builder += line new_file = open(f, "w") new_file.write(builder) - new_file.close() + new_file.close() \ No newline at end of file diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 81b30767c..d1181911b 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -7,9 +7,12 @@ set(ENV{PATH} "${OUTPUT_PATH}/qtbase/bin;$ENV{PATH}") find_program(NMAKE nmake) vcpkg_find_acquire_program(JOM) -find_program(PYTHON python) +vcpkg_find_acquire_program(PERL) +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) +get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY) get_filename_component(JOM_EXE_PATH ${JOM} DIRECTORY) -set(ENV{PATH} "${JOM_EXE_PATH};$ENV{PATH}") +set(ENV{PATH} "${JOM_EXE_PATH};${PYTHON3_EXE_PATH};${PERL_EXE_PATH};$ENV{PATH}") vcpkg_download_distfile(ARCHIVE_FILE URLS "http://download.qt.io/official_releases/qt/5.7/5.7.0/single/qt-everywhere-opensource-src-5.7.0.7z" @@ -112,6 +115,17 @@ file(REMOVE ${DEBUG_LIB_FILES}) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.prl) file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") +file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins") +file(GLOB_RECURSE DEBUG_PLUGINS + "${CURRENT_PACKAGES_DIR}/plugins/*d.dll" + "${CURRENT_PACKAGES_DIR}/plugins/*d.pdb") +foreach(file ${DEBUG_PLUGINS}) + get_filename_component(file_n ${file} NAME) + file(RELATIVE_PATH file_rel "${CURRENT_PACKAGES_DIR}/plugins" ${file}) + get_filename_component(rel_dir ${file_rel} DIRECTORY) + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}") + file(RENAME ${file} "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}/${file_n}") +endforeach() foreach(BINARY ${BINARY_TOOLS}) execute_process(COMMAND dumpbin /PDBPATH ${BINARY} COMMAND findstr PDB @@ -135,7 +149,7 @@ if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) endif() vcpkg_execute_required_process( - COMMAND ${PYTHON} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py + COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/cmake LOGNAME fix-cmake ) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 88acc8436..4f6805457 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -42,12 +42,14 @@ if(NOT VCPKG_TOOLCHAIN) if(OVERRIDE_ADD_EXECUTABLE) function(add_executable name) _add_executable(${ARGV}) + if(NOT "IMPORTED" IN_LIST ARGV) add_custom_command(TARGET ${name} POST_BUILD COMMAND powershell -noprofile -executionpolicy UnRestricted -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 -targetBinary $ -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin" -OutVariable out ) + endif() endfunction() endif() set(VCPKG_TOOLCHAIN ON) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 337cc04a5..633721f0e 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -24,6 +24,12 @@ function(vcpkg_find_acquire_program VAR) set(ARCHIVE "yasm.exe") set(NOEXTRACT ON) set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720) + elseif(VAR MATCHES "PYTHON3") + set(PROGNAME python) + set(PATHS ${DOWNLOADS}/tools/python) + set(URL "https://www.python.org/ftp/python/3.5.2/python-3.5.2-embed-amd64.zip") + set(ARCHIVE "python-3.5.2-embed-amd64.zip") + set(HASH 48bdcb6f94c993acad6782ee33ad4a07a0ea3b9b1bfcdeadf446d459a9224336837e2e7b518d54d8d99c5c3f4e9f8877ea1789cae513fa2eda2a3cad9e4dfd8f) elseif(VAR MATCHES "JOM") set(PROGNAME jom) set(PATHS ${DOWNLOADS}/tools/jom) diff --git a/tests/qt5/CMakeLists.txt b/tests/qt5/CMakeLists.txt new file mode 100644 index 000000000..98667ef11 --- /dev/null +++ b/tests/qt5/CMakeLists.txt @@ -0,0 +1,10 @@ + +cmake_minimum_required(VERSION 3.6) +project(qt5-base-test) +set(CMAKE_AUTOMOC ON) +find_package(Qt5Widgets) +find_package(ZLIB) +find_library(PCRE_LIBRARY NAMES pcre16) +add_executable(test_qt main.cpp) + +target_link_libraries(test_qt Qt5::Widgets ZLIB::ZLIB ${PCRE_LIBRARY}) \ No newline at end of file diff --git a/tests/qt5/main.cpp b/tests/qt5/main.cpp new file mode 100644 index 000000000..cec294069 --- /dev/null +++ b/tests/qt5/main.cpp @@ -0,0 +1,9 @@ +#include +#include +#include +int main(int argc, char** argv) { + auto buildABI = QSysInfo::buildAbi().toStdString(); + fprintf(stdout, "%s\n", buildABI.c_str()); + printf("%d\n", QSysInfo::windowsVersion()); + return 0; +} \ No newline at end of file -- cgit v1.2.3 From 8d7212aa09dab3175be224d81073e36a1f2e5798 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Wed, 2 Nov 2016 18:49:41 +1100 Subject: remove extra dependencies --- tests/qt5/CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/qt5/CMakeLists.txt b/tests/qt5/CMakeLists.txt index 98667ef11..777b37c01 100644 --- a/tests/qt5/CMakeLists.txt +++ b/tests/qt5/CMakeLists.txt @@ -1,10 +1,8 @@ -cmake_minimum_required(VERSION 3.6) +cmake_minimum_required(VERSION 3.2) project(qt5-base-test) set(CMAKE_AUTOMOC ON) find_package(Qt5Widgets) -find_package(ZLIB) -find_library(PCRE_LIBRARY NAMES pcre16) add_executable(test_qt main.cpp) -target_link_libraries(test_qt Qt5::Widgets ZLIB::ZLIB ${PCRE_LIBRARY}) \ No newline at end of file +target_link_libraries(test_qt Qt5::Widgets) -- cgit v1.2.3 From 355d79ea4098834634606f3eca65d1261474f0d9 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 7 Nov 2016 23:25:20 +1100 Subject: remove tests from base repository --- tests/qt5/CMakeLists.txt | 8 -------- tests/qt5/main.cpp | 9 --------- 2 files changed, 17 deletions(-) delete mode 100644 tests/qt5/CMakeLists.txt delete mode 100644 tests/qt5/main.cpp diff --git a/tests/qt5/CMakeLists.txt b/tests/qt5/CMakeLists.txt deleted file mode 100644 index 777b37c01..000000000 --- a/tests/qt5/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ - -cmake_minimum_required(VERSION 3.2) -project(qt5-base-test) -set(CMAKE_AUTOMOC ON) -find_package(Qt5Widgets) -add_executable(test_qt main.cpp) - -target_link_libraries(test_qt Qt5::Widgets) diff --git a/tests/qt5/main.cpp b/tests/qt5/main.cpp deleted file mode 100644 index cec294069..000000000 --- a/tests/qt5/main.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#include -int main(int argc, char** argv) { - auto buildABI = QSysInfo::buildAbi().toStdString(); - fprintf(stdout, "%s\n", buildABI.c_str()); - printf("%d\n", QSysInfo::windowsVersion()); - return 0; -} \ No newline at end of file -- cgit v1.2.3 From 5e058c21928de5092242cb6e0c590c3a2d758c6c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 7 Nov 2016 21:35:08 -0800 Subject: [qt5] Don't copy PDBs for tools. Skip plugins directory (it's empty?). --- ports/qt5/portfile.cmake | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index d1181911b..f65bee4ba 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -115,31 +115,7 @@ file(REMOVE ${DEBUG_LIB_FILES}) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.lib ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Gamepad.prl ${CURRENT_PACKAGES_DIR}/lib/Qt5Gamepad.prl) file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*.exe") -file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins") -file(GLOB_RECURSE DEBUG_PLUGINS - "${CURRENT_PACKAGES_DIR}/plugins/*d.dll" - "${CURRENT_PACKAGES_DIR}/plugins/*d.pdb") -foreach(file ${DEBUG_PLUGINS}) - get_filename_component(file_n ${file} NAME) - file(RELATIVE_PATH file_rel "${CURRENT_PACKAGES_DIR}/plugins" ${file}) - get_filename_component(rel_dir ${file_rel} DIRECTORY) - file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}") - file(RENAME ${file} "${CURRENT_PACKAGES_DIR}/debug/plugins/${rel_dir}/${file_n}") -endforeach() -foreach(BINARY ${BINARY_TOOLS}) - execute_process(COMMAND dumpbin /PDBPATH ${BINARY} - COMMAND findstr PDB - OUTPUT_VARIABLE PDB_LINE - ERROR_QUIET - RESULT_VARIABLE error_code - ) - if(NOT error_code AND PDB_LINE MATCHES "PDB file found at") - string(REGEX MATCH '.*' PDB_PATH ${PDB_LINE}) # Extract the path which is in single quotes - string(REPLACE ' "" PDB_PATH ${PDB_PATH}) # Remove single quotes - file(INSTALL ${PDB_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) - file(REMOVE ${PDB_PATH}) - endif() -endforeach() + file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) file(REMOVE ${BINARY_TOOLS}) -- cgit v1.2.3