2022-07-02 06:48:36 +08:00
include_guard ( GLOBAL )
2022-02-16 12:24:55 +08:00
include ( "${CURRENT_HOST_INSTALLED_DIR}/share/vcpkg-cmake/vcpkg-port-config.cmake" )
include ( "${CURRENT_HOST_INSTALLED_DIR}/share/vcpkg-cmake-config/vcpkg-port-config.cmake" )
2021-06-02 02:05:59 +08:00
include ( "${CMAKE_CURRENT_LIST_DIR}/qt_install_copyright.cmake" )
if ( NOT DEFINED QT6_DIRECTORY_PREFIX )
2021-06-22 04:45:33 +08:00
set ( QT6_DIRECTORY_PREFIX "Qt6/" )
2021-06-02 02:05:59 +08:00
endif ( )
2022-11-02 10:58:54 +08:00
if ( VCPKG_TARGET_IS_ANDROID AND NOT ANDROID_SDK_ROOT )
message ( FATAL_ERROR "${PORT} requires ANDROID_SDK_ROOT to be set. Consider adding it to the triplet." )
endif ( )
2024-11-28 19:36:00 +08:00
if ( VCPKG_TARGET_IS_OSX AND ( NOT VCPKG_OSX_DEPLOYMENT_TARGET OR VCPKG_OSX_DEPLOYMENT_TARGET VERSION_GREATER_EQUAL "15.0" ) )
message ( WARNING "Qt6 does not yet cleanly support macOS 15.0, consider adding set(VCPKG_OSX_DEPLOYMENT_TARGET 14.0) or earlier to a custom triplet (https://learn.microsoft.com/en-us/vcpkg/users/examples/overlay-triplets-linux-dynamic#overriding-default-triplets)." )
endif ( )
2022-07-02 06:48:36 +08:00
function ( qt_download_submodule_impl )
cmake_parse_arguments ( PARSE_ARGV 0 "_qarg" "" "SUBMODULE" "PATCHES" )
if ( "${_qarg_SUBMODULE}" IN_LIST QT_FROM_QT_GIT )
# qtinterfaceframework is not available in the release, so we fall back to a `git clone`.
vcpkg_from_git (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
U R L " h t t p s : / / c o d e . q t . i o / q t / $ { _ q a r g _ S U B M O D U L E } . g i t "
R E F " $ { $ { _ q a r g _ S U B M O D U L E } _ R E F } "
P A T C H E S $ { _ q a r g _ P A T C H E S }
)
2022-11-19 04:31:51 +08:00
if ( PORT STREQUAL "qttools" ) # Keep this for beta & rc's
vcpkg_from_git (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H _ Q L I T E H T M L
2024-06-21 11:19:25 +08:00
U R L h t t p s : / / c o d e . q t . i o / p l a y g r o u n d / q l i t e h t m l . g i t
2022-11-19 04:31:51 +08:00
R E F " $ { $ { P O R T } _ q l i t e h t m l _ R E F } "
F E T C H _ R E F m a s t e r
H E A D _ R E F m a s t e r
)
# port 'litehtml' is not in vcpkg!
vcpkg_from_github (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H _ L I T E H T M L
R E P O l i t e h t m l / l i t e h t m l
R E F " $ { $ { P O R T } _ l i t e h t m l _ R E F } "
S H A 5 1 2 " $ { $ { P O R T } _ l i t e h t m l _ H A S H } "
H E A D _ R E F m a s t e r
)
file ( COPY "${SOURCE_PATH_QLITEHTML}/" DESTINATION "${SOURCE_PATH}/src/assistant/qlitehtml" )
file ( COPY "${SOURCE_PATH_LITEHTML}/" DESTINATION "${SOURCE_PATH}/src/assistant/qlitehtml/src/3rdparty/litehtml" )
elseif ( PORT STREQUAL "qtwebengine" )
vcpkg_from_git (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H _ W E B E N G I N E
2024-06-21 11:19:25 +08:00
U R L h t t p s : / / c o d e . q t . i o / q t / q t w e b e n g i n e - c h r o m i u m . g i t
2022-11-19 04:31:51 +08:00
R E F " $ { $ { P O R T } _ c h r o m i u m _ R E F } "
)
if ( NOT EXISTS "${SOURCE_PATH}/src/3rdparty/chromium" )
file ( RENAME "${SOURCE_PATH_WEBENGINE}/chromium" "${SOURCE_PATH}/src/3rdparty/chromium" )
endif ( )
if ( NOT EXISTS "${SOURCE_PATH}/src/3rdparty/gn" )
file ( RENAME "${SOURCE_PATH_WEBENGINE}/gn" "${SOURCE_PATH}/src/3rdparty/gn" )
endif ( )
endif ( )
2022-07-02 06:48:36 +08:00
else ( )
if ( VCPKG_USE_HEAD_VERSION )
set ( sha512 SKIP_SHA512 )
elseif ( NOT DEFINED "${_qarg_SUBMODULE}_HASH" )
message ( FATAL_ERROR "No information for ${_qarg_SUBMODULE} -- add it to QT_PORTS and run qtbase in QT_UPDATE_VERSION mode first" )
else ( )
set ( sha512 SHA512 "${${_qarg_SUBMODULE}_HASH}" )
endif ( )
2023-11-15 05:03:37 +08:00
qt_get_url_filename ( "${_qarg_SUBMODULE}" urls filename )
2022-07-02 06:48:36 +08:00
vcpkg_download_distfile ( archive
2023-11-15 05:03:37 +08:00
U R L S $ { u r l s }
2022-07-02 06:48:36 +08:00
F I L E N A M E " $ { f i l e n a m e } "
$ { s h a 5 1 2 }
)
vcpkg_extract_source_archive (
S O U R C E _ P A T H
A R C H I V E " $ { a r c h i v e } "
P A T C H E S $ { _ q a r g _ P A T C H E S }
)
2021-06-02 02:05:59 +08:00
endif ( )
2022-07-02 06:48:36 +08:00
set ( SOURCE_PATH "${SOURCE_PATH}" PARENT_SCOPE )
endfunction ( )
2021-06-02 02:05:59 +08:00
2021-09-14 06:18:29 +08:00
function ( qt_download_submodule )
2022-07-02 06:48:36 +08:00
cmake_parse_arguments ( PARSE_ARGV 0 "_qarg" "" "" "PATCHES" )
2021-06-02 02:05:59 +08:00
2022-07-02 06:48:36 +08:00
qt_download_submodule_impl ( SUBMODULE "${PORT}" PATCHES ${ _qarg_PATCHES } )
2021-06-02 02:05:59 +08:00
2021-09-14 06:18:29 +08:00
set ( SOURCE_PATH "${SOURCE_PATH}" PARENT_SCOPE )
endfunction ( )
function ( qt_cmake_configure )
2022-02-16 12:24:55 +08:00
cmake_parse_arguments ( PARSE_ARGV 0 "_qarg" "DISABLE_NINJA;DISABLE_PARALLEL_CONFIGURE"
2021-09-14 06:18:29 +08:00
" "
2022-02-16 12:24:55 +08:00
" T O O L _ N A M E S ; O P T I O N S ; 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 ; O P T I O N S _ M A Y B E _ U N U S E D " )
2022-11-04 05:12:05 +08:00
2021-09-14 06:18:29 +08:00
vcpkg_find_acquire_program ( PERL ) # Perl is probably required by all qt ports for syncqt
get_filename_component ( PERL_PATH ${ PERL } DIRECTORY )
vcpkg_add_to_path ( ${ PERL_PATH } )
2022-04-22 02:42:59 +08:00
if ( NOT PORT STREQUAL "qtwebengine" OR QT_IS_LATEST ) # qtwebengine requires python2; since 6.3 python3
2021-09-14 06:18:29 +08:00
vcpkg_find_acquire_program ( PYTHON3 ) # Python is required by some qt ports
get_filename_component ( PYTHON3_PATH ${ PYTHON3 } DIRECTORY )
vcpkg_add_to_path ( ${ PYTHON3_PATH } )
2021-06-02 02:05:59 +08:00
endif ( )
2022-02-16 12:24:55 +08:00
if ( NOT PORT MATCHES "^qtbase" )
list ( APPEND _qarg_OPTIONS "-DQT_SYNCQT:PATH=${CURRENT_HOST_INSTALLED_DIR}/tools/Qt6/bin/syncqt.pl" )
2021-06-02 02:05:59 +08:00
endif ( )
2022-02-16 12:24:55 +08:00
set ( PERL_OPTION "-DHOST_PERL:PATH=${PERL}" )
2021-06-02 02:05:59 +08:00
2022-02-16 12:24:55 +08:00
set ( ninja_option "" )
if ( _qarg_DISABLE_NINJA )
set ( ninja_option WINDOWS_USE_MSBUILD )
endif ( )
2022-11-04 05:12:05 +08:00
2022-02-16 12:24:55 +08:00
set ( disable_parallel "" )
if ( _qarg_DISABLE_PARALLEL_CONFIGURE )
set ( disable_parallel DISABLE_PARALLEL_CONFIGURE )
2021-06-02 02:05:59 +08:00
endif ( )
if ( VCPKG_CROSSCOMPILING )
2022-02-16 12:24:55 +08:00
list ( APPEND _qarg_OPTIONS "-DQT_HOST_PATH=${CURRENT_HOST_INSTALLED_DIR}" )
list ( APPEND _qarg_OPTIONS "-DQT_HOST_PATH_CMAKE_DIR:PATH=${CURRENT_HOST_INSTALLED_DIR}/share" )
2021-06-02 02:05:59 +08:00
endif ( )
2022-03-24 03:19:54 +08:00
# Disable warning for CMAKE_(REQUIRE|DISABLE)_FIND_PACKAGE_<packagename>
2022-02-16 12:24:55 +08:00
string ( REGEX MATCHALL "CMAKE_DISABLE_FIND_PACKAGE_[^:=]+" disabled_find_package "${_qarg_OPTIONS}" )
list ( APPEND _qarg_OPTIONS_MAYBE_UNUSED ${ disabled_find_package } )
2022-03-24 03:19:54 +08:00
string ( REGEX MATCHALL "CMAKE_REQUIRE_FIND_PACKAGE_[^:=]+(:BOOL)?=OFF" require_find_package "${_qarg_OPTIONS}" )
list ( TRANSFORM require_find_package REPLACE "(:BOOL)?=OFF" "" )
list ( APPEND _qarg_OPTIONS_MAYBE_UNUSED ${ require_find_package } )
2022-11-04 05:12:05 +08:00
# Disable unused warnings for disabled features. Qt might decide to not emit the feature variables if other features are deactivated.
2022-02-16 12:24:55 +08:00
string ( REGEX MATCHALL "(QT_)?FEATURE_[^:=]+(:BOOL)?=OFF" disabled_features "${_qarg_OPTIONS}" )
list ( TRANSFORM disabled_features REPLACE "(:BOOL)?=OFF" "" )
list ( APPEND _qarg_OPTIONS_MAYBE_UNUSED ${ disabled_features } )
2022-07-02 06:48:36 +08:00
list ( APPEND _qarg_OPTIONS "-DQT_NO_FORCE_SET_CMAKE_BUILD_TYPE:BOOL=ON" )
2022-04-22 02:42:59 +08:00
2022-11-04 05:12:05 +08:00
if ( VCPKG_TARGET_IS_ANDROID )
list ( APPEND _qarg_OPTIONS "-DANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}" )
endif ( )
2022-04-22 02:42:59 +08:00
if ( NOT PORT MATCHES "qtbase" )
list ( APPEND _qarg_OPTIONS "-DQT_MKSPECS_DIR:PATH=${CURRENT_HOST_INSTALLED_DIR}/share/Qt6/mkspecs" )
endif ( )
2022-02-16 12:24:55 +08:00
vcpkg_cmake_configure (
2021-06-02 02:05:59 +08:00
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
2022-02-16 12:24:55 +08:00
$ { n i n j a _ o p t i o n }
$ { d i s a b l e _ p a r a l l e l }
2022-11-04 05:12:05 +08:00
O P T I O N S
2024-05-01 02:50:26 +08:00
- D Q T _ N O _ F O R C E _ S E T _ C M A K E _ B U I L D _ T Y P E : B O O L = O N
2024-05-29 16:35:33 +08:00
- D Q T _ U S E _ D E F A U L T _ C M A K E _ O P T I M I Z A T I O N _ F L A G S : B O O L = O N # We don't want Qt to mess with users toolchain settings.
2023-04-27 03:10:56 +08:00
- D C M A K E _ F I N D _ P A C K A G E _ T A R G E T S _ G L O B A L = O N # Because Qt doesn't correctly scope find_package calls.
2021-06-02 02:05:59 +08:00
#-DQT_HOST_PATH=<somepath> # For crosscompiling
#-DQT_PLATFORM_DEFINITION_DIR=mkspecs/win32-msvc
#-DQT_QMAKE_TARGET_MKSPEC=win32-msvc
#-DQT_USE_CCACHE
2022-02-16 12:24:55 +08:00
- D Q T _ B U I L D _ E X A M P L E S : B O O L = O F F
- D Q T _ B U I L D _ T E S T S : B O O L = O F F
- D Q T _ B U I L D _ B E N C H M A R K S : B O O L = O F F
2021-06-02 02:05:59 +08:00
$ { P E R L _ O P T I O N }
- D I N S T A L L _ B I N D I R : S T R I N G = b i n
- D I N S T A L L _ L I B E X E C D I R : S T R I N G = b i n
- D I N S T A L L _ P L U G I N S D I R : S T R I N G = $ { q t _ p l u g i n d i r }
- D I N S T A L L _ Q M L D I R : S T R I N G = $ { q t _ q m l d i r }
2021-09-14 06:18:29 +08:00
$ { _ q a r g _ O P T I O N S }
2021-06-02 02:05:59 +08:00
O P T I O N S _ R E L E A S E
2021-09-14 06:18:29 +08:00
$ { _ q a r g _ O P T I O N S _ R E L E A S E }
2021-06-02 02:05:59 +08:00
- D I N S T A L L _ D O C D I R : S T R I N G = d o c / $ { Q T 6 _ D I R E C T O R Y _ P R E F I X }
- D I N S T A L L _ I N C L U D E D I R : S T R I N G = i n c l u d e / $ { Q T 6 _ D I R E C T O R Y _ P R E F I X }
2021-06-22 04:45:33 +08:00
- D I N S T A L L _ D E S C R I P T I O N S D I R : S T R I N G = s h a r e / Q t 6 / m o d u l e s
- D I N S T A L L _ M K S P E C S D I R : S T R I N G = s h a r e / Q t 6 / m k s p e c s
2021-06-02 02:05:59 +08:00
- D I N S T A L L _ T R A N S L A T I O N S D I R : S T R I N G = t r a n s l a t i o n s / $ { Q T 6 _ D I R E C T O R Y _ P R E F I X }
O P T I O N S _ D E B U G
2022-02-16 12:24:55 +08:00
# -DFEATURE_debug:BOOL=ON only needed by qtbase and auto detected?
2021-06-02 02:05:59 +08:00
- D I N S T A L L _ D O C D I R : S T R I N G = . . / d o c / $ { Q T 6 _ D I R E C T O R Y _ P R E F I X }
- D I N S T A L L _ I N C L U D E D I R : S T R I N G = . . / i n c l u d e / $ { Q T 6 _ D I R E C T O R Y _ P R E F I X }
- D I N S T A L L _ T R A N S L A T I O N S D I R : S T R I N G = . . / t r a n s l a t i o n s / $ { Q T 6 _ D I R E C T O R Y _ P R E F I X }
2021-06-22 04:45:33 +08:00
- D I N S T A L L _ D E S C R I P T I O N S D I R : S T R I N G = . . / s h a r e / Q t 6 / m o d u l e s
- D I N S T A L L _ M K S P E C S D I R : S T R I N G = . . / s h a r e / Q t 6 / m k s p e c s
2022-02-16 12:24:55 +08:00
$ { _ q a r g _ O P T I O N S _ D E B U G }
M A Y B E _ U N U S E D _ V A R I A B L E S
I N S T A L L _ B I N D I R
I N S T A L L _ D O C D I R
I N S T A L L _ L I B E X E C D I R
I N S T A L L _ Q M L D I R # No qml files
I N S T A L L _ T R A N S L A T I O N S D I R # No translations
I N S T A L L _ P L U G I N S D I R # No plugins
I N S T A L L _ D E S C R I P T I O N S D I R
I N S T A L L _ I N C L U D E D I R
H O S T _ P E R L
Q T _ S Y N C Q T
2022-04-22 02:42:59 +08:00
Q T _ N O _ F O R C E _ S E T _ C M A K E _ B U I L D _ T Y P E
2022-02-16 12:24:55 +08:00
$ { _ q a r g _ O P T I O N S _ M A Y B E _ U N U S E D }
2023-05-09 07:40:12 +08:00
I N P U T _ b u n d l e d _ x c b _ x i n p u t
I N P U T _ f r e e t y p e
I N P U T _ h a r f b u z z
I N P U T _ l i b j p e g
I N P U T _ l i b m d 4 c
I N P U T _ l i b p n g
I N P U T _ o p e n g l
I N P U T _ o p e n s s l
I N P U T _ x c b
I N P U T _ x k b c o m m o n
2021-06-02 02:05:59 +08:00
)
2021-09-14 06:18:29 +08:00
set ( Z_VCPKG_CMAKE_GENERATOR "${Z_VCPKG_CMAKE_GENERATOR}" PARENT_SCOPE )
endfunction ( )
2021-11-05 06:29:53 +08:00
function ( qt_fix_prl_files )
file ( TO_CMAKE_PATH "${CURRENT_PACKAGES_DIR}/lib" package_dir )
file ( TO_CMAKE_PATH "${package_dir}/lib" lib_path )
file ( TO_CMAKE_PATH "${package_dir}/include/Qt6" include_path )
file ( TO_CMAKE_PATH "${CURRENT_INSTALLED_DIR}" install_prefix )
2024-05-01 02:50:26 +08:00
file ( GLOB_RECURSE prl_files "${CURRENT_PACKAGES_DIR}/*.prl" "${CURRENT_PACKAGES_DIR}/*.pri" )
2021-11-05 06:29:53 +08:00
foreach ( prl_file IN LISTS prl_files )
file ( READ "${prl_file}" _contents )
string ( REPLACE "${lib_path}" "\$\$[QT_INSTALL_LIBS]" _contents "${_contents}" )
string ( REPLACE "${include_path}" "\$\$[QT_INSTALL_HEADERS]" _contents "${_contents}" )
string ( REPLACE "${install_prefix}" "\$\$[QT_INSTALL_PREFIX]" _contents "${_contents}" )
string ( REPLACE "[QT_INSTALL_PREFIX]/lib/objects-Debug" "[QT_INSTALL_LIBS]/objects-Debug" _contents "${_contents}" )
2022-02-16 12:24:55 +08:00
string ( REPLACE "[QT_INSTALL_PREFIX]/Qt6/qml" "[QT_INSTALL_QML]" _contents "${_contents}" )
2021-11-05 06:29:53 +08:00
#Note: This only works without an extra if case since QT_INSTALL_PREFIX is the same for debug and release
file ( WRITE "${prl_file}" "${_contents}" )
endforeach ( )
endfunction ( )
2021-09-14 06:18:29 +08:00
function ( qt_fixup_and_cleanup )
cmake_parse_arguments ( PARSE_ARGV 0 "_qarg" ""
" "
" T O O L _ N A M E S " )
2021-06-02 02:05:59 +08:00
vcpkg_copy_pdbs ( )
2021-11-05 06:29:53 +08:00
## Handle PRL files
qt_fix_prl_files ( )
2022-11-04 05:12:05 +08:00
## Handle CMake files.
2021-06-02 02:05:59 +08:00
set ( COMPONENTS )
file ( GLOB COMPONENTS_OR_FILES LIST_DIRECTORIES true "${CURRENT_PACKAGES_DIR}/share/Qt6*" )
2021-06-22 04:45:33 +08:00
list ( REMOVE_ITEM COMPONENTS_OR_FILES "${CURRENT_PACKAGES_DIR}/share/Qt6" )
2021-06-02 02:05:59 +08:00
foreach ( _glob IN LISTS COMPONENTS_OR_FILES )
if ( IS_DIRECTORY "${_glob}" )
string ( REPLACE "${CURRENT_PACKAGES_DIR}/share/Qt6" "" _component "${_glob}" )
debug_message ( "Adding cmake component: '${_component}'" )
list ( APPEND COMPONENTS ${ _component } )
endif ( )
endforeach ( )
foreach ( _comp IN LISTS COMPONENTS )
if ( EXISTS "${CURRENT_PACKAGES_DIR}/share/Qt6${_comp}" )
2022-02-16 12:24:55 +08:00
vcpkg_cmake_config_fixup ( PACKAGE_NAME "Qt6${_comp}" CONFIG_PATH "share/Qt6${_comp}" TOOLS_PATH "tools/Qt6/bin" )
2022-11-04 05:12:05 +08:00
# Would rather put it into share/cmake as before but the import_prefix correction in vcpkg_cmake_config_fixup is working against that.
2021-06-02 02:05:59 +08:00
else ( )
message ( STATUS "WARNING: Qt component ${_comp} not found/built!" )
endif ( )
endforeach ( )
2022-02-16 12:24:55 +08:00
#fix debug plugin paths (should probably be fixed in vcpkg_cmake_config_fixup)
2021-06-02 02:05:59 +08:00
file ( GLOB_RECURSE DEBUG_CMAKE_TARGETS "${CURRENT_PACKAGES_DIR}/share/**/*Targets-debug.cmake" )
debug_message ( "DEBUG_CMAKE_TARGETS:${DEBUG_CMAKE_TARGETS}" )
foreach ( _debug_target IN LISTS DEBUG_CMAKE_TARGETS )
2024-06-20 05:07:05 +08:00
vcpkg_replace_string ( "${_debug_target}" "{_IMPORT_PREFIX}/${qt_plugindir}" "{_IMPORT_PREFIX}/debug/${qt_plugindir}" IGNORE_UNCHANGED )
vcpkg_replace_string ( "${_debug_target}" "{_IMPORT_PREFIX}/${qt_qmldir}" "{_IMPORT_PREFIX}/debug/${qt_qmldir}" IGNORE_UNCHANGED )
2021-06-02 02:05:59 +08:00
endforeach ( )
2022-11-19 04:31:51 +08:00
file ( GLOB_RECURSE STATIC_CMAKE_TARGETS "${CURRENT_PACKAGES_DIR}/share/Qt6Qml/QmlPlugins/*.cmake" )
foreach ( _plugin_target IN LISTS STATIC_CMAKE_TARGETS )
# restore a single get_filename_component which was remove by vcpkg_cmake_config_fixup
vcpkg_replace_string ( "${_plugin_target}"
[ [ get_filename_component ( _IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH ) ] ]
2024-06-20 05:07:05 +08:00
" get_filename_component ( _IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH ) \ nget_filename_component ( _IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH ) "
I G N O R E _ U N C H A N G E D )
2022-11-19 04:31:51 +08:00
endforeach ( )
2021-06-02 02:05:59 +08:00
2021-06-22 04:45:33 +08:00
set ( qt_tooldest "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin" )
2021-06-02 02:05:59 +08:00
set ( qt_searchdir "${CURRENT_PACKAGES_DIR}/bin" )
## Handle Tools
2021-09-14 06:18:29 +08:00
foreach ( _tool IN LISTS _qarg_TOOL_NAMES )
2021-06-02 02:05:59 +08:00
if ( NOT EXISTS "${CURRENT_PACKAGES_DIR}/bin/${_tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}" )
debug_message ( "Removed '${_tool}' from copy tools list since it was not found!" )
2021-09-14 06:18:29 +08:00
list ( REMOVE_ITEM _qarg_TOOL_NAMES ${ _tool } )
2021-06-02 02:05:59 +08:00
endif ( )
endforeach ( )
2021-09-14 06:18:29 +08:00
if ( _qarg_TOOL_NAMES )
set ( tool_names ${ _qarg_TOOL_NAMES } )
2021-06-02 02:05:59 +08:00
vcpkg_copy_tools ( TOOL_NAMES ${ tool_names } SEARCH_DIR "${qt_searchdir}" DESTINATION "${qt_tooldest}" AUTO_CLEAN )
endif ( )
if ( VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
if ( EXISTS "${CURRENT_PACKAGES_DIR}/bin/" )
2021-06-22 04:45:33 +08:00
file ( COPY "${CURRENT_PACKAGES_DIR}/bin/" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin" )
2021-06-02 02:05:59 +08:00
endif ( )
2021-06-22 04:45:33 +08:00
file ( GLOB_RECURSE _installed_dll_files RELATIVE "${CURRENT_INSTALLED_DIR}/tools/Qt6/bin" "${CURRENT_INSTALLED_DIR}/tools/Qt6/bin/*.dll" )
2021-06-02 02:05:59 +08:00
foreach ( _dll_to_remove IN LISTS _installed_dll_files )
2021-06-22 04:45:33 +08:00
file ( GLOB_RECURSE _packaged_dll_file "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/${_dll_to_remove}" )
2021-06-02 02:05:59 +08:00
if ( EXISTS "${_packaged_dll_file}" )
file ( REMOVE "${_packaged_dll_file}" )
endif ( )
endforeach ( )
2021-06-22 04:45:33 +08:00
file ( GLOB_RECURSE _folders LIST_DIRECTORIES true "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/**/" )
file ( GLOB_RECURSE _files "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/**/" )
2021-06-02 02:05:59 +08:00
if ( _files )
list ( REMOVE_ITEM _folders ${ _files } )
endif ( )
foreach ( _dir IN LISTS _folders )
if ( NOT "${_remaining_dll_files}" MATCHES "${_dir}" )
file ( REMOVE_RECURSE "${_dir}" )
endif ( )
endforeach ( )
endif ( )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/cmake/"
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / s h a r e "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / l i b / c m a k e / "
2022-04-22 02:42:59 +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 / i n c l u d e "
2021-06-02 02:05:59 +08:00
)
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
file ( GLOB_RECURSE _bin_files "${CURRENT_PACKAGES_DIR}/bin/*" )
2022-04-22 02:42:59 +08:00
if ( NOT _bin_files STREQUAL "" )
message ( STATUS "Remaining files in bin: '${_bin_files}'" )
2022-11-04 05:12:05 +08:00
else ( ) # Only clean if empty otherwise let vcpkg throw and error.
2021-06-02 02:05:59 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin/" "${CURRENT_PACKAGES_DIR}/debug/bin/" )
endif ( )
endif ( )
2024-04-10 00:11:37 +08:00
vcpkg_fixup_pkgconfig ( )
2021-09-14 06:18:29 +08:00
endfunction ( )
function ( qt_install_submodule )
cmake_parse_arguments ( PARSE_ARGV 0 "_qis" "DISABLE_NINJA"
" "
2022-02-16 12:24:55 +08:00
" P A T C H E S ; T O O L _ N A M E S ; C O N F I G U R E _ O P T I O N S ; C O N F I G U R E _ O P T I O N S _ D E B U G ; C O N F I G U R E _ O P T I O N S _ R E L E A S E ; C O N F I G U R E _ O P T I O N S _ M A Y B E _ U N U S E D " )
2021-09-14 06:18:29 +08:00
set ( qt_plugindir ${ QT6_DIRECTORY_PREFIX } plugins )
set ( qt_qmldir ${ QT6_DIRECTORY_PREFIX } qml )
qt_download_submodule ( PATCHES ${ _qis_PATCHES } )
if ( _qis_DISABLE_NINJA )
set ( _opt DISABLE_NINJA )
endif ( )
2022-11-04 05:12:05 +08:00
qt_cmake_configure ( ${ _opt }
2021-09-14 06:18:29 +08:00
O P T I O N S $ { _ q i s _ C O N F I G U R E _ O P T I O N 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 }
2022-02-16 12:24:55 +08:00
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 }
O P T I O N S _ M A Y B E _ U N U S E D $ { _ q i s _ C O N F I G U R E _ O P T I O N S _ M A Y B E _ U N U S E D }
)
2021-09-14 06:18:29 +08:00
2022-02-16 12:24:55 +08:00
vcpkg_cmake_install ( ADD_BIN_TO_PATH )
2021-09-14 06:18:29 +08:00
qt_fixup_and_cleanup ( TOOL_NAMES ${ _qis_TOOL_NAMES } )
2021-06-02 02:05:59 +08:00
qt_install_copyright ( "${SOURCE_PATH}" )
set ( SOURCE_PATH "${SOURCE_PATH}" PARENT_SCOPE )
2021-10-01 04:03:56 +08:00
endfunction ( )
2022-07-02 06:48:36 +08:00
include ( "${CMAKE_CURRENT_LIST_DIR}/qt_port_details.cmake" )