Add option VCPKG_QMAKE_USE_NMAKE in vcpkg_build_qmake and install_qt (#8524)

* add option PREFER_NMAKE to vcpkg_build_qmake and install_qt.

* Add /MP to qt5-base/vcpkg_build_qmake.

* use VCPKG_QMAKE_USE_NMAKE instead of as function parameter.

* Update ports/qt5-base/cmake/install_qt.cmake

* Update scripts/cmake/vcpkg_build_qmake.cmake

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
Jack·Boos·Yu 2020-11-23 15:26:01 -08:00 committed by GitHub
parent 820ad09d6d
commit 5cd25eee5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 14 deletions

View File

@ -1,9 +1,9 @@
Source: qt5-base
Version: 5.15.1
Port-Version: 1
Homepage: https://www.qt.io/
Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.
Build-Depends: zlib, zstd, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl, angle (!windows), egl-registry, icu (!uwp), fontconfig (!windows)
Feature: latest
Description: Build latest qt version (5.15.1) instead of LTS (latest and LTS are currently the same)
Source: qt5-base
Version: 5.15.1
Port-Version: 2
Homepage: https://www.qt.io/
Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.
Build-Depends: zlib, zstd, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl, angle (!windows), egl-registry, icu (!uwp), fontconfig (!windows)
Feature: latest
Description: Build latest qt version (5.15.1) instead of LTS (latest and LTS are currently the same)

View File

@ -2,9 +2,19 @@ include(qt_fix_makefile_install)
function(install_qt)
if(CMAKE_HOST_WIN32)
vcpkg_find_acquire_program(JOM)
set(INVOKE "${JOM}" /J ${VCPKG_CONCURRENCY})
set(INVOKE_SINGLE "${JOM}" /J 1)
if (VCPKG_QMAKE_USE_NMAKE)
find_program(NMAKE nmake REQUIRED)
set(INVOKE "${NMAKE}")
set(INVOKE_SINGLE "${NMAKE}")
get_filename_component(NMAKE_EXE_PATH ${NMAKE} DIRECTORY)
set(PATH_GLOBAL "$ENV{PATH}")
set(ENV{PATH} "$ENV{PATH};${NMAKE_EXE_PATH}")
set(ENV{CL} "$ENV{CL} /MP${VCPKG_CONCURRENCY}")
else()
vcpkg_find_acquire_program(JOM)
set(INVOKE "${JOM}" /J ${VCPKG_CONCURRENCY})
set(INVOKE_SINGLE "${JOM}" /J 1)
endif()
else()
find_program(MAKE make)
set(INVOKE "${MAKE}" -j${VCPKG_CONCURRENCY})

View File

@ -11,8 +11,17 @@ function(vcpkg_build_qmake)
cmake_parse_arguments(PARSE_ARGV 0 _csc "SKIP_MAKEFILES" "BUILD_LOGNAME" "TARGETS;RELEASE_TARGETS;DEBUG_TARGETS")
if(CMAKE_HOST_WIN32)
vcpkg_find_acquire_program(JOM)
set(INVOKE "${JOM}")
if (VCPKG_QMAKE_USE_NMAKE)
find_program(NMAKE nmake)
set(INVOKE "${NMAKE}")
get_filename_component(NMAKE_EXE_PATH ${NMAKE} DIRECTORY)
set(PATH_GLOBAL "$ENV{PATH}")
set(ENV{PATH} "$ENV{PATH};${NMAKE_EXE_PATH}")
set(ENV{CL} "$ENV{CL} /MP${VCPKG_CONCURRENCY}")
else()
vcpkg_find_acquire_program(JOM)
set(INVOKE "${JOM}")
endif()
else()
find_program(MAKE make)
set(INVOKE "${MAKE}")