Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ports/qt5-activeqt/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "qt5-activeqt",
"version": "5.15.5",
"port-version": 1,
"description": "Qt5 ActiveQt Module - ActiveX components",
"license": null,
"supports": "windows",
"dependencies": [
{
"name": "qt5-base",
"default-features": false
},
"qt5-declarative"
}
]
}
22 changes: 11 additions & 11 deletions ports/qt5-base/cmake/install_qt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ function(install_qt)
vcpkg_add_to_path(PREPEND "${PYTHON3_EXE_PATH}")

if (CMAKE_HOST_WIN32)
# flex and bison for ANGLE library
vcpkg_find_acquire_program(FLEX)
get_filename_component(FLEX_EXE_PATH ${FLEX} DIRECTORY)
get_filename_component(FLEX_DIR ${FLEX_EXE_PATH} NAME)
# flex and bison for ANGLE library
vcpkg_find_acquire_program(FLEX)
get_filename_component(FLEX_EXE_PATH ${FLEX} DIRECTORY)
get_filename_component(FLEX_DIR ${FLEX_EXE_PATH} NAME)

file(COPY ${FLEX_EXE_PATH} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-tools" )
set(FLEX_TEMP "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-tools/${FLEX_DIR}")
file(RENAME "${FLEX_TEMP}/win_bison.exe" "${FLEX_TEMP}/bison.exe")
file(RENAME "${FLEX_TEMP}/win_flex.exe" "${FLEX_TEMP}/flex.exe")
vcpkg_add_to_path("${FLEX_TEMP}")
endif()
file(COPY ${FLEX_EXE_PATH} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-tools" )
set(FLEX_TEMP "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-tools/${FLEX_DIR}")
file(RENAME "${FLEX_TEMP}/win_bison.exe" "${FLEX_TEMP}/bison.exe")
file(RENAME "${FLEX_TEMP}/win_flex.exe" "${FLEX_TEMP}/flex.exe")
vcpkg_add_to_path("${FLEX_TEMP}")
endif()

set(_path "$ENV{PATH}")
set(_path "$ENV{PATH}")

#Replace with VCPKG variables if PR #7733 is merged
unset(BUILDTYPES)
Expand Down
18 changes: 15 additions & 3 deletions ports/qt5-base/cmake/qt_submodule_installation.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@


function(qt_submodule_installation)
cmake_parse_arguments(_csc "" "OUT_SOURCE_PATH" "" ${ARGN})
qt_download_submodule(OUT_SOURCE_PATH TARGET_SOURCE_PATH ${_csc_UNPARSED_ARGUMENTS})
cmake_parse_arguments(_csc
""
"OUT_SOURCE_PATH"
"PATCHES;OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG;BUILD_OPTIONS;BUILD_OPTIONS_RELEASE;BUILD_OPTIONS_DEBUG"
${ARGN}
)
qt_download_submodule(OUT_SOURCE_PATH TARGET_SOURCE_PATH PATCHES ${_csc_PATCHES})
if(QT_UPDATE_VERSION)
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled PARENT_SCOPE)
else()
qt_build_submodule(${TARGET_SOURCE_PATH} ${_csc_UNPARSED_ARGUMENTS})
qt_build_submodule(${TARGET_SOURCE_PATH}
OPTIONS ${_csc_OPTIONS}
OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE}
OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG}
BUILD_OPTIONS ${_csc_BUILD_OPTIONS}
BUILD_OPTIONS_RELEASE ${_csc_BUILD_OPTIONS_RELEASE}
BUILD_OPTIONS_DEBUG ${_csc_BUILD_OPTIONS_DEBUG}
)
qt_install_copyright(${TARGET_SOURCE_PATH})
endif()
if(DEFINED _csc_OUT_SOURCE_PATH)
Expand Down
150 changes: 96 additions & 54 deletions ports/qt5-base/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ qt5-base for qt5-x11extras requires several libraries from the system package ma
)
endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

