2021-10-01 04:03:56 +08:00
set ( SCRIPT_PATH "${CURRENT_INSTALLED_DIR}/share/qtbase" )
include ( "${SCRIPT_PATH}/qt_install_submodule.cmake" )
2022-11-24 05:22:59 +08:00
set ( ${ PORT } _PATCHES
2023-03-20 15:16:58 +08:00
)
2022-07-02 06:48:36 +08:00
2021-10-01 04:03:56 +08:00
set ( TOOL_NAMES gn QtWebEngineProcess qwebengine_convert_dict )
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
F E A T U R E S
2022-02-16 12:24:55 +08:00
" p r o p r i e t a r y - c o d e c s " F E A T U R E _ w e b e n g i n e _ p r o p r i e t a r y _ c o d e c s
" s p e l l c h e c k e r " F E A T U R E _ w e b e n g i n e _ s p e l l c h e c k e r
" g e o l o c a t i o n " F E A T U R E _ w e b e n g i n e _ g e o l o c a t i o n
" w e b c h a n n e l " F E A T U R E _ w e b e n g i n e _ w e b c h a n n e l
2022-03-24 03:19:54 +08:00
" g e o l o c a t i o n " C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ Q t 6 P o s i t i o n i n g
" w e b c h a n n e l " C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ Q t 6 W e b C h a n n e l
2021-10-01 04:03:56 +08:00
I N V E R T E D _ F E A T U R E S
" g e o l o c a t i o n " C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ Q t 6 P o s i t i o n i n g
" w e b c h a n n e l " C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ Q t 6 W e b C h a n n e l
)
if ( VCPKG_TARGET_IS_OSX AND "spellchecker" IN_LIST FEATRUES )
2022-02-16 12:24:55 +08:00
list ( APPEND FEATURE_OPTIONS "-DFEATURE_webengine_native_spellchecker=ON" )
2021-10-01 04:03:56 +08:00
endif ( )
# webengine-extensions
# webengine-printing-and-pdf
# webengine-pepper-plugins
2022-02-16 12:24:55 +08:00
set ( deactivated_features webengine_webrtc_pipewire )
2021-10-01 04:03:56 +08:00
foreach ( _feat IN LISTS deactivated_features )
list ( APPEND FEATURE_OPTIONS "-DFEATURE_${_feat}=OFF" )
endforeach ( )
2022-02-16 12:24:55 +08:00
set ( enabled_features webengine_webrtc webengine_v8_snapshot_support )
foreach ( _feat IN LISTS enabled_features )
list ( APPEND FEATURE_OPTIONS "-DFEATURE_${_feat}=ON" )
endforeach ( )
2021-10-01 04:03:56 +08:00
if ( VCPKG_TARGET_IS_LINUX )
# qt_configure_add_summary_entry(ARGS "webengine-system-lcms2")
# qt_configure_add_summary_entry(ARGS "webengine-system-libpci")
# + ALSA and PULSEAUDIO
set ( system_libs re2 icu libwebp opus ffmpeg libvpx snappy glib zlib minizip libevent protobuf libxml libpng libjpeg harfbuzz freetype )
foreach ( _sys_lib IN LISTS system_libs )
2022-02-16 12:24:55 +08:00
list ( APPEND FEATURE_OPTIONS "-DFEATURE_webengine_system_${_sys_lib}=ON" )
2021-10-01 04:03:56 +08:00
endforeach ( )
endif ( )
vcpkg_find_acquire_program ( FLEX )
vcpkg_find_acquire_program ( BISON )
#vcpkg_find_acquire_program(GN) # Qt builds its own internal version
find_program ( NODEJS NAMES node PATHS "${CURRENT_HOST_INSTALLED_DIR}/tools/node" "bin" NO_DEFAULT_PATHS )
find_program ( NODEJS NAMES node )
if ( NOT NODEJS )
message ( FATAL_ERROR "node not found! Please install it via your system package manager!" )
endif ( )
get_filename_component ( NODEJS_DIR "${NODEJS}" DIRECTORY )
vcpkg_add_to_path ( PREPEND "${NODEJS_DIR}" )
get_filename_component ( FLEX_DIR "${FLEX}" DIRECTORY )
vcpkg_add_to_path ( PREPEND "${FLEX_DIR}" )
get_filename_component ( BISON_DIR "${BISON}" DIRECTORY )
vcpkg_add_to_path ( PREPEND "${BISON_DIR}" )
2022-04-22 02:42:59 +08:00
2022-07-02 06:48:36 +08:00
vcpkg_find_acquire_program ( PYTHON3 )
x_vcpkg_get_python_packages ( PYTHON_EXECUTABLE "${PYTHON3}" PACKAGES html5lib )
2021-10-01 04:03:56 +08:00
2022-06-02 08:13:53 +08:00
vcpkg_add_to_path ( PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/gperf" )
set ( GPERF "${CURRENT_HOST_INSTALLED_DIR}/tools/gperf/gperf${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
2021-10-01 04:03:56 +08:00
if ( WIN32 ) # WIN32 HOST probably has win_flex and win_bison!
if ( NOT EXISTS "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
file ( CREATE_LINK "${FLEX}" "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
endif ( )
if ( NOT EXISTS "${BISON_DIR}/BISON${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
file ( CREATE_LINK "${BISON}" "${BISON_DIR}/bison${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
endif ( )
endif ( )
2022-05-05 07:09:42 +08:00
string ( LENGTH "${CURRENT_BUILDTREES_DIR}" buildtree_length )
2022-11-24 05:22:59 +08:00
# We know that C:/buildrees/${PORT} is to long to build Release. Debug works however. Means 24 length is too much but 23 might work.
2022-10-12 16:21:25 +08:00
if ( buildtree_length GREATER 22 AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "arm64" )
2022-05-05 07:09:42 +08:00
message ( WARNING "Buildtree path '${CURRENT_BUILDTREES_DIR}' is too long.\nConsider passing --x-buildtrees-root=<shortpath> to vcpkg!\nTrying to use '${CURRENT_BUILDTREES_DIR}/../tmp'" )
set ( CURRENT_BUILDTREES_DIR "${CURRENT_BUILDTREES_DIR}/../tmp" ) # activly avoid long path issues in CI. -> Means CI will not return logs
cmake_path ( NORMAL_PATH CURRENT_BUILDTREES_DIR )
string ( LENGTH "${CURRENT_BUILDTREES_DIR}" buildtree_length_new )
if ( buildtree_length_new GREATER 22 )
message ( FATAL_ERROR "Buildtree path is too long. Build will fail! Pass --x-buildtrees-root=<shortpath> to vcpkg!" )
endif ( )
file ( MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}" )
endif ( )
2022-04-22 02:42:59 +08:00
2021-10-01 04:03:56 +08:00
##### qt_install_submodule
set ( qt_plugindir ${ QT6_DIRECTORY_PREFIX } plugins )
set ( qt_qmldir ${ QT6_DIRECTORY_PREFIX } qml )
qt_download_submodule ( PATCHES ${ ${PORT } _PATCHES} )
if ( QT_UPDATE_VERSION )
return ( )
endif ( )
2022-11-24 05:22:59 +08:00
qt_cmake_configure ( DISABLE_PARALLEL_CONFIGURE # due to in source changes.
2022-02-16 12:24:55 +08:00
O P T I O N S $ { F E A T U R E _ O P T I O N S }
2021-10-01 04:03:56 +08:00
- D G P e r f _ E X E C U T A B L E = $ { G P E R F }
- D B I S O N _ E X E C U T A B L E = $ { B I S O N }
- D F L E X _ E X E C U T A B L E = $ { F L E X }
- D N o d e j s _ E X E C U T A B L E = $ { N O D E J S }
O P T I O N S _ D E B U G $ { _ q i s _ C O N F I G U R E _ O P T I O N S _ D E B U G }
O P T I O N S _ R E L E A S E $ { _ q i s _ C O N F I G U R E _ O P T I O N S _ R E L E A S E } )
2022-02-16 12:24:55 +08:00
vcpkg_cmake_install ( ADD_BIN_TO_PATH )
2021-10-01 04:03:56 +08:00
qt_fixup_and_cleanup ( TOOL_NAMES ${ TOOL_NAMES } )
qt_install_copyright ( "${SOURCE_PATH}" )
##### qt_install_submodule