[qt5] Fix scripts on debug/release-only builds (#6259)

* Fix qt5-base portfile

qt5-release.conf was not copied in release mode

* Fix vcpkg_configure_qmake.cmake in debug-only builds

* Add VCPKG_BUILD_TYPE support to qt_modular_library.cmake and vcpkg_build_qmake.cmake
This commit is contained in:
João Maia 2019-04-30 19:29:41 +03:00 committed by Phil Christensen
parent 516d10bb68
commit 5314524f44
6 changed files with 68 additions and 52 deletions

View File

@ -1,4 +1,4 @@
Source: qt5-base
Version: 5.12.1-5
Version: 5.12.1-6
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, openssl

View File

@ -157,6 +157,8 @@ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
list(FILTER BINARY_TOOLS EXCLUDE REGEX "\\.dll\$")
file(INSTALL ${BINARY_TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5)
file(REMOVE ${BINARY_TOOLS})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/qt_release.conf DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(GLOB BINARY_TOOLS "${CURRENT_PACKAGES_DIR}/debug/bin/*")
@ -166,7 +168,7 @@ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(COPY ${CMAKE_CURRENT_LIST_DIR}/qt_debug.conf ${CMAKE_CURRENT_LIST_DIR}/qt_release.conf DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/qt_debug.conf DESTINATION ${CURRENT_PACKAGES_DIR}/tools/qt5)
endif()
vcpkg_execute_required_process(

View File

@ -1,3 +1,3 @@
Source: qt5-modularscripts
Version: 2019-03-21
Version: 2019-04-30
Description: Vcpkg helpers to package qt5 modules

View File

@ -31,12 +31,8 @@ function(qt_modular_build_library SOURCE_PATH)
set(ENV{_CL_} "/utf-8")
#Store build paths
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
set(DEBUG_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
set(RELEASE_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
endif()
#Find Python and add it to the path
vcpkg_find_acquire_program(PYTHON2)
@ -115,6 +111,8 @@ function(qt_modular_build_library SOURCE_PATH)
#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})
endif()
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/tools/qt5)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/tools/qt5 ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT})
endif()
@ -134,9 +132,13 @@ function(qt_modular_build_library SOURCE_PATH)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/qt5/debug/include)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
endif()
#Find the relevant license file and install it
if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3")

View File

@ -21,13 +21,21 @@ function(vcpkg_build_qmake)
# Make sure that the linker finds the libraries used
set(ENV_PATH_BACKUP "$ENV{PATH}")
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
set(DEBUG_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
set(RELEASE_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
endif()
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
list(APPEND _csc_RELEASE_TARGETS ${_csc_TARGETS})
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
list(APPEND _csc_DEBUG_TARGETS ${_csc_TARGETS})
endif()
if(NOT _csc_BUILD_LOGNAME)
set(_csc_BUILD_LOGNAME build)
@ -47,6 +55,7 @@ function(vcpkg_build_qmake)
set(ENV{_CL_} "/utf-8")
#First generate the makefiles so we can modify them
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
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)
@ -69,7 +78,9 @@ function(vcpkg_build_qmake)
endif()
run_jom("${_csc_DEBUG_TARGETS}" ${_csc_BUILD_LOGNAME} dbg)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
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)
@ -90,6 +101,7 @@ function(vcpkg_build_qmake)
endif()
run_jom("${_csc_RELEASE_TARGETS}" ${_csc_BUILD_LOGNAME} rel)
endif()
# Restore the original value of ENV{PATH}
set(ENV{PATH} "${ENV_PATH_BACKUP}")

View File

@ -43,7 +43,7 @@ function(vcpkg_configure_qmake)
message(STATUS "Configuring ${TARGET_TRIPLET}-rel done")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_debug.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/qt.conf)
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg")