2021-12-07 12:46:28 +08:00
set ( SCRIPT_PATH "${CURRENT_INSTALLED_DIR}/share/qtbase" )
include ( "${SCRIPT_PATH}/qt_install_submodule.cmake" )
function ( vcpkg_get_python_package PYTHON_DIR ) # From mesa
cmake_parse_arguments ( PARSE_ARGV 0 _vgpp "" "PYTHON_EXECUTABLE" "PACKAGES" )
if ( NOT _vgpp_PYTHON_EXECUTABLE )
message ( FATAL_ERROR "${CMAKE_CURRENT_FUNCTION} requires parameter PYTHON_EXECUTABLE!" )
endif ( )
if ( NOT _vgpp_PACKAGES )
message ( FATAL_ERROR "${CMAKE_CURRENT_FUNCTION} requires parameter PACKAGES!" )
endif ( )
if ( NOT _vgpp_PYTHON_DIR )
get_filename_component ( _vgpp_PYTHON_DIR "${_vgpp_PYTHON_EXECUTABLE}" DIRECTORY )
endif ( )
if ( WIN32 )
set ( PYTHON_OPTION "" )
else ( )
set ( PYTHON_OPTION "--user" )
endif ( )
if ( "${_vgpp_PYTHON_DIR}" MATCHES "${DOWNLOADS}" ) # inside vcpkg
if ( NOT EXISTS "${_vgpp_PYTHON_DIR}/easy_install${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
if ( NOT EXISTS "${_vgpp_PYTHON_DIR}/Scripts/pip${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
vcpkg_from_github (
O U T _ S O U R C E _ P A T H P Y F I L E _ P A T H
R E P O p y p a / g e t - p i p
R E F 3 0 9 a 5 6 c 5 f d 9 4 b d 1 1 3 4 0 5 3 a 5 4 1 c b 4 6 5 7 a 4 e 4 7 e 0 9 d #2019-08-25
S H A 5 1 2 b b 4 b 0 7 4 5 9 9 8 a 3 2 0 5 c d 0 f 0 9 6 3 c 0 4 f b 4 5 f 4 6 1 4 b a 3 b 6 f c b e 9 7 e f e 8 f 8 6 1 4 1 9 2 f 2 4 4 b 7 a e 6 2 7 0 5 4 8 3 a 5 3 0 5 9 4 3 d 6 c 8 f e d e c a 5 3 b 2 e 9 9 0 5 a e d 9 1 8 d 2 c 6 1 0 6 f 8 a 9 6 8 0 1 8 4 c 7 a
H E A D _ R E F m a s t e r
)
execute_process ( COMMAND "${_vgpp_PYTHON_EXECUTABLE}" "${PYFILE_PATH}/get-pip.py" ${ PYTHON_OPTION } )
endif ( )
foreach ( _package IN LISTS _vgpp_PACKAGES )
execute_process ( COMMAND "${_vgpp_PYTHON_DIR}/Scripts/pip${VCPKG_HOST_EXECUTABLE_SUFFIX}" install ${ _package } ${ PYTHON_OPTION } )
endforeach ( )
else ( )
foreach ( _package IN LISTS _vgpp_PACKAGES )
execute_process ( COMMAND "${_vgpp_PYTHON_DIR}/easy_install${VCPKG_HOST_EXECUTABLE_SUFFIX}" ${ _package } )
endforeach ( )
endif ( )
if ( NOT VCPKG_TARGET_IS_WINDOWS )
execute_process ( COMMAND pip3 install ${ _vgpp_PACKAGES } )
endif ( )
else ( ) # outside vcpkg
foreach ( _package IN LISTS _vgpp_PACKAGES )
execute_process ( COMMAND ${ _vgpp_PYTHON_EXECUTABLE } -c "import ${_package}" RESULT_VARIABLE HAS_ERROR )
if ( HAS_ERROR )
message ( FATAL_ERROR "Python package '${_package}' needs to be installed for port '${PORT}'.\nComplete list of required python packages: ${_vgpp_PACKAGES}" )
endif ( )
endforeach ( )
endif ( )
endfunction ( )
set ( ${ PORT } _PATCHES fix-taglib-search.patch ) # Strictly this is only required if qt does not use pkg-config since it forces it to off.
set ( TOOL_NAMES
i f m e d i a - s i m u l a t i o n - s e r v e r
i f v e h i c l e f u n c t i o n s - s i m u l a t i o n - s e r v e r
)
qt_download_submodule ( PATCHES ${ ${PORT } _PATCHES} )
if ( QT_UPDATE_VERSION )
return ( )
endif ( )
if ( _qis_DISABLE_NINJA )
set ( _opt DISABLE_NINJA )
endif ( )
vcpkg_find_acquire_program ( PKGCONFIG )
vcpkg_find_acquire_program ( PYTHON3 )
get_filename_component ( PYTHON3_DIR "${PYTHON3}" DIRECTORY )
vcpkg_add_to_path ( PREPEND "${PYTHON3_DIR}" )
vcpkg_add_to_path ( PREPEND "${PYTHON3_DIR}/Scripts" )
vcpkg_get_python_package ( PYTHON_EXECUTABLE "${PYTHON3}" PACKAGES virtualenv qface )
2022-03-15 01:25:04 +08:00
if ( VCPKG_CROSSCOMPILING )
list ( APPEND FEATURE_OPTIONS "-DVCPKG_HOST_TRIPLET=${_HOST_TRIPLET}" )
endif ( )
2021-12-07 12:46:28 +08:00
set ( qt_plugindir ${ QT6_DIRECTORY_PREFIX } plugins )
set ( qt_qmldir ${ QT6_DIRECTORY_PREFIX } qml )
qt_cmake_configure ( ${ _opt }
O P T I O N S $ { F E A T U R E _ O P T I O N S }
" - 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 } " # Otherwise a VS installation might be found.
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-12-07 12:46:28 +08:00
qt_fixup_and_cleanup ( TOOL_NAMES ${ TOOL_NAMES } )
qt_install_copyright ( "${SOURCE_PATH}" )
if ( NOT VCPKG_CROSSCOMPILING )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin/ifcodegen" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/bin/ifcodegen" "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/ifcodegen" )
endif ( )