2021-10-01 04:03:56 +08:00
set ( SCRIPT_PATH "${CURRENT_INSTALLED_DIR}/share/qtbase" )
include ( "${SCRIPT_PATH}/qt_install_submodule.cmake" )
2023-12-14 09:36:03 +08:00
set ( ${ PORT } _PATCHES
" c l a n g - c l . p a t c h "
)
2022-07-02 06:48:36 +08:00
2024-05-09 02:45:05 +08:00
set ( TOOL_NAMES gn QtWebEngineProcess qwebengine_convert_dict webenginedriver )
2021-10-01 04:03:56 +08:00
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 ( )
2023-12-14 09:36:03 +08:00
set ( enabled_features webengine_webrtc )
2022-02-16 12:24:55 +08:00
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
2023-10-28 02:18:22 +08:00
x_vcpkg_get_python_packages ( PYTHON_VERSION "3" PACKAGES html5lib OUT_PYTHON_VAR PYTHON3 )
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 }
2023-10-28 02:18:22 +08:00
- D P y t h o n 3 _ E X E C U T A B L E = $ { P Y T H O N 3 }
2023-04-27 03:10:56 +08:00
- D Q T _ F E A T U R E _ w e b e n g i n e _ j u m b o _ b u i l d = 0
2021-10-01 04:03:56 +08:00
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 } )
2024-05-01 02:50:26 +08:00
if ( VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_BUILD_TYPE )
file ( MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/debug/" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/QtWebEngineProcessd.exe" "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/debug/QtWebEngineProcessd.exe" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/QtWebEngineProcessd.pdb" "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/debug/QtWebEngineProcessd.pdb" )
endif ( )
2021-10-01 04:03:56 +08:00
qt_install_copyright ( "${SOURCE_PATH}" )
##### qt_install_submodule