set(WITH_PGSQL_PLUGIN OFF)
if("postgresqlplugin" IN_LIST FEATURES)
Expand Down Expand Up @@ -98,18 +98,13 @@ set(CORE_OPTIONS
## 3rd Party Libs
list(APPEND CORE_OPTIONS
-system-zlib
-system-libjpeg
-system-libpng
-system-freetype
-system-pcre
-system-doubleconversion
-system-sqlite
-system-harfbuzz
-icu
-no-angle # Qt does not need to build angle. VCPKG will build angle!
-no-glib
-openssl-linked
)
)

if(WITH_PGSQL_PLUGIN)
list(APPEND CORE_OPTIONS -sql-psql)
Expand Down Expand Up @@ -150,10 +145,6 @@ find_library(PCRE2_RELEASE NAMES pcre2-16 pcre2-16-static PATHS "${CURRENT_INSTA
find_library(PCRE2_DEBUG NAMES pcre2-16 pcre2-16-static pcre2-16d pcre2-16-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(FREETYPE_RELEASE NAMES freetype PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) #zlib, bzip2, libpng
find_library(FREETYPE_DEBUG NAMES freetype freetyped PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(DOUBLECONVERSION_RELEASE NAMES double-conversion PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(DOUBLECONVERSION_DEBUG NAMES double-conversion PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(HARFBUZZ_RELEASE NAMES harfbuzz PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(HARFBUZZ_DEBUG NAMES harfbuzz PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library(SQLITE_RELEASE NAMES sqlite3 PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) # Depends on openssl and zlib(linux)
find_library(SQLITE_DEBUG NAMES sqlite3 sqlite3d PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)

Expand Down Expand Up @@ -206,48 +197,87 @@ set(FREETYPE_DEBUG_ALL "${FREETYPE_DEBUG} ${BZ2_DEBUG} ${LIBPNG_DEBUG} ${ZLIB_DE
x_vcpkg_pkgconfig_get_modules(PREFIX harfbuzz MODULES harfbuzz LIBRARIES)
Copy link
Contributor

@Neumann-A Neumann-A Apr 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can probably simplify a lot of the code by using x_vcpkg_pkgconfig_get_modules more


set(RELEASE_OPTIONS
"LIBJPEG_LIBS=${JPEG_RELEASE}"
"ZLIB_LIBS=${ZLIB_RELEASE}"
"LIBPNG_LIBS=${LIBPNG_RELEASE} ${ZLIB_RELEASE}"
"PCRE2_LIBS=${PCRE2_RELEASE}"
"FREETYPE_LIBS=${FREETYPE_RELEASE_ALL}"
"ICU_LIBS=${ICU_RELEASE}"
"QMAKE_LIBS_PRIVATE+=${BZ2_RELEASE}"
"QMAKE_LIBS_PRIVATE+=${LIBPNG_RELEASE}"
"QMAKE_LIBS_PRIVATE+=${ICU_RELEASE}"
"QMAKE_LIBS_PRIVATE+=${ZSTD_RELEASE}"
)
"ZLIB_LIBS=${ZLIB_RELEASE}"
"PCRE2_LIBS=${PCRE2_RELEASE}"
"QMAKE_LIBS_PRIVATE+=${BZ2_RELEASE}"
"QMAKE_LIBS_PRIVATE+=${ZSTD_RELEASE}"
)
set(DEBUG_OPTIONS
"LIBJPEG_LIBS=${JPEG_DEBUG}"
"ZLIB_LIBS=${ZLIB_DEBUG}"
"LIBPNG_LIBS=${LIBPNG_DEBUG} ${ZLIB_DEBUG}"
"PCRE2_LIBS=${PCRE2_DEBUG}"
"FREETYPE_LIBS=${FREETYPE_DEBUG_ALL}"
"ICU_LIBS=${ICU_DEBUG}"
"QMAKE_LIBS_PRIVATE+=${BZ2_DEBUG}"
"QMAKE_LIBS_PRIVATE+=${LIBPNG_DEBUG}"
"QMAKE_LIBS_PRIVATE+=${ICU_DEBUG}"
"QMAKE_LIBS_PRIVATE+=${ZSTD_DEBUG}"
)
"ZLIB_LIBS=${ZLIB_DEBUG}"
"PCRE2_LIBS=${PCRE2_DEBUG}"
"QMAKE_LIBS_PRIVATE+=${BZ2_DEBUG}"
"QMAKE_LIBS_PRIVATE+=${ZSTD_DEBUG}"
)

if("icu" IN_LIST FEATURES)
list(APPEND CORE_OPTIONS -icu)
list(APPEND RELEASE_OPTIONS
"ICU_LIBS=${ICU_RELEASE}"
"QMAKE_LIBS_PRIVATE+=${ICU_RELEASE}"
)
list(APPEND DEBUG_OPTIONS
"ICU_LIBS=${ICU_DEBUG}"
"QMAKE_LIBS_PRIVATE+=${ICU_DEBUG}"
)
else()
list(APPEND CORE_OPTIONS -no-icu)
endif()

if("gui" IN_LIST FEATURES)
list(APPEND CORE_OPTIONS
-gui
-widgets
-system-freetype
-system-harfbuzz
-system-libjpeg
-system-libpng
)
list(APPEND RELEASE_OPTIONS
"LIBJPEG_LIBS=${JPEG_RELEASE}"
"LIBPNG_LIBS=${LIBPNG_RELEASE} ${ZLIB_RELEASE}"
"FREETYPE_LIBS=${FREETYPE_RELEASE_ALL}"
"QMAKE_LIBS_PRIVATE+=${LIBPNG_RELEASE}"
)
list(APPEND DEBUG_OPTIONS
"LIBJPEG_LIBS=${JPEG_DEBUG}"
"LIBPNG_LIBS=${LIBPNG_DEBUG} ${ZLIB_DEBUG}"
"FREETYPE_LIBS=${FREETYPE_DEBUG_ALL}"
"QMAKE_LIBS_PRIVATE+=${LIBPNG_DEBUG}"
)
else()
list(APPEND CORE_OPTIONS
-no-gui
-no-widgets
-no-freetype
-no-harfbuzz
-no-libjpeg
-no-libpng
)
endif()

if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_TARGET_IS_UWP)
list(APPEND CORE_OPTIONS -appstore-compliant)
endif()
if(NOT ${VCPKG_LIBRARY_LINKAGE} STREQUAL "static")
list(APPEND CORE_OPTIONS -opengl dynamic) # other options are "-no-opengl", "-opengl angle", and "-opengl desktop" and "-opengel es2"
else()
list(APPEND CORE_OPTIONS -opengl dynamic) # other possible option without moving angle dlls: "-opengl desktop". "-opengel es2" only works with commented patch
if("gui" IN_LIST FEATURES)
if(NOT ${VCPKG_LIBRARY_LINKAGE} STREQUAL "static")
list(APPEND CORE_OPTIONS -opengl dynamic) # other options are "-no-opengl", "-opengl angle", and "-opengl desktop" and "-opengel es2"
else()
list(APPEND CORE_OPTIONS -opengl dynamic) # other possible option without moving angle dlls: "-opengl desktop". "-opengel es2" only works with commented patch
endif()
list(APPEND RELEASE_OPTIONS
"HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_RELEASE}"
)
list(APPEND DEBUG_OPTIONS
"HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_DEBUG}"
)
endif()
list(APPEND RELEASE_OPTIONS
"SQLITE_LIBS=${SQLITE_RELEASE}"
"HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_RELEASE}"
"OPENSSL_LIBS=${SSL_RELEASE} ${EAY_RELEASE} ws2_32.lib secur32.lib advapi32.lib shell32.lib crypt32.lib user32.lib gdi32.lib"
)

list(APPEND DEBUG_OPTIONS
"SQLITE_LIBS=${SQLITE_DEBUG}"
"HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_DEBUG}"
"OPENSSL_LIBS=${SSL_DEBUG} ${EAY_DEBUG} ws2_32.lib secur32.lib advapi32.lib shell32.lib crypt32.lib user32.lib gdi32.lib"
)
if(WITH_PGSQL_PLUGIN)
Expand All @@ -260,28 +290,33 @@ if(VCPKG_TARGET_IS_WINDOWS)
endif(WITH_MYSQL_PLUGIN)

elseif(VCPKG_TARGET_IS_LINUX)
list(APPEND CORE_OPTIONS -fontconfig -xcb-xlib -xcb -linuxfb)
if (NOT EXISTS "/usr/include/GL/glu.h")
message(FATAL_ERROR "qt5 requires libgl1-mesa-dev and libglu1-mesa-dev, please use your distribution's package manager to install them.\nExample: \"apt-get install libgl1-mesa-dev libglu1-mesa-dev\"")
if("gui" IN_LIST FEATURES)
if (NOT EXISTS "/usr/include/GL/glu.h")
message(FATAL_ERROR "qt5 requires libgl1-mesa-dev and libglu1-mesa-dev, please use your distribution's package manager to install them.\nExample: \"apt-get install libgl1-mesa-dev libglu1-mesa-dev\"")
endif()
list(APPEND CORE_OPTIONS -fontconfig -xcb-xlib -xcb -linuxfb)
list(APPEND RELEASE_OPTIONS
"HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_RELEASE}"
"FONTCONFIG_LIBS=${FONTCONFIG_RELEASE} ${FREETYPE_RELEASE} ${EXPAT_RELEASE} -luuid"
)
list(APPEND DEBUG_OPTIONS
"HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_DEBUG}"
"FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG} -luuid"
)
endif()
list(APPEND RELEASE_OPTIONS
"SQLITE_LIBS=${SQLITE_RELEASE} -ldl -lpthread"
"HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_RELEASE}"
"OPENSSL_LIBS=${SSL_RELEASE} ${EAY_RELEASE} -ldl -lpthread"
"FONTCONFIG_LIBS=${FONTCONFIG_RELEASE} ${FREETYPE_RELEASE} ${EXPAT_RELEASE} -luuid"
)
list(APPEND DEBUG_OPTIONS
"SQLITE_LIBS=${SQLITE_DEBUG} -ldl -lpthread"
"HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_DEBUG}"
"OPENSSL_LIBS=${SSL_DEBUG} ${EAY_DEBUG} -ldl -lpthread"
"FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG} -luuid"
)
if(WITH_PGSQL_PLUGIN)
list(APPEND RELEASE_OPTIONS "PSQL_LIBS=${PSQL_RELEASE} ${PSQL_PORT_RELEASE} ${PSQL_TYPES_RELEASE} ${PSQL_COMMON_RELEASE} ${SSL_RELEASE} ${EAY_RELEASE} -ldl -lpthread")
list(APPEND DEBUG_OPTIONS "PSQL_LIBS=${PSQL_DEBUG} ${PSQL_PORT_DEBUG} ${PSQL_TYPES_DEBUG} ${PSQL_COMMON_DEBUG} ${SSL_DEBUG} ${EAY_DEBUG} -ldl -lpthread")
endif()
elseif(VCPKG_TARGET_IS_OSX)
list(APPEND CORE_OPTIONS -fontconfig)
if("${VCPKG_TARGET_ARCHITECTURE}" MATCHES "arm64")
FILE(READ "${SOURCE_PATH}/mkspecs/common/macx.conf" _tmp_contents)
string(REPLACE "QMAKE_APPLE_DEVICE_ARCHS = x86_64" "QMAKE_APPLE_DEVICE_ARCHS = arm64" _tmp_contents ${_tmp_contents})
Expand Down Expand Up @@ -318,17 +353,24 @@ elseif(VCPKG_TARGET_IS_OSX)
FILE(WRITE "${SOURCE_PATH}/mkspecs/common/macx.conf" ${_tmp_contents})
endif()
#list(APPEND QT_PLATFORM_CONFIGURE_OPTIONS HOST_PLATFORM ${TARGET_MKSPEC})
if("gui" IN_LIST FEATURES)
list(APPEND CORE_OPTIONS -fontconfig)
list(APPEND RELEASE_OPTIONS
"HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_RELEASE} -framework ApplicationServices"
"FONTCONFIG_LIBS=${FONTCONFIG_RELEASE} ${FREETYPE_RELEASE} ${EXPAT_RELEASE} -liconv"
)
list(APPEND DEBUG_OPTIONS
"HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_DEBUG} -framework ApplicationServices"
"FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG} -liconv"
)
endif()
list(APPEND RELEASE_OPTIONS
"SQLITE_LIBS=${SQLITE_RELEASE} -ldl -lpthread"
"HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_RELEASE} -framework ApplicationServices"
"OPENSSL_LIBS=${SSL_RELEASE} ${EAY_RELEASE} -ldl -lpthread"
"FONTCONFIG_LIBS=${FONTCONFIG_RELEASE} ${FREETYPE_RELEASE} ${EXPAT_RELEASE} -liconv"
)
list(APPEND DEBUG_OPTIONS
"SQLITE_LIBS=${SQLITE_DEBUG} -ldl -lpthread"
"HARFBUZZ_LIBS=${harfbuzz_LIBRARIES_DEBUG} -framework ApplicationServices"
"OPENSSL_LIBS=${SSL_DEBUG} ${EAY_DEBUG} -ldl -lpthread"
"FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG} -liconv"
)

if(WITH_PGSQL_PLUGIN)
Expand Down Expand Up @@ -463,7 +505,7 @@ file(COPY
)

# Fix Qt5GuiConfigExtras EGL path
if(VCPKG_TARGET_IS_LINUX)
if(VCPKG_TARGET_IS_LINUX AND "gui" IN_LIST FEATURES)
set(_file "${CURRENT_PACKAGES_DIR}/share/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake")
file(READ "${_file}" _contents)
string(REGEX REPLACE "_qt5gui_find_extra_libs\\\(EGL[^\\\n]+" "_qt5gui_find_extra_libs(EGL \"EGL\" \"\" \"\${_qt5Gui_install_prefix}/include\")\n" _contents "${_contents}")
Expand Down
56 changes: 38 additions & 18 deletions ports/qt5-base/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
{
"name": "qt5-base",
"version": "5.15.5",
"port-version": 1,
"port-version": 2,
"description": "Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.",
"homepage": "https://www.qt.io/",
"license": null,
"dependencies": [
{
"name": "angle",
"platform": "!windows"
},
"double-conversion",
"egl-registry",
{
"name": "fontconfig",
"platform": "!windows"
},
"freetype",
"harfbuzz",
{
"name": "icu",
"platform": "!uwp"
},
"libjpeg-turbo",
"libpng",
"openssl",
"pcre2",
{
Expand All @@ -39,7 +22,37 @@
"zlib",
"zstd"
],
"default-features": [
"gui"
],
"features": {
"gui": {
"description": "Build GUI features, including QWidgets",
"dependencies": [
{
"name": "angle",
"platform": "!windows"
},
"egl-registry",
{
"name": "fontconfig",
"platform": "!windows"
},
"freetype",
"harfbuzz",
"libjpeg-turbo",
"libpng"
]
},
"icu": {
"description": "Enable ICU support",
"dependencies": [
{
"name": "icu",
"platform": "!uwp"
}
]
},
"latest": {
"description": "(deprecated)"
},
Expand All @@ -58,6 +71,13 @@
"vulkan": {
"description": "Enable Vulkan support in QtGui",
"dependencies": [
{
"name": "qt5-base",
"default-features": false,
"features": [
"gui"
]
},
"vulkan"
]
}
Expand Down
Loading