mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-19 02:33:02 +08:00
[scripts-audit] QMake buildsystem (#20322)
* [scripts-audit] QMake buildsystem * Apply suggestions * Change qt5-base as a host port * version * Fix installation * Apply suggestions * Update doc * Typo * update doc * Fix bug * fix vcpkg_host_path_list issue * Process more host path * Apply suggestions * Apply suggestions * Apply suggestions from code review * more changes * Apply suggestions Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com> Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
This commit is contained in:
parent
297f1b8ea0
commit
66c39e113a
@ -10,6 +10,9 @@ vcpkg_configure_qmake(
|
|||||||
[OPTIONS arg1 [arg2 ...]]
|
[OPTIONS arg1 [arg2 ...]]
|
||||||
[OPTIONS_RELEASE arg1 [arg2 ...]]
|
[OPTIONS_RELEASE arg1 [arg2 ...]]
|
||||||
[OPTIONS_DEBUG arg1 [arg2 ...]]
|
[OPTIONS_DEBUG arg1 [arg2 ...]]
|
||||||
|
[BUILD_OPTIONS arg1 [arg2 ...]]
|
||||||
|
[BUILD_OPTIONS_RELEASE arg1 [arg2 ...]]
|
||||||
|
[BUILD_OPTIONS_DEBUG arg1 [arg2 ...]]
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -17,7 +20,10 @@ vcpkg_configure_qmake(
|
|||||||
The path to the *.pro qmake project file.
|
The path to the *.pro qmake project file.
|
||||||
|
|
||||||
### OPTIONS, OPTIONS\_RELEASE, OPTIONS\_DEBUG
|
### OPTIONS, OPTIONS\_RELEASE, OPTIONS\_DEBUG
|
||||||
The options passed to qmake.
|
The options passed to qmake to the configure step.
|
||||||
|
|
||||||
|
### BUILD\_OPTIONS, BUILD\_OPTIONS\_RELEASE, BUILD\_OPTIONS\_DEBUG
|
||||||
|
The options passed to qmake to the build step.
|
||||||
|
|
||||||
## Source
|
## Source
|
||||||
[scripts/cmake/vcpkg\_configure\_qmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_qmake.cmake)
|
[scripts/cmake/vcpkg\_configure\_qmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_qmake.cmake)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "qt5-base",
|
"name": "qt5-base",
|
||||||
"version-semver": "5.15.2",
|
"version-semver": "5.15.2",
|
||||||
"port-version": 11,
|
"port-version": 12,
|
||||||
"description": "Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.",
|
"description": "Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.",
|
||||||
"homepage": "https://www.qt.io/",
|
"homepage": "https://www.qt.io/",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
@ -25,6 +25,11 @@
|
|||||||
"libpng",
|
"libpng",
|
||||||
"openssl",
|
"openssl",
|
||||||
"pcre2",
|
"pcre2",
|
||||||
|
{
|
||||||
|
"name": "qt5-base",
|
||||||
|
"host": true,
|
||||||
|
"default-features": false
|
||||||
|
},
|
||||||
"sqlite3",
|
"sqlite3",
|
||||||
{
|
{
|
||||||
"name": "vcpkg-pkgconfig-get-modules",
|
"name": "vcpkg-pkgconfig-get-modules",
|
||||||
|
@ -8,102 +8,79 @@ vcpkg_build_qmake()
|
|||||||
```
|
```
|
||||||
#]===]
|
#]===]
|
||||||
|
|
||||||
|
function(z_run_jom_build invoke_command targets log_prefix log_suffix)
|
||||||
|
message(STATUS "Package ${log_prefix}-${TARGET_TRIPLET}-${log_suffix}")
|
||||||
|
vcpkg_execute_build_process(
|
||||||
|
COMMAND "${invoke_command}" -j ${VCPKG_CONCURRENCY} ${targets}
|
||||||
|
NO_PARALLEL_COMMAND "${invoke_command}" -j 1 ${targets}
|
||||||
|
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${log_suffix}"
|
||||||
|
LOGNAME "package-${log_prefix}-${TARGET_TRIPLET}-${log_suffix}"
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
function(vcpkg_build_qmake)
|
function(vcpkg_build_qmake)
|
||||||
# parse parameters such that semicolons in options arguments to COMMAND don't get erased
|
# parse parameters such that semicolons in options arguments to COMMAND don't get erased
|
||||||
cmake_parse_arguments(PARSE_ARGV 0 _csc "SKIP_MAKEFILES" "BUILD_LOGNAME" "TARGETS;RELEASE_TARGETS;DEBUG_TARGETS")
|
cmake_parse_arguments(PARSE_ARGV 0 arg
|
||||||
|
"SKIP_MAKEFILES"
|
||||||
|
"BUILD_LOGNAME"
|
||||||
|
"TARGETS;RELEASE_TARGETS;DEBUG_TARGETS"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Make sure that the linker finds the libraries used
|
||||||
|
vcpkg_backup_env_variables(VARS PATH LD_LIBRARY_PATH CL _CL_)
|
||||||
|
|
||||||
|
# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings
|
||||||
|
set(ENV{_CL_} "/utf-8")
|
||||||
|
|
||||||
if(CMAKE_HOST_WIN32)
|
if(CMAKE_HOST_WIN32)
|
||||||
if (VCPKG_QMAKE_USE_NMAKE)
|
if (VCPKG_QMAKE_USE_NMAKE)
|
||||||
find_program(NMAKE nmake)
|
find_program(NMAKE nmake)
|
||||||
set(INVOKE "${NMAKE}")
|
set(invoke_command "${NMAKE}")
|
||||||
get_filename_component(NMAKE_EXE_PATH ${NMAKE} DIRECTORY)
|
get_filename_component(nmake_exe_path "${NMAKE}" DIRECTORY)
|
||||||
set(PATH_GLOBAL "$ENV{PATH}")
|
vcpkg_host_path_list(APPEND ENV{PATH} "${nmake_exe_path}")
|
||||||
set(ENV{PATH} "$ENV{PATH};${NMAKE_EXE_PATH}")
|
|
||||||
set(ENV{CL} "$ENV{CL} /MP${VCPKG_CONCURRENCY}")
|
set(ENV{CL} "$ENV{CL} /MP${VCPKG_CONCURRENCY}")
|
||||||
else()
|
else()
|
||||||
vcpkg_find_acquire_program(JOM)
|
vcpkg_find_acquire_program(JOM)
|
||||||
set(INVOKE "${JOM}")
|
set(invoke_command "${JOM}")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
find_program(MAKE make)
|
find_program(MAKE make)
|
||||||
set(INVOKE "${MAKE}")
|
set(invoke_command "${MAKE}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Make sure that the linker finds the libraries used
|
|
||||||
set(ENV_PATH_BACKUP "$ENV{PATH}")
|
|
||||||
|
|
||||||
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR)
|
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR)
|
||||||
|
|
||||||
if(NOT _csc_BUILD_LOGNAME)
|
if(NOT DEFINED arg_BUILD_LOGNAME)
|
||||||
set(_csc_BUILD_LOGNAME build)
|
set(arg_BUILD_LOGNAME build)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(run_jom TARGETS LOG_PREFIX LOG_SUFFIX)
|
set(short_name_debug "dbg")
|
||||||
message(STATUS "Package ${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX}")
|
set(path_suffix_debug "/debug")
|
||||||
vcpkg_execute_build_process(
|
set(targets_debug "${arg_DEBUG_TARGETS}")
|
||||||
COMMAND ${INVOKE} -j ${VCPKG_CONCURRENCY} ${TARGETS}
|
|
||||||
NO_PARALLEL_COMMAND ${INVOKE} -j 1 ${TARGETS}
|
|
||||||
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${LOG_SUFFIX}
|
|
||||||
LOGNAME package-${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX}
|
|
||||||
)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings
|
set(short_name_release "rel")
|
||||||
set(ENV_CL_BACKUP "$ENV{_CL_}")
|
set(path_suffix_release "")
|
||||||
set(ENV{_CL_} "/utf-8")
|
set(targets_release "${arg_RELEASE_TARGETS}")
|
||||||
|
|
||||||
#Replace with VCPKG variables if PR #7733 is merged
|
foreach(build_type IN ITEMS debug release)
|
||||||
unset(BUILDTYPES)
|
set(current_installed_prefix "${CURRENT_INSTALLED_DIR}${path_suffix_${build_type}}")
|
||||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
||||||
set(_buildname "DEBUG")
|
|
||||||
list(APPEND BUILDTYPES ${_buildname})
|
|
||||||
set(_short_name_${_buildname} "dbg")
|
|
||||||
set(_path_suffix_${_buildname} "/debug")
|
|
||||||
endif()
|
|
||||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
||||||
set(_buildname "RELEASE")
|
|
||||||
list(APPEND BUILDTYPES ${_buildname})
|
|
||||||
set(_short_name_${_buildname} "rel")
|
|
||||||
set(_path_suffix_${_buildname} "")
|
|
||||||
endif()
|
|
||||||
unset(_buildname)
|
|
||||||
|
|
||||||
foreach(_buildname ${BUILDTYPES})
|
vcpkg_add_to_path(PREPEND "${current_installed_prefix}/lib" "${current_installed_prefix}/bin")
|
||||||
set(_installed_prefix_ "${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}")
|
|
||||||
set(_installed_libpath_ "${_installed_prefix_}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_installed_prefix_}/lib/manual-link/")
|
|
||||||
|
|
||||||
vcpkg_add_to_path(PREPEND "${_installed_prefix_}/bin")
|
|
||||||
vcpkg_add_to_path(PREPEND "${_installed_prefix_}/lib")
|
|
||||||
|
|
||||||
# We set LD_LIBRARY_PATH ENV variable to allow executing Qt tools (rcc,...) even with dynamic linking
|
# We set LD_LIBRARY_PATH ENV variable to allow executing Qt tools (rcc,...) even with dynamic linking
|
||||||
if(CMAKE_HOST_UNIX)
|
if(CMAKE_HOST_UNIX)
|
||||||
if(DEFINED ENV{LD_LIBRARY_PATH})
|
set(ENV{LD_LIBRARY_PATH} "")
|
||||||
set(_ld_library_path_defined_ TRUE)
|
vcpkg_host_path_list(APPEND ENV{LD_LIBRARY_PATH} "${current_installed_prefix}/lib" "${current_installed_prefix}/lib/manual-link")
|
||||||
set(_ld_library_path_backup_ $ENV{LD_LIBRARY_PATH})
|
|
||||||
set(ENV{LD_LIBRARY_PATH} "${_installed_libpath_}${VCPKG_HOST_PATH_SEPARATOR}${_ld_library_path_backup_}")
|
|
||||||
else()
|
|
||||||
set(_ld_library_path_defined_ FALSE)
|
|
||||||
set(ENV{LD_LIBRARY_PATH} "${_installed_libpath_}")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND _csc_${_buildname}_TARGETS ${_csc_TARGETS})
|
|
||||||
if(NOT _csc_SKIP_MAKEFILES)
|
|
||||||
run_jom(qmake_all makefiles ${_short_name_${_buildname}})
|
|
||||||
endif()
|
|
||||||
run_jom("${_csc_${_buildname}_TARGETS}" ${_csc_BUILD_LOGNAME} ${_short_name_${_buildname}})
|
|
||||||
|
|
||||||
# Restore backup
|
vcpkg_list(SET targets ${targets_${build_type}} ${arg_TARGETS})
|
||||||
if(CMAKE_HOST_UNIX)
|
if(NOT arg_SKIP_MAKEFILES)
|
||||||
if(_ld_library_path_defined_)
|
z_run_jom_build("${invoke_command}" qmake_all makefiles "${short_name_${build_type}}")
|
||||||
set(ENV{LD_LIBRARY_PATH} "${_ld_library_path_backup_}")
|
|
||||||
else()
|
|
||||||
unset(ENV{LD_LIBRARY_PATH})
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
z_run_jom_build("${invoke_command}" "${targets}" "${arg_BUILD_LOGNAME}" "${short_name_${build_type}}")
|
||||||
|
|
||||||
|
vcpkg_restore_env_variables(VARS PATH LD_LIBRARY_PATH)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# Restore the original value of ENV{PATH}
|
vcpkg_restore_env_variables(VARS CL _CL_)
|
||||||
set(ENV{PATH} "${ENV_PATH_BACKUP}")
|
|
||||||
set(ENV{_CL_} "${ENV_CL_BACKUP}")
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@ -9,6 +9,9 @@ vcpkg_configure_qmake(
|
|||||||
[OPTIONS arg1 [arg2 ...]]
|
[OPTIONS arg1 [arg2 ...]]
|
||||||
[OPTIONS_RELEASE arg1 [arg2 ...]]
|
[OPTIONS_RELEASE arg1 [arg2 ...]]
|
||||||
[OPTIONS_DEBUG arg1 [arg2 ...]]
|
[OPTIONS_DEBUG arg1 [arg2 ...]]
|
||||||
|
[BUILD_OPTIONS arg1 [arg2 ...]]
|
||||||
|
[BUILD_OPTIONS_RELEASE arg1 [arg2 ...]]
|
||||||
|
[BUILD_OPTIONS_DEBUG arg1 [arg2 ...]]
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -16,118 +19,121 @@ vcpkg_configure_qmake(
|
|||||||
The path to the *.pro qmake project file.
|
The path to the *.pro qmake project file.
|
||||||
|
|
||||||
### OPTIONS, OPTIONS\_RELEASE, OPTIONS\_DEBUG
|
### OPTIONS, OPTIONS\_RELEASE, OPTIONS\_DEBUG
|
||||||
The options passed to qmake.
|
The options passed to qmake to the configure step.
|
||||||
|
|
||||||
|
### BUILD\_OPTIONS, BUILD\_OPTIONS\_RELEASE, BUILD\_OPTIONS\_DEBUG
|
||||||
|
The options passed to qmake to the build step.
|
||||||
#]===]
|
#]===]
|
||||||
|
|
||||||
function(vcpkg_configure_qmake)
|
function(vcpkg_configure_qmake)
|
||||||
# parse parameters such that semicolons in options arguments to COMMAND don't get erased
|
# parse parameters such that semicolons in options arguments to COMMAND don't get erased
|
||||||
cmake_parse_arguments(PARSE_ARGV 0 _csc "" "SOURCE_PATH" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG;BUILD_OPTIONS;BUILD_OPTIONS_RELEASE;BUILD_OPTIONS_DEBUG")
|
cmake_parse_arguments(PARSE_ARGV 0 arg
|
||||||
|
""
|
||||||
# Find qmake executable
|
"SOURCE_PATH"
|
||||||
set(_triplet_hostbindir ${CURRENT_INSTALLED_DIR}/tools/qt5/bin)
|
"OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG;BUILD_OPTIONS;BUILD_OPTIONS_RELEASE;BUILD_OPTIONS_DEBUG"
|
||||||
if(DEFINED VCPKG_QT_HOST_TOOLS_ROOT_DIR)
|
)
|
||||||
find_program(QMAKE_COMMAND NAMES qmake PATHS ${VCPKG_QT_HOST_TOOLS_ROOT_DIR}/bin ${_triplet_hostbindir} NO_DEFAULT_PATH)
|
|
||||||
else()
|
|
||||||
find_program(QMAKE_COMMAND NAMES qmake PATHS ${_triplet_hostbindir} NO_DEFAULT_PATH)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT QMAKE_COMMAND)
|
# Find qmake executable
|
||||||
|
find_program(qmake_executable NAMES qmake PATHS "${CURRENT_HOST_INSTALLED_DIR}/tools/qt5/bin" NO_DEFAULT_PATH)
|
||||||
|
|
||||||
|
if(NOT qmake_executable)
|
||||||
message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.")
|
message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||||
list(APPEND _csc_OPTIONS "CONFIG-=shared")
|
vcpkg_list(APPEND arg_OPTIONS "CONFIG-=shared" "CONFIG*=static")
|
||||||
list(APPEND _csc_OPTIONS "CONFIG*=static")
|
|
||||||
else()
|
else()
|
||||||
list(APPEND _csc_OPTIONS "CONFIG-=static")
|
vcpkg_list(APPEND arg_OPTIONS "CONFIG-=static" "CONFIG*=shared")
|
||||||
list(APPEND _csc_OPTIONS "CONFIG*=shared")
|
vcpkg_list(APPEND arg_OPTIONS_DEBUG "CONFIG*=separate_debug_info")
|
||||||
list(APPEND _csc_OPTIONS_DEBUG "CONFIG*=separate_debug_info")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_CRT_LINKAGE STREQUAL "static")
|
|
||||||
list(APPEND _csc_OPTIONS "CONFIG*=static-runtime")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Cleanup build directories
|
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_CRT_LINKAGE STREQUAL "static")
|
||||||
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
|
vcpkg_list(APPEND arg_OPTIONS "CONFIG*=static-runtime")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(DEFINED VCPKG_OSX_DEPLOYMENT_TARGET)
|
if(DEFINED VCPKG_OSX_DEPLOYMENT_TARGET)
|
||||||
set(ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET} ${VCPKG_OSX_DEPLOYMENT_TARGET})
|
set(ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET} ${VCPKG_OSX_DEPLOYMENT_TARGET})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
vcpkg_backup_env_variables(VARS PKG_CONFIG_PATH)
|
||||||
|
|
||||||
vcpkg_find_acquire_program(PKGCONFIG)
|
vcpkg_find_acquire_program(PKGCONFIG)
|
||||||
set(ENV{PKG_CONFIG} "${PKGCONFIG}")
|
set(ENV{PKG_CONFIG} "${PKGCONFIG}")
|
||||||
get_filename_component(PKGCONFIG_PATH "${PKGCONFIG}" DIRECTORY)
|
get_filename_component(PKGCONFIG_PATH "${PKGCONFIG}" DIRECTORY)
|
||||||
vcpkg_add_to_path("${PKGCONFIG_PATH}")
|
vcpkg_add_to_path("${PKGCONFIG_PATH}")
|
||||||
|
|
||||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
||||||
set(_config RELEASE)
|
vcpkg_host_path_list(PREPEND ENV{PKG_CONFIG_PATH}
|
||||||
set(PKGCONFIG_INSTALLED_DIR "${_VCPKG_INSTALLED_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig")
|
"${CURRENT_INSTALLED_DIR}/lib/pkgconfig"
|
||||||
set(PKGCONFIG_INSTALLED_SHARE_DIR "${_VCPKG_INSTALLED_PKGCONF}/share/pkgconfig")
|
"${CURRENT_INSTALLED_DIR}/share/pkgconfig"
|
||||||
set(PKGCONFIG_PACKAGES_DIR "${_VCPKG_PACKAGES_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig")
|
"${CURRENT_PACKAGES_DIR}/lib/pkgconfig"
|
||||||
set(PKGCONFIG_PACKAGES_SHARE_DIR "${_VCPKG_PACKAGES_PKGCONF}/share/pkgconfig")
|
"${CURRENT_PACKAGES_DIR}/share/pkgconfig")
|
||||||
if(DEFINED ENV{PKG_CONFIG_PATH})
|
|
||||||
set(BACKUP_ENV_PKG_CONFIG_PATH_${_config} $ENV{PKG_CONFIG_PATH})
|
|
||||||
set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}")
|
|
||||||
else()
|
|
||||||
set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_release.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf)
|
set(current_binary_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
|
||||||
|
|
||||||
|
# Cleanup build directories
|
||||||
|
file(REMOVE_RECURSE "${current_binary_dir}")
|
||||||
|
|
||||||
|
configure_file("${CURRENT_INSTALLED_DIR}/tools/qt5/qt_release.conf" "${current_binary_dir}/qt.conf")
|
||||||
|
|
||||||
message(STATUS "Configuring ${TARGET_TRIPLET}-rel")
|
message(STATUS "Configuring ${TARGET_TRIPLET}-rel")
|
||||||
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
|
file(MAKE_DIRECTORY "${current_binary_dir}")
|
||||||
if(DEFINED _csc_BUILD_OPTIONS OR DEFINED _csc_BUILD_OPTIONS_RELEASE)
|
|
||||||
set(BUILD_OPT -- ${_csc_BUILD_OPTIONS} ${_csc_BUILD_OPTIONS_RELEASE})
|
vcpkg_list(SET build_opt_param)
|
||||||
|
if(DEFINED arg_BUILD_OPTIONS OR DEFINED arg_BUILD_OPTIONS_RELEASE)
|
||||||
|
vcpkg_list(SET build_opt_param -- ${arg_BUILD_OPTIONS} ${arg_BUILD_OPTIONS_RELEASE})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
vcpkg_execute_required_process(
|
vcpkg_execute_required_process(
|
||||||
COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release
|
COMMAND "${qmake_executable}" CONFIG-=debug CONFIG+=release
|
||||||
${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} ${_csc_SOURCE_PATH}
|
${arg_OPTIONS} ${arg_OPTIONS_RELEASE} ${arg_SOURCE_PATH}
|
||||||
-qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf"
|
-qtconf "${current_binary_dir}/qt.conf"
|
||||||
${BUILD_OPT}
|
${build_opt_param}
|
||||||
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
|
WORKING_DIRECTORY "${current_binary_dir}"
|
||||||
LOGNAME config-${TARGET_TRIPLET}-rel
|
LOGNAME "config-${TARGET_TRIPLET}-rel"
|
||||||
)
|
)
|
||||||
message(STATUS "Configuring ${TARGET_TRIPLET}-rel done")
|
message(STATUS "Configuring ${TARGET_TRIPLET}-rel done")
|
||||||
if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/config.log")
|
if(EXISTS "${current_binary_dir}/config.log")
|
||||||
file(REMOVE "${CURRENT_BUILDTREES_DIR}/internal-config-${TARGET_TRIPLET}-rel.log")
|
file(REMOVE "${CURRENT_BUILDTREES_DIR}/internal-config-${TARGET_TRIPLET}-rel.log")
|
||||||
file(RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/config.log" "${CURRENT_BUILDTREES_DIR}/internal-config-${TARGET_TRIPLET}-rel.log")
|
file(RENAME "${current_binary_dir}/config.log" "${CURRENT_BUILDTREES_DIR}/internal-config-${TARGET_TRIPLET}-rel.log")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
vcpkg_restore_env_variables(VARS PKG_CONFIG_PATH)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
||||||
set(_config DEBUG)
|
vcpkg_host_path_list(PREPEND ENV{PKG_CONFIG_PATH}
|
||||||
set(PATH_SUFFIX_DEBUG /debug)
|
"${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig"
|
||||||
set(PKGCONFIG_INSTALLED_DIR "${_VCPKG_INSTALLED_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig")
|
"${CURRENT_INSTALLED_DIR}/share/pkgconfig"
|
||||||
set(PKGCONFIG_INSTALLED_SHARE_DIR "${_VCPKG_INSTALLED_PKGCONF}/share/pkgconfig")
|
"${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig"
|
||||||
set(PKGCONFIG_PACKAGES_DIR "${_VCPKG_PACKAGES_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig")
|
"${CURRENT_PACKAGES_DIR}/share/pkgconfig")
|
||||||
set(PKGCONFIG_PACKAGES_SHARE_DIR "${_VCPKG_PACKAGES_PKGCONF}/share/pkgconfig")
|
|
||||||
if(DEFINED ENV{PKG_CONFIG_PATH})
|
|
||||||
set(BACKUP_ENV_PKG_CONFIG_PATH_${_config} $ENV{PKG_CONFIG_PATH})
|
|
||||||
set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}")
|
|
||||||
else()
|
|
||||||
set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_debug.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/qt.conf)
|
set(current_binary_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
|
||||||
|
|
||||||
|
# Cleanup build directories
|
||||||
|
file(REMOVE_RECURSE "${current_binary_dir}")
|
||||||
|
|
||||||
|
configure_file("${CURRENT_INSTALLED_DIR}/tools/qt5/qt_debug.conf" "${current_binary_dir}/qt.conf")
|
||||||
|
|
||||||
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg")
|
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg")
|
||||||
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
|
file(MAKE_DIRECTORY "${current_binary_dir}")
|
||||||
if(DEFINED _csc_BUILD_OPTIONS OR DEFINED _csc_BUILD_OPTIONS_DEBUG)
|
|
||||||
set(BUILD_OPT -- ${_csc_BUILD_OPTIONS} ${_csc_BUILD_OPTIONS_DEBUG})
|
vcpkg_list(SET build_opt_param)
|
||||||
|
if(DEFINED arg_BUILD_OPTIONS OR DEFINED arg_BUILD_OPTIONS_DEBUG)
|
||||||
|
vcpkg_list(SET build_opt_param -- ${arg_BUILD_OPTIONS} ${arg_BUILD_OPTIONS_DEBUG})
|
||||||
endif()
|
endif()
|
||||||
vcpkg_execute_required_process(
|
vcpkg_execute_required_process(
|
||||||
COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug
|
COMMAND "${qmake_executable}" CONFIG-=release CONFIG+=debug
|
||||||
${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} ${_csc_SOURCE_PATH}
|
${arg_OPTIONS} ${arg_OPTIONS_DEBUG} ${arg_SOURCE_PATH}
|
||||||
-qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/qt.conf"
|
-qtconf "${current_binary_dir}/qt.conf"
|
||||||
${BUILD_OPT}
|
${build_opt_param}
|
||||||
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
|
WORKING_DIRECTORY "${current_binary_dir}"
|
||||||
LOGNAME config-${TARGET_TRIPLET}-dbg
|
LOGNAME "config-${TARGET_TRIPLET}-dbg"
|
||||||
)
|
)
|
||||||
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done")
|
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done")
|
||||||
if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/config.log")
|
if(EXISTS "${current_binary_dir}/config.log")
|
||||||
file(REMOVE "${CURRENT_BUILDTREES_DIR}/internal-config-${TARGET_TRIPLET}-dbg.log")
|
file(REMOVE "${CURRENT_BUILDTREES_DIR}/internal-config-${TARGET_TRIPLET}-dbg.log")
|
||||||
file(RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/config.log" "${CURRENT_BUILDTREES_DIR}/internal-config-${TARGET_TRIPLET}-dbg.log")
|
file(RENAME "${current_binary_dir}/config.log" "${CURRENT_BUILDTREES_DIR}/internal-config-${TARGET_TRIPLET}-dbg.log")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -23,44 +23,47 @@ staging directories.
|
|||||||
#]===]
|
#]===]
|
||||||
|
|
||||||
function(vcpkg_install_qmake)
|
function(vcpkg_install_qmake)
|
||||||
vcpkg_build_qmake(${ARGN})
|
z_vcpkg_function_arguments(args)
|
||||||
file(GLOB_RECURSE RELEASE_LIBS
|
|
||||||
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.lib
|
vcpkg_build_qmake(${args})
|
||||||
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.a
|
|
||||||
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.so
|
file(GLOB_RECURSE release_libs
|
||||||
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.so.*
|
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.lib"
|
||||||
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.dylib
|
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.a"
|
||||||
|
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.so"
|
||||||
|
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.so.*"
|
||||||
|
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.dylib"
|
||||||
)
|
)
|
||||||
file(GLOB_RECURSE RELEASE_BINS
|
file(GLOB_RECURSE release_bins
|
||||||
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.dll
|
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.dll"
|
||||||
)
|
)
|
||||||
file(GLOB_RECURSE DEBUG_LIBS
|
file(GLOB_RECURSE debug_libs
|
||||||
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.lib
|
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.lib"
|
||||||
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.a
|
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.a"
|
||||||
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.so
|
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.so"
|
||||||
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.so.*
|
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.so.*"
|
||||||
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.dylib
|
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.dylib"
|
||||||
)
|
)
|
||||||
file(GLOB_RECURSE DEBUG_BINS
|
file(GLOB_RECURSE debug_bins
|
||||||
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.dll
|
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.dll"
|
||||||
)
|
)
|
||||||
if(NOT RELEASE_LIBS AND NOT DEBUG_LIBS)
|
if("${release_libs}" STREQUAL "" AND "${debug_libs}" STREQUAL "")
|
||||||
message(FATAL_ERROR "Build did not appear to produce any libraries. If this is intended, use `vcpkg_build_qmake()` directly.")
|
message(FATAL_ERROR "Build did not appear to produce any libraries. If this is intended, use `vcpkg_build_qmake()` directly.")
|
||||||
endif()
|
endif()
|
||||||
if(RELEASE_LIBS)
|
if(NOT "${release_libs}" STREQUAL "")
|
||||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib)
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib")
|
||||||
file(COPY ${RELEASE_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
|
file(COPY ${release_libs} DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
||||||
endif()
|
endif()
|
||||||
if(DEBUG_LIBS)
|
if(NOT "${debug_libs}" STREQUAL "")
|
||||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib)
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib")
|
||||||
file(COPY ${DEBUG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
|
file(COPY ${debug_libs} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
||||||
endif()
|
endif()
|
||||||
if(RELEASE_BINS)
|
if(NOT "${release_bins}" STREQUAL "")
|
||||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")
|
||||||
file(COPY ${RELEASE_BINS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
|
file(COPY ${release_bins} DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
|
||||||
endif()
|
endif()
|
||||||
if(DEBUG_BINS)
|
if(NOT "${debug_bins}" STREQUAL "")
|
||||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")
|
||||||
file(COPY ${DEBUG_BINS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
|
file(COPY ${debug_bins} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@ -5462,7 +5462,7 @@
|
|||||||
},
|
},
|
||||||
"qt5-base": {
|
"qt5-base": {
|
||||||
"baseline": "5.15.2",
|
"baseline": "5.15.2",
|
||||||
"port-version": 11
|
"port-version": 12
|
||||||
},
|
},
|
||||||
"qt5-canvas3d": {
|
"qt5-canvas3d": {
|
||||||
"baseline": "0",
|
"baseline": "0",
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"versions": [
|
"versions": [
|
||||||
|
{
|
||||||
|
"git-tree": "9a65e1b0d631a1c2879d566140c11d634601fca6",
|
||||||
|
"version-semver": "5.15.2",
|
||||||
|
"port-version": 12
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"git-tree": "72ca286ac98e08f2fef35f85a6e393795428d033",
|
"git-tree": "72ca286ac98e08f2fef35f85a6e393795428d033",
|
||||||
"version-semver": "5.15.2",
|
"version-semver": "5.15.2",
|
||||||
|
Loading…
Reference in New Issue
Block a user