2019-09-13 01:07:22 +08:00
vcpkg_buildpath_length_warning ( 37 )
2019-04-15 20:00:14 +08:00
2023-05-02 07:00:31 +08:00
if ( VCPKG_TARGET_IS_LINUX )
2023-04-15 05:13:05 +08:00
message ( WARNING "qt5-base currently requires some packages from the system package manager. "
" T h e y c a n b e i n s t a l l e d o n U b u n t u s y s t e m s v i a "
2023-05-02 07:00:31 +08:00
" s u d o a p t - g e t i n s t a l l ' ^ l i b x c b . * - d e v ' l i b x 1 1 - x c b - d e v l i b g l 1 - m e s a - d e v l i b x r e n d e r - d e v "
2023-04-15 05:13:05 +08:00
" l i b x i - d e v l i b x k b c o m m o n - d e v l i b x k b c o m m o n - x 1 1 - d e v . F o r m o r e i n f o r m a t i o n , s e e "
2023-05-02 07:00:31 +08:00
" h t t p s : / / d o c . q t . i o / q t - 5 / l i n u x . h t m l a n d h t t p s : / / d o c . q t . i o / q t - 5 / l i n u x - r e q u i r e m e n t s . h t m l "
)
2023-02-23 05:17:37 +08:00
elseif ( VCPKG_TARGET_IS_MINGW AND CMAKE_HOST_WIN32 )
find_program ( MINGW32_MAKE mingw32-make PATHS ENV PATH NO_DEFAULT_PATH REQUIRED )
2020-05-19 02:06:20 +08:00
endif ( )
2019-04-15 20:00:14 +08:00
list ( APPEND CMAKE_MODULE_PATH ${ CMAKE_CURRENT_LIST_DIR } )
2019-09-13 01:07:22 +08:00
list ( APPEND CMAKE_MODULE_PATH ${ CMAKE_CURRENT_LIST_DIR } /cmake )
2021-04-07 01:53:41 +08:00
set ( WITH_PGSQL_PLUGIN OFF )
2021-03-17 03:00:13 +08:00
if ( "postgresqlplugin" IN_LIST FEATURES )
2021-04-07 01:53:41 +08:00
set ( WITH_PGSQL_PLUGIN ON )
endif ( )
set ( WITH_MYSQL_PLUGIN OFF )
if ( "mysqlplugin" IN_LIST FEATURES )
set ( WITH_MYSQL_PLUGIN ON )
endif ( )
2021-03-17 03:00:13 +08:00
2019-09-13 01:07:22 +08:00
include ( qt_port_functions )
2019-04-15 20:00:14 +08:00
include ( configure_qt )
include ( install_qt )
2020-04-24 12:19:45 +08:00
2019-09-13 01:07:22 +08:00
#########################
## Find Host and Target mkspec name for configure
include ( find_qt_mkspec )
find_qt_mkspec ( TARGET_MKSPEC HOST_MKSPEC HOST_TOOLS )
set ( QT_PLATFORM_CONFIGURE_OPTIONS TARGET_PLATFORM ${ TARGET_MKSPEC } )
if ( DEFINED HOST_MKSPEC )
list ( APPEND QT_PLATFORM_CONFIGURE_OPTIONS HOST_PLATFORM ${ HOST_MKSPEC } )
endif ( )
if ( DEFINED HOST_TOOLS )
list ( APPEND QT_PLATFORM_CONFIGURE_OPTIONS HOST_TOOLS_ROOT ${ HOST_TOOLS } )
endif ( )
2019-04-15 20:00:14 +08:00
2019-09-13 01:07:22 +08:00
#########################
## Downloading Qt5-Base
qt_download_submodule ( OUT_SOURCE_PATH SOURCE_PATH
P A T C H E S
2023-05-25 02:57:11 +08:00
# CVE fixes from https://download.qt.io/official_releases/qt/5.15/
p a t c h e s / C V E - 2 0 2 3 - 3 2 7 6 3 - q t b a s e - 5 . 1 5 . d i f f
2023-06-17 07:14:53 +08:00
p a t c h e s / C V E - 2 0 2 3 - 3 4 4 1 0 - q t b a s e - 5 . 1 5 . d i f f
2023-07-20 05:24:39 +08:00
p a t c h e s / C V E - 2 0 2 3 - 3 7 3 6 9 - q t b a s e - 5 . 1 5 . d i f f
p a t c h e s / C V E - 2 0 2 3 - 3 8 1 9 7 - q t b a s e - 5 . 1 5 . d i f f
2023-10-03 11:18:27 +08:00
p a t c h e s / C V E - 2 0 2 3 - 4 3 1 1 4 - 5 . 1 5 . p a t c h
2023-12-29 15:59:20 +08:00
p a t c h e s / 0 0 0 1 - C V E - 2 0 2 3 - 5 1 7 1 4 - q t b a s e - 5 . 1 5 . d i f f
p a t c h e s / 0 0 0 2 - C V E - 2 0 2 3 - 5 1 7 1 4 - q t b a s e - 5 . 1 5 . d i f f
2024-02-22 03:36:45 +08:00
p a t c h e s / C V E - 2 0 2 4 - 2 5 5 8 0 - q t b a s e - 5 . 1 5 . d i f f
2023-05-25 02:57:11 +08:00
2021-01-12 12:49:05 +08:00
p a t c h e s / w i n m a i n _ p r o . p a t c h #Moves qtmain to manual-link
p a t c h e s / w i n d o w s _ p r f . p a t c h #fixes the qtmain dependency due to the above move
p a t c h e s / q t _ a p p . p a t c h #Moves the target location of qt5 host apps to always install into the host dir.
p a t c h e s / g u i _ c o n f i g u r e . p a t c h #Patches the gui configure.json to break freetype/fontconfig autodetection because it does not include its dependencies.
p a t c h e s / x l i b . p a t c h #Patches Xlib check to actually use Pkgconfig instead of makeSpec only
p a t c h e s / e g l . p a t c h #Fix egl detection logic.
2023-05-25 02:57:11 +08:00
p a t c h e s / q t b u g _ 9 6 3 9 2 . p a t c h #Backport fix for QTBUG-96392
2021-01-12 12:49:05 +08:00
p a t c h e s / m y s q l _ p l u g i n _ i n c l u d e . p a t c h #Fix include path of mysql plugin
p a t c h e s / m y s q l - c o n f i g u r e . p a t c h #Fix mysql project
2021-11-11 10:13:48 +08:00
p a t c h e s / c o c o a . p a t c h #Fix missing include on macOS Monterrey, https://code.qt.io/cgit/qt/qtbase.git/commit/src/plugins/platforms/cocoa?id=dece6f5840463ae2ddf927d65eb1b3680e34a547
2023-10-04 11:19:20 +08:00
p a t c h e s / x c o d e - 1 5 . p a t c h #From https://codereview.qt-project.org/c/qt/qtbase/+/503172
2023-10-07 01:29:02 +08:00
p a t c h e s / p a t c h - q t b a s e - m e m o r y _ r e s o u r c e . d i f f # From https://bugreports.qt.io/browse/QTBUG-114316
2021-01-12 12:49:05 +08:00
#patches/static_opengl.patch #Use this patch if you really want to statically link angle on windows (e.g. using -opengl es2 and -static).
#Be carefull since it requires definining _GDI32_ for all dependent projects due to redefinition errors in the
#the windows supplied gl.h header and the angle gl.h otherwise.
2022-05-14 07:51:51 +08:00
# CMake fixes
p a t c h e s / Q t 5 B a s i c C o n f i g . p a t c h
p a t c h e s / Q t 5 P l u g i n T a r g e t . p a t c h
p a t c h e s / c r e a t e _ c m a k e . p a t c h
p a t c h e s / Q t 5 G u i C o n f i g E x t r a s . p a t c h # Patches the library search behavior for EGL since angle is not build with Qt
2022-12-29 05:43:43 +08:00
p a t c h e s / f i x _ a n g l e . p a t c h # Failed to create OpenGL context for format QSurfaceFormat ...
2023-02-23 05:17:37 +08:00
p a t c h e s / m i n g w 9 . p a t c h # Fix compile with MinGW-W64 9.0.0: Redefinition of 'struct _FILE_ID_INFO'
2024-01-05 04:05:56 +08:00
p a t c h e s / X K B _ K E Y _ d e a d _ l o w l i n e . p a t c h # https://bugreports.qt.io/browse/QTBUG-117950
2019-09-13 01:07:22 +08:00
)
2019-04-15 20:00:14 +08:00
# Remove vendored dependencies to ensure they are not picked up by the build
2020-10-17 17:10:11 +08:00
foreach ( DEPENDENCY zlib freetype harfbuzz-ng libjpeg libpng double-conversion sqlite pcre2 )
2019-04-15 20:00:14 +08:00
if ( EXISTS ${ SOURCE_PATH } /src/3rdparty/ ${ DEPENDENCY } )
file ( REMOVE_RECURSE ${ SOURCE_PATH } /src/3rdparty/ ${ DEPENDENCY } )
endif ( )
endforeach ( )
2020-10-17 17:10:11 +08:00
#file(REMOVE_RECURSE ${SOURCE_PATH}/include/QtZlib)
2019-04-15 20:00:14 +08:00
2019-09-13 01:07:22 +08:00
#########################
## Setup Configure options
2019-04-15 20:00:14 +08:00
set ( CORE_OPTIONS
- c o n f i r m - l i c e n s e
- o p e n s o u r c e
2019-09-13 01:07:22 +08:00
#-simulator_and_device
#-ltcg
2021-01-12 12:49:05 +08:00
#-combined-angle-lib
2019-09-13 01:07:22 +08:00
# ENV ANGLE_DIR to external angle source dir. (Will always be compiled with Qt)
#-optimized-tools
#-force-debug-info
2020-01-07 04:36:51 +08:00
- v e r b o s e
2019-09-13 01:07:22 +08:00
)
## 3rd Party Libs
list ( APPEND CORE_OPTIONS
2019-04-15 20:00:14 +08:00
- s y s t e m - z l i b
- s y s t e m - l i b j p e g
- s y s t e m - l i b p n g
2021-04-07 01:53:41 +08:00
- s y s t e m - f r e e t y p e
2019-04-15 20:00:14 +08:00
- s y s t e m - p c r e
- s y s t e m - d o u b l e c o n v e r s i o n
- s y s t e m - s q l i t e
2020-01-07 04:36:51 +08:00
- s y s t e m - h a r f b u z z
2021-04-07 01:53:41 +08:00
- n o - a n g l e # Qt does not need to build angle. VCPKG will build angle!
- n o - g l i b
2022-06-29 03:55:44 +08:00
- o p e n s s l - l i n k e d
2024-05-18 03:06:28 +08:00
- n o - f e a t u r e - g s s a p i
2021-04-07 01:53:41 +08:00
)
2019-04-15 20:00:14 +08:00
2024-05-23 10:39:25 +08:00
if ( VCPKG_TARGET_IS_LINUX )
# Accessibility uses at-spi2-core which links dbus,
# so we link to ensure to use the same dbus library.
list ( APPEND CORE_OPTIONS -dbus-linked )
else ( )
# Enable Qt DBus without linking to it.
list ( APPEND CORE_OPTIONS -dbus-runtime )
endif ( )
2021-04-07 01:53:41 +08:00
if ( WITH_PGSQL_PLUGIN )
2021-03-17 03:00:13 +08:00
list ( APPEND CORE_OPTIONS -sql-psql )
else ( )
list ( APPEND CORE_OPTIONS -no-sql-psql )
endif ( )
2021-04-07 01:53:41 +08:00
if ( WITH_MYSQL_PLUGIN )
list ( APPEND CORE_OPTIONS -sql-mysql )
else ( )
list ( APPEND CORE_OPTIONS -no-sql-mysql )
2021-01-12 12:49:05 +08:00
endif ( )
2021-04-20 08:11:20 +08:00
if ( "vulkan" IN_LIST FEATURES )
list ( APPEND CORE_OPTIONS --vulkan=yes )
else ( )
list ( APPEND CORE_OPTIONS --vulkan=no )
endif ( )
2021-04-07 01:53:41 +08:00
2019-09-13 01:07:22 +08:00
find_library ( ZLIB_RELEASE NAMES z zlib PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
find_library ( ZLIB_DEBUG NAMES z zlib zd zlibd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
find_library ( JPEG_RELEASE NAMES jpeg jpeg-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
find_library ( JPEG_DEBUG NAMES jpeg jpeg-static jpegd jpeg-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
find_library ( LIBPNG_RELEASE NAMES png16 libpng16 PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH ) #Depends on zlib
find_library ( LIBPNG_DEBUG NAMES png16 png16d libpng16 libpng16d PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
find_library ( PSQL_RELEASE NAMES pq libpq PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH ) # Depends on openssl and zlib(linux)
find_library ( PSQL_DEBUG NAMES pq libpq pqd libpqd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
2020-12-22 03:17:30 +08:00
if ( NOT ( PSQL_RELEASE MATCHES ".*\.so" ) AND NOT ( PSQL_DEBUG MATCHES ".*\.so" ) )
find_library ( PSQL_COMMON_RELEASE NAMES pgcommon libpgcommon PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH ) # Depends on openssl and zlib(linux)
find_library ( PSQL_COMMON_DEBUG NAMES pgcommon libpgcommon pgcommond libpgcommond PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
find_library ( PSQL_PORT_RELEASE NAMES pgport libpgport PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH ) # Depends on openssl and zlib(linux)
find_library ( PSQL_PORT_DEBUG NAMES pgport libpgport pgportd libpgportd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
endif ( )
2021-01-12 12:49:05 +08:00
find_library ( MYSQL_RELEASE NAMES libmysql mysqlclient PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH ) # Depends on openssl and zlib(linux)
find_library ( MYSQL_DEBUG NAMES libmysql libmysqld mysqlclient mysqlclientd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
2020-12-22 03:17:30 +08:00
2021-11-10 08:29:09 +08:00
find_library ( PCRE2_RELEASE NAMES pcre2-16 pcre2-16-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
find_library ( PCRE2_DEBUG NAMES pcre2-16 pcre2-16-static pcre2-16d pcre2-16-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
2019-09-13 01:07:22 +08:00
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 )
2021-01-12 12:49:05 +08:00
find_library ( DOUBLECONVERSION_RELEASE NAMES double-conversion PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
2019-09-13 01:07:22 +08:00
find_library ( DOUBLECONVERSION_DEBUG NAMES double-conversion PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
2021-01-12 12:49:05 +08:00
find_library ( HARFBUZZ_RELEASE NAMES harfbuzz PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
2019-09-13 01:07:22 +08:00
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 )
2020-01-07 04:36:51 +08:00
2020-08-07 04:07:46 +08:00
find_library ( BROTLI_COMMON_RELEASE NAMES brotlicommon brotlicommon-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
find_library ( BROTLI_COMMON_DEBUG NAMES brotlicommon brotlicommon-static brotlicommond brotlicommon-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
find_library ( BROTLI_DEC_RELEASE NAMES brotlidec brotlidec-static PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
find_library ( BROTLI_DEC_DEBUG NAMES brotlidec brotlidec-static brotlidecd brotlidec-staticd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
2020-01-07 04:36:51 +08:00
find_library ( ICUUC_RELEASE NAMES icuuc libicuuc PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
find_library ( ICUUC_DEBUG NAMES icuucd libicuucd icuuc libicuuc PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
# Was installed in WSL but not on CI machine
# find_library(ICULX_RELEASE NAMES iculx libiculx PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
# find_library(ICULX_DEBUG NAMES iculxd libiculxd iculx libiculx PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
find_library ( ICUIO_RELEASE NAMES icuio libicuio PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
find_library ( ICUIO_DEBUG NAMES icuiod libicuiod icuio libicuio PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
find_library ( ICUIN_RELEASE NAMES icui18n libicui18n icuin PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
find_library ( ICUIN_DEBUG NAMES icui18nd libicui18nd icui18n libicui18n icuin icuind PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
find_library ( ICUDATA_RELEASE NAMES icudata libicudata icudt PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
find_library ( ICUDATA_DEBUG NAMES icudatad libicudatad icudata libicudata icudtd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
2023-02-09 06:29:07 +08:00
set ( ICU_RELEASE "${ICUIN_RELEASE} ${ICULX_RELEASE} ${ICUUC_RELEASE} ${ICUIO_RELEASE} ${ICUDATA_RELEASE}" )
set ( ICU_DEBUG "${ICUIN_DEBUG} ${ICULX_DEBUG} ${ICUUC_DEBUG} ${ICUIO_DEBUG} ${ICUDATA_DEBUG}" )
2020-01-07 04:36:51 +08:00
if ( VCPKG_TARGET_IS_WINDOWS )
2023-02-23 05:17:37 +08:00
set ( ICU_RELEASE "${ICU_RELEASE} -ladvapi32" )
set ( ICU_DEBUG "${ICU_DEBUG} -ladvapi32" )
2020-01-07 04:36:51 +08:00
endif ( )
find_library ( FONTCONFIG_RELEASE NAMES fontconfig PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
find_library ( FONTCONFIG_DEBUG NAMES fontconfig PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
find_library ( EXPAT_RELEASE NAMES expat PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
find_library ( EXPAT_DEBUG NAMES expat PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
2019-09-13 01:07:22 +08:00
#Dependent libraries
2022-02-16 09:20:21 +08:00
find_library ( ZSTD_RELEASE NAMES zstd PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
find_library ( ZSTD_DEBUG NAMES zstd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
2019-09-13 01:07:22 +08:00
find_library ( BZ2_RELEASE bz2 PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
find_library ( BZ2_DEBUG bz2 bz2d PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
find_library ( SSL_RELEASE ssl ssleay32 PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
find_library ( SSL_DEBUG ssl ssleay32 ssld ssleay32d PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
find_library ( EAY_RELEASE libeay32 crypto libcrypto PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH )
find_library ( EAY_DEBUG libeay32 crypto libcrypto libeay32d cryptod libcryptod PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH )
2019-04-15 20:00:14 +08:00
2020-11-20 04:34:30 +08:00
set ( FREETYPE_RELEASE_ALL "${FREETYPE_RELEASE} ${BZ2_RELEASE} ${LIBPNG_RELEASE} ${ZLIB_RELEASE} ${BROTLI_DEC_RELEASE} ${BROTLI_COMMON_RELEASE}" )
set ( FREETYPE_DEBUG_ALL "${FREETYPE_DEBUG} ${BZ2_DEBUG} ${LIBPNG_DEBUG} ${ZLIB_DEBUG} ${BROTLI_DEC_DEBUG} ${BROTLI_COMMON_DEBUG}" )
2020-05-20 06:20:18 +08:00
# If HarfBuzz is built with GLib enabled, it must be statically link
2021-04-07 01:53:41 +08:00
x_vcpkg_pkgconfig_get_modules ( PREFIX harfbuzz MODULES harfbuzz LIBRARIES )
2020-05-20 06:20:18 +08:00
2019-09-13 01:07:22 +08:00
set ( RELEASE_OPTIONS
" L I B J P E G _ L I B S = $ { J P E G _ R E L E A S E } "
" Z L I B _ L I B S = $ { Z L I B _ R E L E A S E } "
" L I B P N G _ L I B S = $ { L I B P N G _ R E L E A S E } $ { Z L I B _ R E L E A S E } "
" P C R E 2 _ L I B S = $ { P C R E 2 _ R E L E A S E } "
2020-05-20 06:20:18 +08:00
" F R E E T Y P E _ L I B S = $ { F R E E T Y P E _ R E L E A S E _ A L L } "
2019-09-13 01:07:22 +08:00
" Q M A K E _ L I B S _ P R I V A T E + = $ { B Z 2 _ R E L E A S E } "
2023-03-10 04:10:00 +08:00
" Q M A K E _ L I B S _ P R I V A T E + = $ { L I B P N G _ R E L E A S E } $ { Z L I B _ R E L E A S E } "
2020-12-22 03:17:30 +08:00
" Q M A K E _ L I B S _ P R I V A T E + = $ { Z S T D _ R E L E A S E } "
2019-09-13 01:07:22 +08:00
)
set ( DEBUG_OPTIONS
" L I B J P E G _ L I B S = $ { J P E G _ D E B U G } "
" Z L I B _ L I B S = $ { Z L I B _ D E B U G } "
" L I B P N G _ L I B S = $ { L I B P N G _ D E B U G } $ { Z L I B _ D E B U G } "
" P C R E 2 _ L I B S = $ { P C R E 2 _ D E B U G } "
2020-05-20 06:20:18 +08:00
" F R E E T Y P E _ L I B S = $ { F R E E T Y P E _ D E B U G _ A L L } "
2019-09-13 01:07:22 +08:00
" Q M A K E _ L I B S _ P R I V A T E + = $ { B Z 2 _ D E B U G } "
2023-03-10 04:10:00 +08:00
" Q M A K E _ L I B S _ P R I V A T E + = $ { L I B P N G _ D E B U G } $ { Z L I B _ D E B U G } "
2020-12-22 03:17:30 +08:00
" Q M A K E _ L I B S _ P R I V A T E + = $ { Z S T D _ D E B U G } "
2019-09-13 01:07:22 +08:00
)
2019-04-15 20:00:14 +08:00
2023-03-10 04:10:00 +08:00
if ( "icu" IN_LIST FEATURES )
list ( APPEND CORE_OPTIONS -icu )
# This if/else corresponds to icu setup in src/corelib/configure.json.
if ( VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
list ( APPEND CORE_OPTIONS
" I C U _ L I B S _ R E L E A S E = $ { I C U _ R E L E A S E } "
" I C U _ L I B S _ D E B U G = $ { I C U _ D E B U G } "
)
else ( )
list ( APPEND RELEASE_OPTIONS "ICU_LIBS=${ICU_RELEASE}" )
list ( APPEND DEBUG_OPTIONS "ICU_LIBS=${ICU_DEBUG}" )
endif ( )
list ( APPEND RELEASE_OPTIONS "QMAKE_LIBS_PRIVATE+=${ICU_RELEASE}" )
list ( APPEND DEBUG_OPTIONS "QMAKE_LIBS_PRIVATE+=${ICU_DEBUG}" )
2023-02-23 05:17:37 +08:00
else ( )
2023-03-10 04:10:00 +08:00
list ( APPEND CORE_OPTIONS -no-icu )
2023-02-23 05:17:37 +08:00
endif ( )
2019-09-13 01:07:22 +08:00
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 ( )
2021-01-12 12:49:05 +08:00
list ( APPEND CORE_OPTIONS -opengl dynamic ) # other possible option without moving angle dlls: "-opengl desktop". "-opengel es2" only works with commented patch
2019-09-13 01:07:22 +08:00
endif ( )
2023-02-23 05:17:37 +08:00
set ( ADDITIONAL_WINDOWS_LIBS "-lws2_32 -lsecur32 -ladvapi32 -lshell32 -lcrypt32 -luser32 -lgdi32" )
2019-09-13 01:07:22 +08:00
list ( APPEND RELEASE_OPTIONS
" S Q L I T E _ L I B S = $ { S Q L I T E _ R E L E A S E } "
2021-04-07 01:53:41 +08:00
" H A R F B U Z Z _ L I B S = $ { h a r f b u z z _ L I B R A R I E S _ R E L E A S E } "
2022-12-30 16:23:31 +08:00
" O P E N S S L _ L I B S = $ { S S L _ R E L E A S E } $ { E A Y _ R E L E A S E } $ { A D D I T I O N A L _ W I N D O W S _ L I B S } "
2019-09-13 01:07:22 +08:00
)
2021-01-12 12:49:05 +08:00
2019-09-13 01:07:22 +08:00
list ( APPEND DEBUG_OPTIONS
" S Q L I T E _ L I B S = $ { S Q L I T E _ D E B U G } "
2021-04-07 01:53:41 +08:00
" H A R F B U Z Z _ L I B S = $ { h a r f b u z z _ L I B R A R I E S _ D E B U G } "
2022-12-30 16:23:31 +08:00
" O P E N S S L _ L I B S = $ { S S L _ D E B U G } $ { E A Y _ D E B U G } $ { A D D I T I O N A L _ W I N D O W S _ L I B S } "
2019-09-13 01:07:22 +08:00
)
2021-04-07 01:53:41 +08:00
if ( WITH_PGSQL_PLUGIN )
2023-08-03 00:25:48 +08:00
list ( APPEND RELEASE_OPTIONS "PSQL_LIBS=${PSQL_RELEASE} ${PSQL_PORT_RELEASE} ${PSQL_COMMON_RELEASE} ${SSL_RELEASE} ${EAY_RELEASE} ${ADDITIONAL_WINDOWS_LIBS} -lwldap32" )
list ( APPEND DEBUG_OPTIONS "PSQL_LIBS=${PSQL_DEBUG} ${PSQL_PORT_DEBUG} ${PSQL_COMMON_DEBUG} ${SSL_DEBUG} ${EAY_DEBUG} ${ADDITIONAL_WINDOWS_LIBS} -lwldap32" )
2021-03-17 03:00:13 +08:00
endif ( )
2019-09-13 01:07:22 +08:00
elseif ( VCPKG_TARGET_IS_LINUX )
2020-07-09 06:34:35 +08:00
list ( APPEND CORE_OPTIONS -fontconfig -xcb-xlib -xcb -linuxfb )
2019-09-13 01:07:22 +08:00
list ( APPEND RELEASE_OPTIONS
" S Q L I T E _ L I B S = $ { S Q L I T E _ R E L E A S E } - l d l - l p t h r e a d "
2021-04-07 01:53:41 +08:00
" H A R F B U Z Z _ L I B S = $ { h a r f b u z z _ L I B R A R I E S _ R E L E A S E } "
2020-01-07 04:36:51 +08:00
" O P E N S S L _ L I B S = $ { S S L _ R E L E A S E } $ { E A Y _ R E L E A S E } - l d l - l p t h r e a d "
2020-11-18 01:18:59 +08:00
" F O N T C O N F I G _ L I B S = $ { F O N T C O N F I G _ R E L E A S E } $ { F R E E T Y P E _ R E L E A S E } $ { E X P A T _ R E L E A S E } - l u u i d "
2019-09-13 01:07:22 +08:00
)
list ( APPEND DEBUG_OPTIONS
" S Q L I T E _ L I B S = $ { S Q L I T E _ D E B U G } - l d l - l p t h r e a d "
2021-04-07 01:53:41 +08:00
" H A R F B U Z Z _ L I B S = $ { h a r f b u z z _ L I B R A R I E S _ D E B U G } "
2020-01-07 04:36:51 +08:00
" O P E N S S L _ L I B S = $ { S S L _ D E B U G } $ { E A Y _ D E B U G } - l d l - l p t h r e a d "
2020-11-18 01:18:59 +08:00
" F O N T C O N F I G _ L I B S = $ { F O N T C O N F I G _ D E B U G } $ { F R E E T Y P E _ D E B U G } $ { E X P A T _ D E B U G } - l u u i d "
2019-09-13 01:07:22 +08:00
)
2021-04-07 01:53:41 +08:00
if ( WITH_PGSQL_PLUGIN )
2021-03-17 03:00:13 +08:00
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 ( )
2019-09-13 01:07:22 +08:00
elseif ( VCPKG_TARGET_IS_OSX )
2023-07-15 05:39:05 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
# Avoid frameworks for vcpkg
list ( APPEND CORE_OPTIONS -no-framework )
# Such that Qt executables like moc find their libs. The default path is ../Frameworks
list ( APPEND DEBUG_OPTIONS -R ${ CURRENT_INSTALLED_DIR } /debug/lib )
list ( APPEND RELEASE_OPTIONS -R ${ CURRENT_INSTALLED_DIR } /lib )
endif ( )
2020-01-07 04:36:51 +08:00
list ( APPEND CORE_OPTIONS -fontconfig )
2021-06-22 04:29:58 +08:00
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 } )
FILE ( WRITE "${SOURCE_PATH}/mkspecs/common/macx.conf" ${ _tmp_contents } )
endif ( )
2019-09-13 01:07:22 +08:00
if ( DEFINED VCPKG_OSX_DEPLOYMENT_TARGET )
set ( ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET} ${ VCPKG_OSX_DEPLOYMENT_TARGET } )
else ( )
execute_process ( COMMAND xcrun --show-sdk-version
2023-02-10 06:45:05 +08:00
O U T P U T _ V A R I A B L E O S X _ S D K _ V E R S I O N
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
2021-11-24 04:11:07 +08:00
message ( STATUS "Detected OSX SDK Version: ${OSX_SDK_VERSION}" )
2023-02-10 06:45:05 +08:00
string ( REGEX MATCH "^([0-9]+)\\.([0-9]+)" OSX_SDK_VERSION "${OSX_SDK_VERSION}" )
2021-11-24 04:11:07 +08:00
message ( STATUS "Major.Minor OSX SDK Version: ${OSX_SDK_VERSION}" )
execute_process ( COMMAND sw_vers -productVersion
2023-02-10 06:45:05 +08:00
O U T P U T _ V A R I A B L E V C P K G _ O S X _ D E P L O Y M E N T _ T A R G E T
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
2021-11-24 04:11:07 +08:00
message ( STATUS "Detected OSX system Version: ${VCPKG_OSX_DEPLOYMENT_TARGET}" )
2023-02-10 06:45:05 +08:00
string ( REGEX MATCH "^([0-9]+)\\.([0-9]+)" VCPKG_OSX_DEPLOYMENT_TARGET "${VCPKG_OSX_DEPLOYMENT_TARGET}" )
2021-11-24 04:11:07 +08:00
message ( STATUS "Major.Minor OSX system Version: ${VCPKG_OSX_DEPLOYMENT_TARGET}" )
2023-02-10 06:45:05 +08:00
# Parse mkspecs/common/macx.conf
file ( READ "${SOURCE_PATH}/mkspecs/common/macx.conf" QT_MK_MAC_CONTENT )
string ( REGEX MATCHALL "QT_MAC_SDK_VERSION_MIN[ \t]*=[ \t]*(([0-9]+)(\\.([0-9]+))*)" KEY_VALUE "${QT_MK_MAC_CONTENT}" )
if ( ${ CMAKE_MATCH_COUNT } LESS 2 )
message ( FATAL_ERROR "Error parse QT_MAC_SDK_VERSION_MIN" )
endif ( )
set ( QT_MAC_SDK_VERSION_MIN "${CMAKE_MATCH_1}" )
string ( REGEX MATCHALL "QT_MAC_SDK_VERSION_MAX[ \t]*=[ \t]*(([0-9]+)(\\.([0-9]+))*)" KEY_VALUE "${QT_MK_MAC_CONTENT}" )
if ( ${ CMAKE_MATCH_COUNT } LESS 2 )
message ( FATAL_ERROR "Error parse QT_MAC_SDK_VERSION_MAX" )
endif ( )
set ( QT_MAC_SDK_VERSION_MAX "${CMAKE_MATCH_1}" )
message ( STATUS "QT_MAC_SDK_VERSION_MIN: ${QT_MAC_SDK_VERSION_MIN}" )
message ( STATUS "QT_MAC_SDK_VERSION_MAX: ${QT_MAC_SDK_VERSION_MAX}" )
# clamp(VCPKG_OSX_DEPLOYMENT_TARGET, QT_MAC_SDK_VERSION_MIN, QT_MAC_SDK_VERSION_MAX)
if ( "${VCPKG_OSX_DEPLOYMENT_TARGET}" VERSION_GREATER "${QT_MAC_SDK_VERSION_MAX}" )
set ( VCPKG_OSX_DEPLOYMENT_TARGET "${QT_MAC_SDK_VERSION_MAX}" )
2019-09-13 01:07:22 +08:00
endif ( )
2023-02-10 06:45:05 +08:00
if ( "${VCPKG_OSX_DEPLOYMENT_TARGET}" VERSION_LESS "${QT_MAC_SDK_VERSION_MIN}" )
set ( VCPKG_OSX_DEPLOYMENT_TARGET "${QT_MAC_SDK_VERSION_MIN}" )
endif ( )
2019-09-13 01:07:22 +08:00
set ( ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET} ${ VCPKG_OSX_DEPLOYMENT_TARGET } )
endif ( )
2023-02-10 06:45:05 +08:00
message ( STATUS "Enviromnent OSX SDK Version: $ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET}" )
file ( READ "${SOURCE_PATH}/mkspecs/common/macx.conf" _tmp_contents )
string ( REPLACE "QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13" "QMAKE_MACOSX_DEPLOYMENT_TARGET = ${VCPKG_OSX_DEPLOYMENT_TARGET}" _tmp_contents ${ _tmp_contents } )
file ( WRITE "${SOURCE_PATH}/mkspecs/common/macx.conf" ${ _tmp_contents } )
2019-09-13 01:07:22 +08:00
#list(APPEND QT_PLATFORM_CONFIGURE_OPTIONS HOST_PLATFORM ${TARGET_MKSPEC})
list ( APPEND RELEASE_OPTIONS
" S Q L I T E _ L I B S = $ { S Q L I T E _ R E L E A S E } - l d l - l p t h r e a d "
2021-04-07 01:53:41 +08:00
" H A R F B U Z Z _ L I B S = $ { h a r f b u z z _ L I B R A R I E S _ R E L E A S E } - f r a m e w o r k A p p l i c a t i o n S e r v i c e s "
2020-01-07 04:36:51 +08:00
" O P E N S S L _ L I B S = $ { S S L _ R E L E A S E } $ { E A Y _ R E L E A S E } - l d l - l p t h r e a d "
2020-04-10 08:08:01 +08:00
" F O N T C O N F I G _ L I B S = $ { F O N T C O N F I G _ R E L E A S E } $ { F R E E T Y P E _ R E L E A S E } $ { E X P A T _ R E L E A S E } - l i c o n v "
2019-09-13 01:07:22 +08:00
)
list ( APPEND DEBUG_OPTIONS
" S Q L I T E _ L I B S = $ { S Q L I T E _ D E B U G } - l d l - l p t h r e a d "
2021-04-07 01:53:41 +08:00
" H A R F B U Z Z _ L I B S = $ { h a r f b u z z _ L I B R A R I E S _ D E B U G } - f r a m e w o r k A p p l i c a t i o n S e r v i c e s "
2020-01-07 04:36:51 +08:00
" O P E N S S L _ L I B S = $ { S S L _ D E B U G } $ { E A Y _ D E B U G } - l d l - l p t h r e a d "
2020-04-10 08:08:01 +08:00
" F O N T C O N F I G _ L I B S = $ { F O N T C O N F I G _ D E B U G } $ { F R E E T Y P E _ D E B U G } $ { E X P A T _ D E B U G } - l i c o n v "
2019-09-13 01:07:22 +08:00
)
2021-03-17 03:00:13 +08:00
2021-04-07 01:53:41 +08:00
if ( WITH_PGSQL_PLUGIN )
2021-03-17 03:00:13 +08:00
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 ( )
2019-09-13 01:07:22 +08:00
endif ( )
2019-07-18 01:45:26 +08:00
2022-12-30 16:23:31 +08:00
if ( WITH_MYSQL_PLUGIN )
list ( APPEND RELEASE_OPTIONS "MYSQL_LIBS=${MYSQL_RELEASE} ${SSL_RELEASE} ${EAY_RELEASE} ${ZLIB_RELEASE} ${ADDITIONAL_WINDOWS_LIBS}" )
list ( APPEND DEBUG_OPTIONS "MYSQL_LIBS=${MYSQL_DEBUG} ${SSL_DEBUG} ${EAY_DEBUG} ${ZLIB_DEBUG} ${ADDITIONAL_WINDOWS_LIBS}" )
endif ( WITH_MYSQL_PLUGIN )
2019-09-13 01:07:22 +08:00
## Do not build tests or examples
list ( APPEND CORE_OPTIONS
- n o m a k e e x a m p l e s
- n o m a k e t e s t s )
2019-04-15 20:00:14 +08:00
2019-09-17 03:37:55 +08:00
if ( QT_UPDATE_VERSION )
SET ( VCPKG_POLICY_EMPTY_PACKAGE enabled )
else ( )
configure_qt (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
$ { Q T _ P L A T F O R M _ C O N F I G U R E _ O P T I O N S }
O P T I O N S $ { C O R E _ O P T I O N S }
O P T I O N S _ R E L E A S E $ { R E L E A S E _ O P T I O N S }
O P T I O N S _ D E B U G $ { D E B U G _ O P T I O N S }
)
install_qt ( )
2019-04-15 20:00:14 +08:00
2019-09-17 03:37:55 +08:00
#########################
#TODO: Make this a function since it is also done by modular scripts!
# e.g. by patching mkspecs/features/qt_tools.prf somehow
2021-01-12 12:49:05 +08:00
file ( GLOB_RECURSE PRL_FILES "${CURRENT_PACKAGES_DIR}/lib/*.prl" "${CURRENT_PACKAGES_DIR}/tools/qt5/lib/*.prl" "${CURRENT_PACKAGES_DIR}/tools/qt5/mkspecs/*.pri"
2019-09-17 03:37:55 +08:00
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / l i b / * . p r l " " $ { C U R R E N T _ P A C K A G E S _ D I R } / t o o l s / q t 5 / d e b u g / l i b / * . p r l " " $ { C U R R E N T _ P A C K A G E S _ D I R } / t o o l s / q t 5 / d e b u g / m k s p e c s / * . p r i " )
2019-04-15 20:00:14 +08:00
2019-09-17 03:37:55 +08:00
file ( TO_CMAKE_PATH "${CURRENT_INSTALLED_DIR}/include" CMAKE_INCLUDE_PATH )
2019-05-01 00:29:41 +08:00
2019-09-17 03:37:55 +08:00
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release" )
qt_fix_prl ( "${CURRENT_INSTALLED_DIR}" "${PRL_FILES}" )
file ( COPY ${ CMAKE_CURRENT_LIST_DIR } /qtdeploy.ps1 DESTINATION ${ CURRENT_PACKAGES_DIR } /plugins )
endif ( )
2019-09-13 01:07:22 +08:00
2019-09-17 03:37:55 +08:00
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" )
qt_fix_prl ( "${CURRENT_INSTALLED_DIR}/debug" "${PRL_FILES}" )
file ( COPY ${ CMAKE_CURRENT_LIST_DIR } /qtdeploy.ps1 DESTINATION ${ CURRENT_PACKAGES_DIR } /debug/plugins )
endif ( )
2019-04-15 20:00:14 +08:00
2019-09-17 03:37:55 +08:00
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /share )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /lib/cmake ${ CURRENT_PACKAGES_DIR } /share/cmake )
2021-01-12 12:49:05 +08:00
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/lib/cmake ) # TODO: check if important debug information for cmake is lost
2019-09-13 01:07:22 +08:00
2021-01-12 12:49:05 +08:00
#This needs a new VCPKG policy or a static angle build (ANGLE needs to be fixed in VCPKG!)
if ( VCPKG_TARGET_IS_WINDOWS AND ${ VCPKG_LIBRARY_LINKAGE } MATCHES "static" ) # Move angle dll libraries
2020-01-07 04:36:51 +08:00
if ( EXISTS "${CURRENT_PACKAGES_DIR}/bin" )
2020-04-24 12:19:45 +08:00
message ( STATUS "Moving ANGLE dlls from /bin to /tools/qt5-angle/bin. In static builds dlls are not allowed in /bin" )
2020-01-07 04:36:51 +08:00
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /tools/qt5-angle )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /bin ${ CURRENT_PACKAGES_DIR } /tools/qt5-angle/bin )
if ( EXISTS ${ CURRENT_PACKAGES_DIR } /debug/bin )
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /tools/qt5-angle/debug )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /debug/bin ${ CURRENT_PACKAGES_DIR } /tools/qt5-angle/debug/bin )
endif ( )
2019-09-17 03:37:55 +08:00
endif ( )
2019-09-13 01:07:22 +08:00
endif ( )
2019-04-15 20:00:14 +08:00
2020-04-10 08:08:01 +08:00
## Fix location of qtmain(d).lib. Has been moved into manual-link. Add debug version
2020-04-24 12:19:45 +08:00
set ( cmakefile "${CURRENT_PACKAGES_DIR}/share/cmake/Qt5Core/Qt5CoreConfigExtras.cmake" )
file ( READ "${cmakefile}" _contents )
2020-04-10 08:08:01 +08:00
if ( VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_BUILD_TYPE )
string ( REPLACE "set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)" "set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)" _contents "${_contents}" )
2021-01-12 12:49:05 +08:00
string ( REPLACE
[ [ set ( imported_location "${_qt5Core_install_prefix}/lib/qtmain.lib" ) ] ]
2020-04-10 08:08:01 +08:00
[ [ set ( imported_location_release "${_qt5Core_install_prefix}/lib/manual-link/qtmain.lib" )
2021-01-12 12:49:05 +08:00
set ( imported_location_debug "${_qt5Core_install_prefix}/debug/lib/manual-link/qtmaind.lib" ) ] ]
2020-04-10 08:08:01 +08:00
_ c o n t e n t s " $ { _ c o n t e n t s } " )
2021-01-12 12:49:05 +08:00
string ( REPLACE
2020-04-10 08:08:01 +08:00
[ [ set_target_properties ( Qt5::WinMain PROPERTIES
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { i m p o r t e d _ l o c a t i o n }
2021-01-12 12:49:05 +08:00
) ] ]
2020-04-10 08:08:01 +08:00
[ [ set_target_properties ( Qt5::WinMain PROPERTIES
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { i m p o r t e d _ l o c a t i o n _ r e l e a s e }
I M P O R T E D _ L O C A T I O N _ D E B U G $ { i m p o r t e d _ l o c a t i o n _ d e b u g }
2021-01-12 12:49:05 +08:00
) ] ]
2020-04-10 08:08:01 +08:00
_ c o n t e n t s " $ { _ c o n t e n t s } " )
2020-04-24 12:19:45 +08:00
else ( ) # Single configuration build (either debug or release)
# Release case
2021-01-12 12:49:05 +08:00
string ( REPLACE
2020-04-24 12:19:45 +08:00
[ [ set ( imported_location "${_qt5Core_install_prefix}/lib/qtmain.lib" ) ] ]
[ [ set ( imported_location "${_qt5Core_install_prefix}/lib/manual-link/qtmain.lib" ) ] ]
_ c o n t e n t s " $ { _ c o n t e n t s } " )
# Debug case (whichever will match)
2021-01-12 12:49:05 +08:00
string ( REPLACE
2020-04-24 12:19:45 +08:00
[ [ set ( imported_location "${_qt5Core_install_prefix}/lib/qtmaind.lib" ) ] ]
[ [ set ( imported_location "${_qt5Core_install_prefix}/debug/lib/manual-link/qtmaind.lib" ) ] ]
_ c o n t e n t s " $ { _ c o n t e n t s } " )
2021-01-12 12:49:05 +08:00
string ( REPLACE
2020-04-24 12:19:45 +08:00
[ [ set ( imported_location "${_qt5Core_install_prefix}/debug/lib/qtmaind.lib" ) ] ]
[ [ set ( imported_location "${_qt5Core_install_prefix}/debug/lib/manual-link/qtmaind.lib" ) ] ]
_ c o n t e n t s " $ { _ c o n t e n t s } " )
2020-04-10 08:08:01 +08:00
endif ( )
2020-04-24 12:19:45 +08:00
file ( WRITE "${cmakefile}" "${_contents}" )
2019-09-17 03:37:55 +08:00
if ( EXISTS ${ CURRENT_PACKAGES_DIR } /tools/qt5/bin )
file ( COPY ${ CURRENT_PACKAGES_DIR } /tools/qt5/bin DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } )
vcpkg_copy_tool_dependencies ( ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } /bin )
vcpkg_copy_tool_dependencies ( ${ CURRENT_PACKAGES_DIR } /tools/qt5/bin )
endif ( )
2020-04-24 12:19:45 +08:00
# This should be removed if possible! (Currently debug build of qt5-translations requires it.)
if ( EXISTS ${ CURRENT_PACKAGES_DIR } /debug/tools/qt5/bin )
file ( COPY ${ CURRENT_PACKAGES_DIR } /tools/qt5/bin DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/qt5/debug )
vcpkg_copy_tool_dependencies ( ${ CURRENT_PACKAGES_DIR } /tools/qt5/debug/bin )
endif ( )
2021-01-12 12:49:05 +08:00
2019-09-21 05:06:43 +08:00
if ( EXISTS ${ CURRENT_PACKAGES_DIR } /tools/qt5/bin/qt.conf )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/tools/qt5/bin/qt.conf" )
endif ( )
2020-04-10 08:08:01 +08:00
set ( CURRENT_INSTALLED_DIR_BACKUP "${CURRENT_INSTALLED_DIR}" )
set ( CURRENT_INSTALLED_DIR "./../../.." ) # Making the qt.conf relative and not absolute
configure_file ( ${ CURRENT_PACKAGES_DIR } /tools/qt5/qt_release.conf ${ CURRENT_PACKAGES_DIR } /tools/qt5/bin/qt.conf ) # This makes the tools at least useable for release
set ( CURRENT_INSTALLED_DIR "${CURRENT_INSTALLED_DIR_BACKUP}" )
2021-01-12 12:49:05 +08:00
2019-09-17 03:37:55 +08:00
qt_install_copyright ( ${ SOURCE_PATH } )
endif ( )
2019-09-13 01:07:22 +08:00
#install scripts for other qt ports
file ( COPY
$ { C M A K E _ C U R R E N T _ L I S T _ D I R } / c m a k e / q t _ p o r t _ h a s h e s . c m a k e
$ { C M A K E _ C U R R E N T _ L I S T _ D I R } / c m a k e / q t _ p o r t _ f u n c t i o n s . c m a k e
$ { C M A K E _ C U R R E N T _ L I S T _ D I R } / c m a k e / q t _ f i x _ m a k e f i l e _ i n s t a l l . c m a k e
$ { C M A K E _ C U R R E N T _ L I S T _ D I R } / c m a k e / q t _ f i x _ c m a k e . c m a k e
$ { C M A K E _ C U R R E N T _ L I S T _ D I R } / c m a k e / q t _ f i x _ p r l . c m a k e
$ { C M A K E _ C U R R E N T _ L I S T _ D I R } / c m a k e / q t _ d o w n l o a d _ s u b m o d u l e . c m a k e
$ { C M A K E _ C U R R E N T _ L I S T _ D I R } / c m a k e / q t _ b u i l d _ s u b m o d u l e . c m a k e
$ { C M A K E _ C U R R E N T _ L I S T _ D I R } / c m a k e / q t _ i n s t a l l _ c o p y r i g h t . c m a k e
$ { C M A K E _ C U R R E N T _ L I S T _ D I R } / c m a k e / q t _ s u b m o d u l e _ i n s t a l l a t i o n . c m a k e
D E S T I N A T I O N
$ { C U R R E N T _ P A C K A G E S _ D I R } / s h a r e / q t 5
)
2019-09-24 05:47:08 +08:00
2020-04-07 05:03:16 +08:00
# Fix Qt5GuiConfigExtras EGL path
if ( VCPKG_TARGET_IS_LINUX )
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}" )
file ( WRITE "${_file}" "${_contents}" )
endif ( )
2021-11-26 15:26:56 +08:00
vcpkg_fixup_pkgconfig ( )
2021-12-17 01:00:16 +08:00
if ( VCPKG_TARGET_IS_OSX )
file ( GLOB _debug_files "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/*_debug.pc" )
foreach ( _file ${ _debug_files } )
string ( REGEX REPLACE "_debug\\.pc$" ".pc" _new_filename "${_file}" )
string ( REGEX MATCH "(Qt5[a-zA-Z]+)_debug\\.pc$" _not_used "${_file}" )
set ( _name ${ CMAKE_MATCH_1 } )
file ( STRINGS "${_file}" _version REGEX "^(Version):.+$" )
file ( WRITE "${_new_filename}" "Name: ${_name}\nDescription: Forwarding to the _debug version by vcpkg\n${_version}\nRequires: ${_name}_debug\n" )
endforeach ( )
endif ( )
2021-01-12 12:49:05 +08:00
# #Code to get generated CMake files from CI
2020-04-24 12:19:45 +08:00
# file(RENAME "${CURRENT_PACKAGES_DIR}/share/cmake/Qt5Core/Qt5CoreConfig.cmake" "${CURRENT_BUILDTREES_DIR}/Qt5CoreConfig.cmake.log")
# file(GLOB_RECURSE CMAKE_GUI_FILES "${CURRENT_PACKAGES_DIR}/share/cmake/Qt5Gui/*.cmake" )
# foreach(cmake_file ${CMAKE_GUI_FILES})
# get_filename_component(cmake_filename "${cmake_file}" NAME)
# file(COPY "${cmake_file}" DESTINATION "${CURRENT_BUILDTREES_DIR}")
# file(RENAME "${CURRENT_BUILDTREES_DIR}/${cmake_filename}" "${CURRENT_BUILDTREES_DIR}/${cmake_filename}.log")
# endforeach()
# #Copy config.log from buildtree/triplet to buildtree to get the log in CI in case of failure
# if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/config.log")
# file(RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/config.log" "${CURRENT_BUILDTREES_DIR}/config-rel.log")
# endif()
# if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/config.log")
# file(RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/config.log" "${CURRENT_BUILDTREES_DIR}/config-dbg.log")
# endif()
# message(FATAL_ERROR "Need Info from CI!")