CMake: Remove old Qt 5 CMake build system files

Remove the stale Qt 5 CMake files.

Disable the generation of CMake files by the qmake build system,
it wouldn't create usable Qt 6 files anyway.

Keep mkspecs/features/create_cmake.prf and
mkspecs/features/cmake_functions.prf for now until we can confirm that
they are safe to remove.

Task-number: QTBUG-86827
Change-Id: Idcf59f4d7d5474171a9bf72904ff19adc8bc74cd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Alexandru Croitor 2020-10-01 11:03:50 +02:00
parent 081ec14b25
commit 4940f6d04c
15 changed files with 0 additions and 1615 deletions

View File

@ -1,7 +0,0 @@
list(APPEND _Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS
$$CMAKE_SOURCE_INCLUDES
)
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
$$CMAKE_SOURCE_PRIVATE_INCLUDES
)

View File

@ -1,650 +0,0 @@
if (CMAKE_VERSION VERSION_LESS 3.1.0)
message(FATAL_ERROR \"Qt 5 $${CMAKE_MODULE_NAME} module requires at least CMake version 3.1.0\")
endif()
!!IF !isEmpty(CMAKE_USR_MOVE_WORKAROUND)
!!IF !isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
!!ELSE
get_filename_component(_IMPORT_PREFIX \"${CMAKE_CURRENT_LIST_FILE}\" PATH)
# Use original install prefix when loaded through a
# cross-prefix symbolic link such as /lib -> /usr/lib.
get_filename_component(_realCurr \"${_IMPORT_PREFIX}\" REALPATH)
get_filename_component(_realOrig \"$$CMAKE_INSTALL_LIBS_DIR/cmake/Qt5$${CMAKE_MODULE_NAME}\" REALPATH)
if(_realCurr STREQUAL _realOrig)
get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$CMAKE_INSTALL_LIBS_DIR/$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}\" ABSOLUTE)
else()
get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
endif()
unset(_realOrig)
unset(_realCurr)
unset(_IMPORT_PREFIX)
!!ENDIF
!!ELIF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
!!ELSE
set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
!!ENDIF
!!IF !equals(TEMPLATE, aux)
# For backwards compatibility only. Use Qt5$${CMAKE_MODULE_NAME}_VERSION instead.
set(Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING "$$eval(QT.$${MODULE}.VERSION)")
set(Qt5$${CMAKE_MODULE_NAME}_LIBRARIES Qt5::$${CMAKE_MODULE_NAME})
!!ENDIF // TEMPLATE != aux
macro(_qt5_$${CMAKE_MODULE_NAME}_check_file_exists file)
if(NOT EXISTS \"${file}\" )
message(FATAL_ERROR \"The imported target \\\"Qt5::$${CMAKE_MODULE_NAME}\\\" references the file
\\\"${file}\\\"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
\\\"${CMAKE_CURRENT_LIST_FILE}\\\"
but not all the files it references.
\")
endif()
endmacro()
!!IF !isEmpty(CMAKE_STATIC_TYPE)
function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configuration lib_deps link_flags)
set(_lib_deps)
set(_link_flags)
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
set(_qt5_install_libs \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}\")
!!ELSE
set(_qt5_install_libs \"$${CMAKE_LIB_DIR}\")
!!ENDIF
if(EXISTS \"${prl_file_location}\")
file(STRINGS \"${prl_file_location}\" _prl_strings REGEX \"QMAKE_PRL_LIBS_FOR_CMAKE[ \\t]*=\")
# file(STRINGS) replaces all semicolons read from the file with backslash semicolons.
# We need to do a reverse transformation in CMake. For that we replace all backslash
# semicolons with just semicolons, but due to the qmake substitution feature
# creating this file, we need to double the amount of backslashes, so the final file
# should have three backslashes and one semicolon.
string(REGEX REPLACE \"\\\\\\;\" \";\" _prl_strings \"${_prl_strings}\")
string(REGEX REPLACE \"QMAKE_PRL_LIBS_FOR_CMAKE[ \\t]*=[ \\t]*([^\\n]*)\" \"\\\\1\" _static_depends \"${_prl_strings}\")
string(REGEX REPLACE \"[ \\t]+\" \";\" _standard_libraries \"${CMAKE_CXX_STANDARD_LIBRARIES}\")
set(_search_paths)
set(_fw_search_paths)
set(_framework_flag)
string(REPLACE \"\\$\\$[QT_INSTALL_LIBS]\" \"${_qt5_install_libs}\" _static_depends \"${_static_depends}\")
foreach(_flag ${_static_depends})
string(REPLACE \"\\\"\" \"\" _flag ${_flag})
if(_flag MATCHES \"^-framework$\")
# Handle the next flag as framework name
set(_framework_flag 1)
elseif(_flag MATCHES \"^-F(.*)$\")
# Handle -F/foo/bar flags by recording the framework search paths to be used
# by find_library.
list(APPEND _fw_search_paths \"${CMAKE_MATCH_1}\")
elseif(_framework_flag OR _flag MATCHES \"^-l(.*)$\")
if(_framework_flag)
# Handle Darwin framework bundles passed as -framework Foo
set(_lib ${_flag})
else()
# Handle normal libraries passed as -lfoo
set(_lib \"${CMAKE_MATCH_1}\")
foreach(_standard_library ${_standard_libraries})
if(_standard_library MATCHES \"^${_lib}(\\\\.lib)?$\")
set(_lib_is_default_linked TRUE)
break()
endif()
endforeach()
endif()
if (_lib_is_default_linked)
unset(_lib_is_default_linked)
elseif(_lib MATCHES \"^pthread$\")
find_package(Threads REQUIRED)
list(APPEND _lib_deps Threads::Threads)
else()
set(current_search_paths \"${_search_paths}\")
if(_framework_flag)
set(current_search_paths \"${_fw_search_paths}\")
endif()
if(current_search_paths)
find_library(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH ${_lib} HINTS ${current_search_paths} NO_DEFAULT_PATH)
endif()
find_library(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH ${_lib} HINTS ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES})
mark_as_advanced(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH)
if(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH)
list(APPEND _lib_deps
${_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH}
)
else()
message(FATAL_ERROR \"Library not found: ${_lib}\")
endif()
unset(_framework_flag)
endif()
elseif(EXISTS \"${_flag}\")
# The flag is an absolute path to an existing library
list(APPEND _lib_deps \"${_flag}\")
elseif(_flag MATCHES \"^-L(.*)$\")
# Handle -Lfoo flags by putting their paths in the search path used by find_library above
list(APPEND _search_paths \"${CMAKE_MATCH_1}\")
else()
# Handle all remaining flags by simply passing them to the linker
list(APPEND _link_flags ${_flag})
endif()
endforeach()
endif()
string(REPLACE \";\" \" \" _link_flags \"${_link_flags}\")
set(${lib_deps} ${_lib_deps} PARENT_SCOPE)
set(${link_flags} \"SHELL:${_link_flags}\" PARENT_SCOPE)
endfunction()
!!ENDIF
!!IF !equals(TEMPLATE, aux)
macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION
IsDebugAndRelease)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
!!ELSE
set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
!!ENDIF
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
set(_deps
${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}
)
set(_static_deps
!!IF !isEmpty(CMAKE_STATIC_TYPE)
${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LIB_DEPENDENCIES}
!!ENDIF
)
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
\"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
!!IF !isEmpty(CMAKE_LIB_SONAME)
\"IMPORTED_SONAME_${Configuration}\" \"$${CMAKE_LIB_SONAME}\"
!!ENDIF
# For backward compatibility with CMake < 2.8.12
\"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_deps};${_static_deps}\"
)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
\"${_deps}\"
)
!!IF !isEmpty(CMAKE_STATIC_TYPE)
if(NOT "${IsDebugAndRelease}")
set(_genex_condition \"1\")
else()
if("${Configuration}" STREQUAL "DEBUG")
set(_genex_condition \"$<CONFIG:Debug>\")
else()
set(_genex_condition \"$<NOT:$<CONFIG:Debug>>\")
endif()
endif()
if(_static_deps)
set(_static_deps_genex \"$<${_genex_condition}:${_static_deps}>\")
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
\"${_static_deps_genex}\"
)
endif()
set(_static_link_flags \"${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LINK_FLAGS}\")
if(_static_link_flags)
set(_static_link_flags_genex \"$<${_genex_condition}:${_static_link_flags}>\")
if(NOT CMAKE_VERSION VERSION_LESS \"3.13\")
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_OPTIONS
\"${_static_link_flags_genex}\"
)
else()
# Abuse INTERFACE_LINK_LIBRARIES to add link flags when CMake version is too low.
# Strip out SHELL:, because it is not supported in this property. And hope for the best.
string(REPLACE \"SHELL:\" \"\" _static_link_flags_genex \"${_static_link_flags_genex}\")
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
\"${_static_link_flags_genex}\"
)
endif()
endif()
!!ENDIF
!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
!!ELSE
set(imported_implib \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
!!ENDIF
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_implib})
if(NOT \"${IMPLIB_LOCATION}\" STREQUAL \"\")
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
\"IMPORTED_IMPLIB_${Configuration}\" ${imported_implib}
)
endif()
!!ENDIF
endmacro()
!!ENDIF
if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
!!IF !no_module_headers
!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework\"
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Headers\"
)
!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\"
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
)
!!ELSE
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
!!ENDIF
!!ELSE
!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\")
!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION\"
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\"
)
!!ELSE
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
!!ENDIF
!!ELSE
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_INCLUDE_DIR}$${CMAKE_INCLUDE_NAME}\")
!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
\"$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION\"
\"$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\"
)
!!ELSE
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
!!ENDIF
!!ENDIF
!!ENDIF
!!IF !isEmpty(CMAKE_ADD_SOURCE_INCLUDE_DIRS)
include(\"${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake\" OPTIONAL)
!!ENDIF
!!ELSE
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"\")
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
!!ENDIF
foreach(_dir ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS})
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${_dir})
endforeach()
!!IF isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
# Only check existence of private includes if the Private component is
# specified.
list(FIND Qt5$${CMAKE_MODULE_NAME}_FIND_COMPONENTS Private _check_private)
if (NOT _check_private STREQUAL -1)
foreach(_dir ${Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS})
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${_dir})
endforeach()
endif()
!!ENDIF
!!IF !equals(TEMPLATE, aux)
set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS})
set(Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS -D$${MODULE_DEFINE})
set(Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS $${MODULE_DEFINES})
!!ENDIF // TEMPLATE != aux
set(_Qt5$${CMAKE_MODULE_NAME}_MODULE_DEPENDENCIES \"$${CMAKE_MODULE_DEPS}\")
!!IF !isEmpty(CMAKE_INTERFACE_MODULE_DEPS)
list(APPEND _Qt5$${CMAKE_MODULE_NAME}_MODULE_DEPENDENCIES \"$${CMAKE_INTERFACE_MODULE_DEPS}\")
!!ENDIF
set(Qt5$${CMAKE_MODULE_NAME}_OWN_PRIVATE_INCLUDE_DIRS ${Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS})
set(_Qt5$${CMAKE_MODULE_NAME}_FIND_DEPENDENCIES_REQUIRED)
if (Qt5$${CMAKE_MODULE_NAME}_FIND_REQUIRED)
set(_Qt5$${CMAKE_MODULE_NAME}_FIND_DEPENDENCIES_REQUIRED REQUIRED)
endif()
set(_Qt5$${CMAKE_MODULE_NAME}_FIND_DEPENDENCIES_QUIET)
if (Qt5$${CMAKE_MODULE_NAME}_FIND_QUIETLY)
set(_Qt5$${CMAKE_MODULE_NAME}_DEPENDENCIES_FIND_QUIET QUIET)
endif()
set(_Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT)
if (Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT)
set(_Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT EXACT)
endif()
!!IF !equals(TEMPLATE, aux)
set(Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS \"\")
!!ENDIF // TEMPLATE != aux
foreach(_module_dep ${_Qt5$${CMAKE_MODULE_NAME}_MODULE_DEPENDENCIES})
if (NOT Qt5${_module_dep}_FOUND)
find_package(Qt5${_module_dep}
$$VERSION ${_Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT}
${_Qt5$${CMAKE_MODULE_NAME}_DEPENDENCIES_FIND_QUIET}
${_Qt5$${CMAKE_MODULE_NAME}_FIND_DEPENDENCIES_REQUIRED}
PATHS \"${CMAKE_CURRENT_LIST_DIR}/..\" NO_DEFAULT_PATH
)
endif()
if (NOT Qt5${_module_dep}_FOUND)
set(Qt5$${CMAKE_MODULE_NAME}_FOUND False)
return()
endif()
!!IF !equals(TEMPLATE, aux)
list(APPEND Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS \"${Qt5${_module_dep}_INCLUDE_DIRS}\")
list(APPEND Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"${Qt5${_module_dep}_PRIVATE_INCLUDE_DIRS}\")
list(APPEND Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS ${Qt5${_module_dep}_DEFINITIONS})
list(APPEND Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS ${Qt5${_module_dep}_COMPILE_DEFINITIONS})
list(APPEND Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS ${Qt5${_module_dep}_EXECUTABLE_COMPILE_FLAGS})
!!ENDIF // TEMPLATE != aux
endforeach()
!!IF !equals(TEMPLATE, aux)
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS)
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS)
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS)
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS)
!!ENDIF // TEMPLATE != aux
# It can happen that the same FooConfig.cmake file is included when calling find_package()
# on some Qt component. An example of that is when using a Qt static build with auto inclusion
# of plugins:
#
# Qt5WidgetsConfig.cmake -> Qt5GuiConfig.cmake -> Qt5Gui_QSvgIconPlugin.cmake ->
# Qt5SvgConfig.cmake -> Qt5WidgetsConfig.cmake ->
# finish processing of second Qt5WidgetsConfig.cmake ->
# return to first Qt5WidgetsConfig.cmake ->
# add_library cannot create imported target "Qt5::Widgets".
#
# Make sure to return early in the original Config inclusion, because the target has already
# been defined as part of the second inclusion.
if(TARGET Qt5::$${CMAKE_MODULE_NAME})
return()
endif()
set(_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES \"$${CMAKE_QT5_MODULE_DEPS}\")
!!IF !isEmpty(CMAKE_INTERFACE_QT5_MODULE_DEPS)
list(APPEND _Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES \"$${CMAKE_INTERFACE_QT5_MODULE_DEPS}\")
!!ENDIF
!!IF !isEmpty(CMAKE_STATIC_TYPE)
if(NOT Qt5_EXCLUDE_STATIC_DEPENDENCIES)
!!IF !isEmpty(CMAKE_DEBUG_TYPE)
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG
_Qt5$${CMAKE_MODULE_NAME}_STATIC_DEBUG_LIB_DEPENDENCIES
_Qt5$${CMAKE_MODULE_NAME}_STATIC_DEBUG_LINK_FLAGS
)
!!ELSE
_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
\"$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG
_Qt5$${CMAKE_MODULE_NAME}_STATIC_DEBUG_LIB_DEPENDENCIES
_Qt5$${CMAKE_MODULE_NAME}_STATIC_DEBUG_LINK_FLAGS
)
!!ENDIF
!!ENDIF
!!IF !isEmpty(CMAKE_RELEASE_TYPE)
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\" RELEASE
_Qt5$${CMAKE_MODULE_NAME}_STATIC_RELEASE_LIB_DEPENDENCIES
_Qt5$${CMAKE_MODULE_NAME}_STATIC_RELEASE_LINK_FLAGS
)
!!ELSE
_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
\"$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\" RELEASE
_Qt5$${CMAKE_MODULE_NAME}_STATIC_RELEASE_LIB_DEPENDENCIES
_Qt5$${CMAKE_MODULE_NAME}_STATIC_RELEASE_LINK_FLAGS
)
!!ENDIF
!!ENDIF
endif()
!!IF equals(TEMPLATE, aux)
add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
!!ELSE
add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
!!ENDIF
!!ELSE
!!IF equals(TEMPLATE, aux)
add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
!!ELSE
add_library(Qt5::$${CMAKE_MODULE_NAME} SHARED IMPORTED)
!!ENDIF
!!ENDIF
!!IF !equals(TEMPLATE, aux)
!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY FRAMEWORK 1)
!!ENDIF
!!ENDIF // TEMPLATE != aux
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS})
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY
INTERFACE_COMPILE_DEFINITIONS $${MODULE_DEFINES})
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY INTERFACE_QT_ENABLED_FEATURES $$join(QT.$${MODULE}.enabled_features, ";"))
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY INTERFACE_QT_DISABLED_FEATURES $$join(QT.$${MODULE}.disabled_features, ";"))
# Qt 6 forward compatible properties.
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME}
PROPERTY $${CMAKE_FEATURE_PROPERTY_PREFIX}QT_ENABLED_PUBLIC_FEATURES
$$join(QT.$${MODULE}.enabled_features, ";"))
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME}
PROPERTY $${CMAKE_FEATURE_PROPERTY_PREFIX}QT_DISABLED_PUBLIC_FEATURES
$$join(QT.$${MODULE}.disabled_features, ";"))
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME}
PROPERTY $${CMAKE_FEATURE_PROPERTY_PREFIX}QT_ENABLED_PRIVATE_FEATURES
$$join(QT.$${MODULE}_private.enabled_features, ";"))
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME}
PROPERTY $${CMAKE_FEATURE_PROPERTY_PREFIX}QT_DISABLED_PRIVATE_FEATURES
$$join(QT.$${MODULE}_private.disabled_features, ";"))
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY INTERFACE_QT_PLUGIN_TYPES \"$${CMAKE_MODULE_PLUGIN_TYPES}\")
set(_Qt5$${CMAKE_MODULE_NAME}_PRIVATE_DIRS_EXIST TRUE)
foreach (_Qt5$${CMAKE_MODULE_NAME}_PRIVATE_DIR ${Qt5$${CMAKE_MODULE_NAME}_OWN_PRIVATE_INCLUDE_DIRS})
if (NOT EXISTS ${_Qt5$${CMAKE_MODULE_NAME}_PRIVATE_DIR})
set(_Qt5$${CMAKE_MODULE_NAME}_PRIVATE_DIRS_EXIST FALSE)
endif()
endforeach()
if (_Qt5$${CMAKE_MODULE_NAME}_PRIVATE_DIRS_EXIST)
add_library(Qt5::$${CMAKE_MODULE_NAME}Private INTERFACE IMPORTED)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME}Private PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${Qt5$${CMAKE_MODULE_NAME}_OWN_PRIVATE_INCLUDE_DIRS}
)
set(_Qt5$${CMAKE_MODULE_NAME}_PRIVATEDEPS)
foreach(dep ${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES})
if (TARGET ${dep}Private)
list(APPEND _Qt5$${CMAKE_MODULE_NAME}_PRIVATEDEPS ${dep}Private)
endif()
endforeach()
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME}Private PROPERTY
INTERFACE_LINK_LIBRARIES Qt5::$${CMAKE_MODULE_NAME} ${_Qt5$${CMAKE_MODULE_NAME}_PRIVATEDEPS}
)
# Add a versionless target, for compatibility with Qt6.
if(NOT \"${QT_NO_CREATE_VERSIONLESS_TARGETS}\" AND NOT TARGET Qt::$${CMAKE_MODULE_NAME}Private)
add_library(Qt::$${CMAKE_MODULE_NAME}Private INTERFACE IMPORTED)
set_target_properties(Qt::$${CMAKE_MODULE_NAME}Private PROPERTIES
INTERFACE_LINK_LIBRARIES \"Qt5::$${CMAKE_MODULE_NAME}Private\"
)
endif()
endif()
!!IF !equals(TEMPLATE, aux)
!!IF !isEmpty(CMAKE_RELEASE_TYPE)
!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
_populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" $${CMAKE_DEBUG_AND_RELEASE})
!!ELSE
_populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
!!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
!!IF isEmpty(CMAKE_DEBUG_TYPE)
!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
_populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" $${CMAKE_DEBUG_AND_RELEASE})
!!ELSE // CMAKE_STATIC_WINDOWS_BUILD
if (EXISTS
!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
!!ELSE
\"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
!!ENDIF
AND EXISTS
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
!!ELSE
\"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
!!ENDIF
_populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE})
!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
endif()
!!ENDIF // CMAKE_DEBUG_TYPE
!!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD
!!ENDIF // CMAKE_RELEASE_TYPE
!!IF !isEmpty(CMAKE_DEBUG_TYPE)
!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
_populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" $${CMAKE_DEBUG_AND_RELEASE})
!!ELSE
_populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE})
!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
!!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
!!IF isEmpty(CMAKE_RELEASE_TYPE)
!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
_populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" $${CMAKE_DEBUG_AND_RELEASE})
!!ELSE // CMAKE_STATIC_WINDOWS_BUILD
if (EXISTS
!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
!!ELSE
\"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
!!ENDIF
AND EXISTS
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
!!ELSE
\"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
!!ENDIF
_populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
endif()
!!ENDIF // CMAKE_RELEASE_TYPE
!!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD
!!ENDIF // CMAKE_DEBUG_TYPE
!!ELSE // TEMPLATE != aux
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
INTERFACE_LINK_LIBRARIES \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
)
!!ENDIF // TEMPLATE != aux
!!IF isEmpty(CMAKE_INTERNAL_MODULE)
# In Qt 5.15 the glob pattern was relaxed to also catch plugins not literally named "Plugin".
# Define QT5_STRICT_PLUGIN_GLOB or ModuleName_STRICT_PLUGIN_GLOB to revert to old behavior.
if (QT5_STRICT_PLUGIN_GLOB OR Qt5$${CMAKE_MODULE_NAME}_STRICT_PLUGIN_GLOB)
file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*Plugin.cmake\")
else()
file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*.cmake\")
endif()
macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION
IsDebugAndRelease)
set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
!!IF isEmpty(CMAKE_PLUGIN_DIR_IS_ABSOLUTE)
set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
!!ELSE
set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
!!ENDIF
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
set_target_properties(Qt5::${Plugin} PROPERTIES
\"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
)
!!IF !isEmpty(CMAKE_STATIC_TYPE)
set(_static_deps
${_Qt5${Plugin}_STATIC_${Configuration}_LIB_DEPENDENCIES}
)
if(NOT "${IsDebugAndRelease}")
set(_genex_condition \"1\")
else()
if("${Configuration}" STREQUAL "DEBUG")
set(_genex_condition \"$<CONFIG:Debug>\")
else()
set(_genex_condition \"$<NOT:$<CONFIG:Debug>>\")
endif()
endif()
if(_static_deps)
set(_static_deps_genex \"$<${_genex_condition}:${_static_deps}>\")
set_property(TARGET Qt5::${Plugin} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
\"${_static_deps_genex}\"
)
endif()
set(_static_link_flags \"${_Qt5${Plugin}_STATIC_${Configuration}_LINK_FLAGS}\")
if(_static_link_flags)
set(_static_link_flags_genex \"$<${_genex_condition}:${_static_link_flags}>\")
if(NOT CMAKE_VERSION VERSION_LESS \"3.13\")
set_property(TARGET Qt5::${Plugin} APPEND PROPERTY INTERFACE_LINK_OPTIONS
\"${_static_link_flags_genex}\"
)
else()
# Abuse INTERFACE_LINK_LIBRARIES to add link flags when CMake version is too low.
# Strip out SHELL:, because it is not supported in this property. And hope for the best.
string(REPLACE \"SHELL:\" \"\" _static_link_flags_genex \"${_static_link_flags_genex}\")
set_property(TARGET Qt5::${Plugin} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
\"${_static_link_flags_genex}\"
)
endif()
endif()
!!ENDIF
endmacro()
if (pluginTargets)
foreach(pluginTarget ${pluginTargets})
include(${pluginTarget})
endforeach()
endif()
!!ENDIF // isEmpty(CMAKE_INTERNAL_MODULE)
!!IF !isEmpty(CMAKE_MODULE_EXTRAS)
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\")
!!ENDIF
!!IF !isEmpty(CMAKE_MODULE_MACROS)
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}Macros.cmake\")
!!ENDIF
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigVersion.cmake\")
endif()
# Add a versionless target, for compatibility with Qt6.
if(NOT \"${QT_NO_CREATE_VERSIONLESS_TARGETS}\" AND TARGET Qt5::$${CMAKE_MODULE_NAME} AND NOT TARGET Qt::$${CMAKE_MODULE_NAME})
add_library(Qt::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
set_target_properties(Qt::$${CMAKE_MODULE_NAME} PROPERTIES
INTERFACE_LINK_LIBRARIES \"Qt5::$${CMAKE_MODULE_NAME}\"
)
endif()

View File

@ -1,11 +0,0 @@
set(PACKAGE_VERSION $$CMAKE_PACKAGE_VERSION)
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()

View File

@ -1,2 +0,0 @@
#include <QtPlugin>
Q_IMPORT_PLUGIN($$CMAKE_PLUGIN_NAME)

View File

@ -1,114 +0,0 @@
add_library(Qt5::$$CMAKE_PLUGIN_NAME MODULE IMPORTED)
!!IF !isEmpty(CMAKE_STATIC_TYPE)
set(_Qt5$${CMAKE_PLUGIN_NAME}_MODULE_DEPENDENCIES \"$${CMAKE_PLUGIN_MODULE_DEPS}\")
foreach(_module_dep ${_Qt5$${CMAKE_PLUGIN_NAME}_MODULE_DEPENDENCIES})
if(NOT Qt5${_module_dep}_FOUND)
find_package(Qt5${_module_dep}
$$VERSION ${_Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT}
${_Qt5$${CMAKE_MODULE_NAME}_DEPENDENCIES_FIND_QUIET}
${_Qt5$${CMAKE_MODULE_NAME}_FIND_DEPENDENCIES_REQUIRED}
PATHS \"${CMAKE_CURRENT_LIST_DIR}/..\" NO_DEFAULT_PATH
)
endif()
endforeach()
!!IF !isEmpty(CMAKE_RELEASE_TYPE)
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\" RELEASE
_Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LIB_DEPENDENCIES
_Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LINK_FLAGS
)
!!ELSE
_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
\"$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\" RELEASE
_Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LIB_DEPENDENCIES
_Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LINK_FLAGS
)
!!ENDIF
!!ENDIF
!!IF !isEmpty(CMAKE_DEBUG_TYPE)
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG
_Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LIB_DEPENDENCIES
_Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LINK_FLAGS
)
!!ELSE
_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
\"$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG
_Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LIB_DEPENDENCIES
_Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LINK_FLAGS
)
!!ENDIF
!!ENDIF
set_property(TARGET Qt5::$$CMAKE_PLUGIN_NAME PROPERTY INTERFACE_SOURCES
\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_$${CMAKE_PLUGIN_NAME}_Import.cpp\"
)
!!ENDIF
!!IF !isEmpty(CMAKE_RELEASE_TYPE)
_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
!!ENDIF
!!IF !isEmpty(CMAKE_DEBUG_TYPE)
_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE})
!!ENDIF
list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY QT_ALL_PLUGINS_$${CMAKE_PLUGIN_TYPE_ESCAPED} Qt5::$${CMAKE_PLUGIN_NAME})
!!IF !isEmpty(CMAKE_STATIC_TYPE)
# $<GENEX_EVAL:...> wasn\'t added until CMake 3.12, so put a version guard around it
if(CMAKE_VERSION VERSION_LESS \"3.12\")
set(_manual_plugins_genex \"$<TARGET_PROPERTY:QT_PLUGINS>\")
set(_plugin_type_genex \"$<TARGET_PROPERTY:QT_PLUGINS_$${CMAKE_PLUGIN_TYPE_ESCAPED}>\")
set(_no_plugins_genex \"$<TARGET_PROPERTY:QT_NO_PLUGINS>\")
else()
set(_manual_plugins_genex \"$<GENEX_EVAL:$<TARGET_PROPERTY:QT_PLUGINS>>\")
set(_plugin_type_genex \"$<GENEX_EVAL:$<TARGET_PROPERTY:QT_PLUGINS_$${CMAKE_PLUGIN_TYPE_ESCAPED}>>\")
set(_no_plugins_genex \"$<GENEX_EVAL:$<TARGET_PROPERTY:QT_NO_PLUGINS>>\")
endif()
set(_user_specified_genex
\"$<IN_LIST:Qt5::$$CMAKE_PLUGIN_NAME,${_manual_plugins_genex};${_plugin_type_genex}>\"
)
set(_user_specified_genex_versionless
\"$<IN_LIST:Qt::$$CMAKE_PLUGIN_NAME,${_manual_plugins_genex};${_plugin_type_genex}>\"
)
string(CONCAT _plugin_genex
\"$<$<OR:\"
# Add this plugin if it\'s in the list of manually specified plugins or in the list of
# explicitly included plugin types.
\"${_user_specified_genex},\"
\"${_user_specified_genex_versionless},\"
# Add this plugin if all of the following are true:
# 1) the list of explicitly included plugin types is empty
# 2) the QT_PLUGIN_EXTENDS property for the plugin is empty or equal to the current
# module name
# 3) the user hasn\'t explicitly excluded the plugin.
\"$<AND:\"
\"$<STREQUAL:${_plugin_type_genex},>,\"
\"$<OR:\"
# FIXME: The value of CMAKE_MODULE_NAME seems to be wrong (e.g for Svg plugin
# it should be Qt::Svg instead of Qt::Gui).
\"$<STREQUAL:$<TARGET_PROPERTY:Qt5::$${CMAKE_PLUGIN_NAME},QT_PLUGIN_EXTENDS>,Qt::$${CMAKE_MODULE_NAME}>,\"
\"$<STREQUAL:$<TARGET_PROPERTY:Qt5::$${CMAKE_PLUGIN_NAME},QT_PLUGIN_EXTENDS>,>\"
\">,\"
\"$<NOT:$<IN_LIST:Qt5::$${CMAKE_PLUGIN_NAME},${_no_plugins_genex}>>,\"
\"$<NOT:$<IN_LIST:Qt::$${CMAKE_PLUGIN_NAME},${_no_plugins_genex}>>\"
\">\"
\">:Qt5::$$CMAKE_PLUGIN_NAME>\"
)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
${_plugin_genex}
)
set_property(TARGET Qt5::$${CMAKE_PLUGIN_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
\"$${CMAKE_PLUGIN_QT5_MODULE_DEPS}\"
)
!!ENDIF
set_property(TARGET Qt5::$${CMAKE_PLUGIN_NAME} PROPERTY QT_PLUGIN_TYPE \"$$CMAKE_PLUGIN_TYPE\")
set_property(TARGET Qt5::$${CMAKE_PLUGIN_NAME} PROPERTY QT_PLUGIN_EXTENDS \"$$CMAKE_PLUGIN_EXTENDS\")
set_property(TARGET Qt5::$${CMAKE_PLUGIN_NAME} PROPERTY QT_PLUGIN_CLASS_NAME \"$$CMAKE_PLUGIN_NAME\")

View File

@ -117,8 +117,6 @@ unset(QT_FOR_PRIVATE)
QMAKE_USE_PRIVATE += $$QMAKE_USE_FOR_PRIVATE
unset(QMAKE_USE_FOR_PRIVATE)
CONFIG += create_cmake
contains(TARGET, QtAddOn.*): \
DEFINES += QT_BUILD_ADDON_$${ucmodule}_LIB
else: \

View File

@ -93,8 +93,6 @@ INSTALLS += target
TARGET = $$qt5LibraryTarget($$TARGET$$QT_LIBINFIX, "plugins/$$PLUGIN_TYPE/")
CONFIG += create_cmake
DEFINES *= QT_DEPRECATED_WARNINGS
load(qt_targets)

View File

@ -1,205 +0,0 @@
if (NOT ${PROJECT_NAME}-MultiAbiBuild)
set(ANDROID_ABIS armeabi-v7a arm64-v8a x86 x86_64)
# Match Android's sysroots
set(ANDROID_SYSROOT_armeabi-v7a arm-linux-androideabi)
set(ANDROID_SYSROOT_arm64-v8a aarch64-linux-android)
set(ANDROID_SYSROOT_x86 i686-linux-android)
set(ANDROID_SYSROOT_x86_64 x86_64-linux-android)
foreach(abi IN LISTS ANDROID_ABIS)
set(abi_initial_value OFF)
if (abi STREQUAL ${ANDROID_ABI})
set(abi_initial_value ON)
endif()
find_library(Qt5Core_${abi}_Probe Qt5Core_${abi})
if (Qt5Core_${abi}_Probe)
option(ANDROID_BUILD_ABI_${abi} "Enable the build for Android ${abi}" ${abi_initial_value})
endif()
endforeach()
option(ANDROID_MIN_SDK_VERSION "Android minimum SDK version" "23")
option(ANDROID_TARGET_SDK_VERSION "Android target SDK version" "28")
# Make sure to delete the "android-build" directory, which contains all the
# build artefacts, and also the androiddeployqt/gradle artefacts
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${CMAKE_BINARY_DIR}/android-build)
if (CMAKE_VERSION VERSION_LESS 3.15)
message(STATUS "-----------------------------------------------------------------------------------------------------------")
message(STATUS "CMake version 3.15 is required to clean the <build_dir>/android-build when issuing the \"clean\" target.\n\n"
"For this CMake version please use the \"clean-android-build\" support target additionally to the \"clean\" target.")
message(STATUS "-----------------------------------------------------------------------------------------------------------")
add_custom_target(clean-android-build
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/android-build
VERBATIM)
endif()
# Write the android_<project_name>_deployment_settings.json file
file(WRITE ${CMAKE_BINARY_DIR}/android_deployment_settings.json.in
[=[{
"_description": "This file is created by CMake to be read by androiddeployqt and should not be modified by hand.",
"application-binary": "@QT_ANDROID_APPLICATION_BINARY@",
"application-arguments": "@QT_ANDROID_APPLICATION_ARGUMENTS@",
"architectures": {
@QT_ANDROID_ARCHITECTURES@
},
@QT_ANDROID_DEPLOYMENT_DEPENDENCIES@
@QT_ANDROID_EXTRA_PLUGINS@
@QT_ANDROID_PACKAGE_SOURCE_DIR@
@QT_ANDROID_VERSION_CODE@
@QT_ANDROID_VERSION_NAME@
@QT_ANDROID_EXTRA_LIBS@
@QT_QML_IMPORT_PATH@
"ndk": "@ANDROID_NDK@",
"ndk-host": "@ANDROID_HOST_TAG@",
"qml-root-path": "@CMAKE_CURRENT_SOURCE_DIR@",
"qt": "@QT_DIR@",
"sdk": "@ANDROID_SDK@",
"stdcpp-path": "@ANDROID_TOOLCHAIN_ROOT@/sysroot/usr/lib/",
"tool-prefix": "llvm",
"toolchain-prefix": "llvm",
"useLLVM": true
}]=])
if (NOT QT_ANDROID_APPLICATION_BINARY)
set(QT_ANDROID_APPLICATION_BINARY ${PROJECT_NAME})
endif()
if(NOT ANDROID_SDK)
get_filename_component(ANDROID_SDK ${ANDROID_NDK}/../ ABSOLUTE)
endif()
find_program(ANDROID_DEPLOY_QT androiddeployqt)
get_filename_component(QT_DIR ${ANDROID_DEPLOY_QT}/../../ ABSOLUTE)
unset(QT_ANDROID_ARCHITECTURES)
foreach(abi IN LISTS ANDROID_ABIS)
if (ANDROID_BUILD_ABI_${abi})
list(APPEND QT_ANDROID_ARCHITECTURES "\"${abi}\" : \"${ANDROID_SYSROOT_${abi}}\"")
endif()
endforeach()
string(REPLACE ";" ",\n" QT_ANDROID_ARCHITECTURES "${QT_ANDROID_ARCHITECTURES}")
macro(generate_json_variable_list var_list json_key)
if (${var_list})
set(QT_${var_list} "\"${json_key}\": \"")
string(REPLACE ";" "," joined_var_list "${${var_list}}")
string(APPEND QT_${var_list} "${joined_var_list}\",")
endif()
endmacro()
macro(generate_json_variable var json_key)
if (${var})
set(QT_${var} "\"${json_key}\": \"${${var}}\",")
endif()
endmacro()
generate_json_variable_list(ANDROID_DEPLOYMENT_DEPENDENCIES "deployment-dependencies")
generate_json_variable_list(ANDROID_EXTRA_PLUGINS "android-extra-plugins")
generate_json_variable(ANDROID_PACKAGE_SOURCE_DIR "android-package-source-directory")
generate_json_variable(ANDROID_APPLICATION_ARGUMENTS "android-application-arguments")
generate_json_variable(ANDROID_VERSION_CODE "android-version-code")
generate_json_variable(ANDROID_VERSION_NAME "android-version-name")
generate_json_variable_list(ANDROID_EXTRA_LIBS "android-extra-libs")
generate_json_variable_list(QML_IMPORT_PATH "qml-import-paths")
generate_json_variable_list(ANDROID_MIN_SDK_VERSION "android-min-sdk-version")
generate_json_variable_list(ANDROID_TARGET_SDK_VERSION "android-target-sdk-version")
configure_file(
"${CMAKE_BINARY_DIR}/android_deployment_settings.json.in"
"${CMAKE_BINARY_DIR}/android_deployment_settings.json" @ONLY)
# Create "apk" and "aab" targets
if (DEFINED ENV{JAVA_HOME})
set(JAVA_HOME $ENV{JAVA_HOME} CACHE INTERNAL "Saved JAVA_HOME variable")
endif()
if (JAVA_HOME)
set(android_deploy_qt_jdk "--jdk ${JAVA_HOME}")
endif()
if (ANDROID_SDK_PLATFORM)
set(android_deploy_qt_platform "--android-platform ${ANDROID_SDK_PLATFORM}")
endif()
add_custom_target(apk
COMMAND ${CMAKE_COMMAND} -E env JAVA_HOME=${JAVA_HOME} ${ANDROID_DEPLOY_QT}
--input "${CMAKE_BINARY_DIR}/android_deployment_settings.json"
--output "${CMAKE_BINARY_DIR}/android-build"
--apk "${CMAKE_BINARY_DIR}/android-build/${PROJECT_NAME}.apk"
${android_deploy_qt_platform}
${android_deploy_qt_jdk}
VERBATIM)
add_custom_target(aab
COMMAND ${CMAKE_COMMAND} -E env JAVA_HOME=${JAVA_HOME} ${ANDROID_DEPLOY_QT}
--input "${CMAKE_BINARY_DIR}/android_deployment_settings.json"
--output "${CMAKE_BINARY_DIR}/android-build"
--apk "${CMAKE_BINARY_DIR}/android-build/${PROJECT_NAME}.apk"
--aab
${android_deploy_qt_platform}
${android_deploy_qt_jdk}
VERBATIM)
include(ExternalProject)
macro (setup_library library_name android_abi)
# Use Qt Creator's 4.12 settings file if present
unset(QTC_SETTINGS_PARAMETER)
if (EXISTS ${CMAKE_BINARY_DIR}/qtcsettings.cmake)
set(QTC_SETTINGS_PARAMETER -C ${CMAKE_BINARY_DIR}/qtcsettings.cmake)
endif()
# Build all the given ABI as an external project
ExternalProject_Add(${library_name}-builder
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
PREFIX MultiAbi
BUILD_ALWAYS YES
DOWNLOAD_COMMAND ""
INSTALL_COMMAND ""
UPDATE_COMMAND ""
PATCH_COMMAND ""
CMAKE_ARGS
${QTC_SETTINGS_PARAMETER}
-D ANDROID_ABI=${android_abi}
-D CMAKE_FIND_ROOT_PATH=${CMAKE_FIND_ROOT_PATH}
-D CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-D ANDROID_PLATFORM=${ANDROID_PLATFORM}
-D ANDROID_NATIVE_API_LEVEL=${ANDROID_NATIVE_API_LEVEL}
-D CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-D CMAKE_FIND_ROOT_PATH_MODE_PROGRAM=${CMAKE_FIND_ROOT_PATH_MODE_PROGRAM}
-D CMAKE_FIND_ROOT_PATH_MODE_LIBRARY=${CMAKE_FIND_ROOT_PATH_MODE_LIBRARY}
-D CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=${CMAKE_FIND_ROOT_PATH_MODE_INCLUDE}
-D CMAKE_FIND_ROOT_PATH_MODE_PACKAGE=${CMAKE_FIND_ROOT_PATH_MODE_PACKAGE}
-D CMAKE_SHARED_LIBRARY_SUFFIX_CXX=_${android_abi}.so
-D CMAKE_SHARED_MODULE_SUFFIX_CXX=_${android_abi}.so
-D CMAKE_SHARED_LIBRARY_SUFFIX_C=_${android_abi}.so
-D CMAKE_SHARED_MODULE_SUFFIX_C=_${android_abi}.so
-D CMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}/android-build/libs/${android_abi}
-D ${PROJECT_NAME}-MultiAbiBuild=ON
)
endmacro()
foreach(abi IN LISTS ANDROID_ABIS)
if (NOT abi STREQUAL ${ANDROID_ABI})
if (ANDROID_BUILD_ABI_${abi})
setup_library(${PROJECT_NAME}-${abi} ${abi} ${CMAKE_PREFIX_PATH})
endif()
else()
# For the default abi just use the regular cmake run, to have
# nice IDE integration and so on
set(CMAKE_SHARED_MODULE_SUFFIX_CXX "_${ANDROID_ABI}.so")
set(CMAKE_SHARED_LIBRARY_SUFFIX_CXX "_${ANDROID_ABI}.so")
set(CMAKE_SHARED_MODULE_SUFFIX_C "_${ANDROID_ABI}.so")
set(CMAKE_SHARED_LIBRARY_SUFFIX_C "_${ANDROID_ABI}.so")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/android-build/libs/${ANDROID_ABI})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/android-build/libs/${ANDROID_ABI})
endif()
endforeach()
else()
# unset the variable, just not to issue an unused variable warning
unset(${PROJECT_NAME}-MultiAbiBuild)
endif()

View File

@ -1,507 +0,0 @@
#=============================================================================
# Copyright 2005-2011 Kitware, Inc.
# Copyright (C) 2020 The Qt Company Ltd.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of Kitware, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
######################################
#
# Macros for building Qt files
#
######################################
include(CMakeParseArguments)
function(_qt5_warn_deprecated command_name)
if(NOT DEFINED _QT5_INTERNAL_SCOPE)
message(AUTHOR_WARNING
"${command_name} is not part of the official API, and might be removed in Qt 6.")
endif()
endfunction()
# macro used to create the names of output files preserving relative dirs
macro(qt5_make_output_file infile prefix ext outfile )
_qt5_warn_deprecated("qt5_make_output_file")
string(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength)
string(LENGTH ${infile} _infileLength)
set(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR})
if(_infileLength GREATER _binlength)
string(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile)
if(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
file(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile})
else()
file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
endif()
else()
file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
endif()
if(CMAKE_HOST_WIN32 AND rel MATCHES "^([a-zA-Z]):(.*)$") # absolute path
set(rel "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}")
endif()
set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
string(REPLACE ".." "__" _outfile ${_outfile})
get_filename_component(outpath ${_outfile} PATH)
if(CMAKE_VERSION VERSION_LESS "3.14")
get_filename_component(_outfile_ext ${_outfile} EXT)
get_filename_component(_outfile_ext ${_outfile_ext} NAME_WE)
get_filename_component(_outfile ${_outfile} NAME_WE)
string(APPEND _outfile ${_outfile_ext})
else()
get_filename_component(_outfile ${_outfile} NAME_WLE)
endif()
file(MAKE_DIRECTORY ${outpath})
set(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
endmacro()
macro(qt5_get_moc_flags _moc_flags)
_qt5_warn_deprecated("qt5_get_moc_flags")
set(${_moc_flags})
get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
if(CMAKE_INCLUDE_CURRENT_DIR)
list(APPEND _inc_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
endif()
foreach(_current ${_inc_DIRS})
if("${_current}" MATCHES "\\.framework/?$")
string(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}")
set(${_moc_flags} ${${_moc_flags}} "-F${framework_path}")
else()
set(${_moc_flags} ${${_moc_flags}} "-I${_current}")
endif()
endforeach()
get_directory_property(_defines COMPILE_DEFINITIONS)
foreach(_current ${_defines})
set(${_moc_flags} ${${_moc_flags}} "-D${_current}")
endforeach()
if(WIN32)
set(${_moc_flags} ${${_moc_flags}} -DWIN32)
endif()
if (MSVC)
set(${_moc_flags} ${${_moc_flags}} --compiler-flavor=msvc)
endif()
endmacro()
# helper macro to set up a moc rule
function(qt5_create_moc_command infile outfile moc_flags moc_options moc_target moc_depends)
_qt5_warn_deprecated("qt5_create_moc_command")
# Pass the parameters in a file. Set the working directory to
# be that containing the parameters file and reference it by
# just the file name. This is necessary because the moc tool on
# MinGW builds does not seem to handle spaces in the path to the
# file given with the @ syntax.
get_filename_component(_moc_outfile_name "${outfile}" NAME)
get_filename_component(_moc_outfile_dir "${outfile}" PATH)
if(_moc_outfile_dir)
set(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
endif()
set (_moc_parameters_file ${outfile}_parameters)
set (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
if(moc_target)
set(_moc_parameters_file ${_moc_parameters_file}$<$<BOOL:$<CONFIGURATION>>:_$<CONFIGURATION>>)
set(targetincludes "$<TARGET_PROPERTY:${moc_target},INCLUDE_DIRECTORIES>")
set(targetdefines "$<TARGET_PROPERTY:${moc_target},COMPILE_DEFINITIONS>")
set(targetincludes "$<$<BOOL:${targetincludes}>:-I$<JOIN:${targetincludes},\n-I>\n>")
set(targetdefines "$<$<BOOL:${targetdefines}>:-D$<JOIN:${targetdefines},\n-D>\n>")
file (GENERATE
OUTPUT ${_moc_parameters_file}
CONTENT "${targetdefines}${targetincludes}${_moc_parameters}\n"
)
set(targetincludes)
set(targetdefines)
else()
file(WRITE ${_moc_parameters_file} "${_moc_parameters}\n")
endif()
set(_moc_extra_parameters_file @${_moc_parameters_file})
add_custom_command(OUTPUT ${outfile}
COMMAND ${Qt5Core_MOC_EXECUTABLE} ${_moc_extra_parameters_file}
DEPENDS ${infile} ${moc_depends}
${_moc_working_dir}
VERBATIM)
set_source_files_properties(${infile} PROPERTIES SKIP_AUTOMOC ON)
set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC ON)
set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOUIC ON)
endfunction()
function(qt5_generate_moc infile outfile )
set(_QT5_INTERNAL_SCOPE ON)
# get include dirs and flags
qt5_get_moc_flags(moc_flags)
get_filename_component(abs_infile ${infile} ABSOLUTE)
set(_outfile "${outfile}")
if(NOT IS_ABSOLUTE "${outfile}")
set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
endif()
if ("x${ARGV2}" STREQUAL "xTARGET")
set(moc_target ${ARGV3})
endif()
qt5_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}" "")
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_generate_moc)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 5)
qt5_generate_moc(${ARGV})
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
qt6_generate_moc(${ARGV})
endif()
endfunction()
endif()
# qt5_wrap_cpp(outfiles inputfile ... )
function(qt5_wrap_cpp outfiles)
set(_QT5_INTERNAL_SCOPE ON)
# get include dirs
qt5_get_moc_flags(moc_flags)
set(options)
set(oneValueArgs TARGET)
set(multiValueArgs OPTIONS DEPENDS)
cmake_parse_arguments(_WRAP_CPP "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(moc_files ${_WRAP_CPP_UNPARSED_ARGUMENTS})
set(moc_options ${_WRAP_CPP_OPTIONS})
set(moc_target ${_WRAP_CPP_TARGET})
set(moc_depends ${_WRAP_CPP_DEPENDS})
foreach(it ${moc_files})
get_filename_component(it ${it} ABSOLUTE)
qt5_make_output_file(${it} moc_ cpp outfile)
qt5_create_moc_command(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}" "${moc_depends}")
list(APPEND ${outfiles} ${outfile})
endforeach()
set(${outfiles} ${${outfiles}} PARENT_SCOPE)
endfunction()
# This will override the CMake upstream command, because that one is for Qt 3.
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_wrap_cpp outfiles)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 5)
qt5_wrap_cpp("${outfiles}" ${ARGN})
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
qt6_wrap_cpp("${outfiles}" ${ARGN})
endif()
set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
endfunction()
endif()
# _qt5_parse_qrc_file(infile _out_depends _rc_depends)
# internal
function(_qt5_parse_qrc_file infile _out_depends _rc_depends)
get_filename_component(rc_path ${infile} PATH)
if(EXISTS "${infile}")
# parse file for dependencies
# all files are absolute paths or relative to the location of the qrc file
file(READ "${infile}" RC_FILE_CONTENTS)
string(REGEX MATCHALL "<file[^<]+" RC_FILES "${RC_FILE_CONTENTS}")
foreach(RC_FILE ${RC_FILES})
string(REGEX REPLACE "^<file[^>]*>" "" RC_FILE "${RC_FILE}")
if(NOT IS_ABSOLUTE "${RC_FILE}")
set(RC_FILE "${rc_path}/${RC_FILE}")
endif()
set(RC_DEPENDS ${RC_DEPENDS} "${RC_FILE}")
endforeach()
# Since this cmake macro is doing the dependency scanning for these files,
# let's make a configured file and add it as a dependency so cmake is run
# again when dependencies need to be recomputed.
qt5_make_output_file("${infile}" "" "qrc.depends" out_depends)
configure_file("${infile}" "${out_depends}" COPYONLY)
else()
# The .qrc file does not exist (yet). Let's add a dependency and hope
# that it will be generated later
set(out_depends)
endif()
set(${_out_depends} ${out_depends} PARENT_SCOPE)
set(${_rc_depends} ${RC_DEPENDS} PARENT_SCOPE)
endfunction()
# qt5_add_binary_resources(target inputfiles ... )
function(qt5_add_binary_resources target)
set(_QT5_INTERNAL_SCOPE ON)
set(options)
set(oneValueArgs DESTINATION)
set(multiValueArgs OPTIONS)
cmake_parse_arguments(_RCC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(rcc_files ${_RCC_UNPARSED_ARGUMENTS})
set(rcc_options ${_RCC_OPTIONS})
set(rcc_destination ${_RCC_DESTINATION})
if(NOT rcc_destination)
set(rcc_destination ${CMAKE_CURRENT_BINARY_DIR}/${target}.rcc)
endif()
foreach(it ${rcc_files})
get_filename_component(infile ${it} ABSOLUTE)
_qt5_parse_qrc_file(${infile} _out_depends _rc_depends)
set_source_files_properties(${infile} PROPERTIES SKIP_AUTORCC ON)
set(infiles ${infiles} ${infile})
set(out_depends ${out_depends} ${_out_depends})
set(rc_depends ${rc_depends} ${_rc_depends})
endforeach()
add_custom_command(OUTPUT ${rcc_destination}
COMMAND ${Qt5Core_RCC_EXECUTABLE}
ARGS ${rcc_options} --binary --name ${target} --output ${rcc_destination} ${infiles}
DEPENDS ${rc_depends} ${out_depends} ${infiles} VERBATIM)
add_custom_target(${target} ALL DEPENDS ${rcc_destination})
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_add_binary_resources)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 5)
qt5_add_binary_resources(${ARGV})
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
qt6_add_binary_resources(${ARGV})
endif()
endfunction()
endif()
# qt5_add_resources(outfiles inputfile ... )
function(qt5_add_resources outfiles)
set(_QT5_INTERNAL_SCOPE ON)
set(options)
set(oneValueArgs)
set(multiValueArgs OPTIONS)
cmake_parse_arguments(_RCC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(rcc_files ${_RCC_UNPARSED_ARGUMENTS})
set(rcc_options ${_RCC_OPTIONS})
if("${rcc_options}" MATCHES "-binary")
message(WARNING "Use qt5_add_binary_resources for binary option")
endif()
foreach(it ${rcc_files})
get_filename_component(outfilename ${it} NAME_WE)
get_filename_component(infile ${it} ABSOLUTE)
set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cpp)
_qt5_parse_qrc_file(${infile} _out_depends _rc_depends)
set_source_files_properties(${infile} PROPERTIES SKIP_AUTORCC ON)
add_custom_command(OUTPUT ${outfile}
COMMAND ${Qt5Core_RCC_EXECUTABLE}
ARGS ${rcc_options} --name ${outfilename} --output ${outfile} ${infile}
MAIN_DEPENDENCY ${infile}
DEPENDS ${_rc_depends} "${_out_depends}" VERBATIM)
set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC ON)
set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOUIC ON)
list(APPEND ${outfiles} ${outfile})
endforeach()
set(${outfiles} ${${outfiles}} PARENT_SCOPE)
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_add_resources outfiles)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 5)
qt5_add_resources("${outfiles}" ${ARGN})
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
qt6_add_resources("${outfiles}" ${ARGN})
endif()
set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
endfunction()
endif()
# qt5_add_big_resources(outfiles inputfile ... )
function(qt5_add_big_resources outfiles)
set(_QT5_INTERNAL_SCOPE ON)
if (CMAKE_VERSION VERSION_LESS 3.9)
message(FATAL_ERROR, "qt5_add_big_resources requires CMake 3.9 or newer")
endif()
set(options)
set(oneValueArgs)
set(multiValueArgs OPTIONS)
cmake_parse_arguments(_RCC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(rcc_files ${_RCC_UNPARSED_ARGUMENTS})
set(rcc_options ${_RCC_OPTIONS})
if("${rcc_options}" MATCHES "-binary")
message(WARNING "Use qt5_add_binary_resources for binary option")
endif()
foreach(it ${rcc_files})
get_filename_component(outfilename ${it} NAME_WE)
get_filename_component(infile ${it} ABSOLUTE)
set(tmpoutfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}tmp.cpp)
set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.o)
_qt5_parse_qrc_file(${infile} _out_depends _rc_depends)
set_source_files_properties(${infile} PROPERTIES SKIP_AUTORCC ON)
add_custom_command(OUTPUT ${tmpoutfile}
COMMAND ${Qt5Core_RCC_EXECUTABLE} ${rcc_options} --name ${outfilename} --pass 1 --output ${tmpoutfile} ${infile}
DEPENDS ${infile} ${_rc_depends} "${out_depends}" VERBATIM)
add_custom_target(big_resources_${outfilename} ALL DEPENDS ${tmpoutfile})
add_library(rcc_object_${outfilename} OBJECT ${tmpoutfile})
set_target_properties(rcc_object_${outfilename} PROPERTIES AUTOMOC OFF)
set_target_properties(rcc_object_${outfilename} PROPERTIES AUTOUIC OFF)
add_dependencies(rcc_object_${outfilename} big_resources_${outfilename})
# The modification of TARGET_OBJECTS needs the following change in cmake
# https://gitlab.kitware.com/cmake/cmake/commit/93c89bc75ceee599ba7c08b8fe1ac5104942054f
add_custom_command(OUTPUT ${outfile}
COMMAND ${Qt5Core_RCC_EXECUTABLE}
ARGS ${rcc_options} --name ${outfilename} --pass 2 --temp $<TARGET_OBJECTS:rcc_object_${outfilename}> --output ${outfile} ${infile}
DEPENDS rcc_object_${outfilename} $<TARGET_OBJECTS:rcc_object_${outfilename}>
VERBATIM)
list(APPEND ${outfiles} ${outfile})
endforeach()
set(${outfiles} ${${outfiles}} PARENT_SCOPE)
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_add_big_resources outfiles)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 5)
qt5_add_big_resources(${outfiles} ${ARGN})
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
qt6_add_big_resources(${outfiles} ${ARGN})
endif()
set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
endfunction()
endif()
set(_Qt5_COMPONENT_PATH "${CMAKE_CURRENT_LIST_DIR}/..")
macro(qt5_use_modules _target _link_type)
_qt5_warn_deprecated("qt5_use_modules")
if (NOT TARGET ${_target})
message(FATAL_ERROR "The first argument to qt5_use_modules must be an existing target.")
endif()
if ("${_link_type}" STREQUAL "LINK_PUBLIC" OR "${_link_type}" STREQUAL "LINK_PRIVATE" )
set(_qt5_modules ${ARGN})
set(_qt5_link_type ${_link_type})
else()
set(_qt5_modules ${_link_type} ${ARGN})
endif()
if ("${_qt5_modules}" STREQUAL "")
message(FATAL_ERROR "qt5_use_modules requires at least one Qt module to use.")
endif()
foreach(_module ${_qt5_modules})
if (NOT Qt5${_module}_FOUND)
find_package(Qt5${_module} PATHS "${_Qt5_COMPONENT_PATH}" NO_DEFAULT_PATH)
if (NOT Qt5${_module}_FOUND)
message(FATAL_ERROR "Cannot use \"${_module}\" module which has not yet been found.")
endif()
endif()
target_link_libraries(${_target} ${_qt5_link_type} ${Qt5${_module}_LIBRARIES})
set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${Qt5${_module}_INCLUDE_DIRS})
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${Qt5${_module}_COMPILE_DEFINITIONS})
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
if (Qt5_POSITION_INDEPENDENT_CODE
AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0))
set_property(TARGET ${_target} PROPERTY POSITION_INDEPENDENT_CODE ${Qt5_POSITION_INDEPENDENT_CODE})
endif()
endforeach()
endmacro()
function(qt5_import_plugins TARGET_NAME)
set(_doing "")
foreach(_arg ${ARGN})
if(_arg STREQUAL "INCLUDE")
set(_doing "INCLUDE")
elseif(_arg STREQUAL "EXCLUDE")
set(_doing "EXCLUDE")
elseif(_arg STREQUAL "INCLUDE_BY_TYPE")
set(_doing "INCLUDE_BY_TYPE")
elseif(_arg STREQUAL "EXCLUDE_BY_TYPE")
set(_doing "EXCLUDE_BY_TYPE")
else()
if(_doing STREQUAL "INCLUDE")
set_property(TARGET ${TARGET_NAME} APPEND PROPERTY QT_PLUGINS "${_arg}")
elseif(_doing STREQUAL "EXCLUDE")
set_property(TARGET ${TARGET_NAME} APPEND PROPERTY QT_NO_PLUGINS "${_arg}")
elseif(_doing STREQUAL "INCLUDE_BY_TYPE")
string(REGEX REPLACE "[-/]" "_" _plugin_type "${_arg}")
set(_doing "INCLUDE_BY_TYPE_PLUGINS")
elseif(_doing STREQUAL "INCLUDE_BY_TYPE_PLUGINS")
set_property(TARGET ${TARGET_NAME} APPEND PROPERTY "QT_PLUGINS_${_plugin_type}" "${_arg}")
elseif(_doing STREQUAL "EXCLUDE_BY_TYPE")
string(REGEX REPLACE "[-/]" "_" _plugin_type "${_arg}")
set_property(TARGET ${TARGET_NAME} PROPERTY "QT_PLUGINS_${_plugin_type}" -)
else()
message(FATAL_ERROR "Unexpected extra argument: \"${_arg}\"")
endif()
endif()
endforeach()
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
function(qt_import_plugins)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 5)
qt5_import_plugins(${ARGV})
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
qt6_import_plugins(${ARGV})
endif()
endfunction()
endif()

View File

@ -1,51 +0,0 @@
if (CMAKE_VERSION VERSION_LESS 3.1.0)
message(FATAL_ERROR \"Qt5 requires at least CMake version 3.1.0\")
endif()
if (NOT Qt5_FIND_COMPONENTS)
set(Qt5_NOT_FOUND_MESSAGE \"The Qt5 package requires at least one component\")
set(Qt5_FOUND False)
return()
endif()
set(_Qt5_FIND_PARTS_REQUIRED)
if (Qt5_FIND_REQUIRED)
set(_Qt5_FIND_PARTS_REQUIRED REQUIRED)
endif()
set(_Qt5_FIND_PARTS_QUIET)
if (Qt5_FIND_QUIETLY)
set(_Qt5_FIND_PARTS_QUIET QUIET)
endif()
get_filename_component(_qt5_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/..\" ABSOLUTE)
set(_Qt5_NOTFOUND_MESSAGE)
include(${CMAKE_CURRENT_LIST_DIR}/Qt5ModuleLocation.cmake)
foreach(module ${Qt5_FIND_COMPONENTS})
find_package(Qt5${module}
${_Qt5_FIND_PARTS_QUIET}
${_Qt5_FIND_PARTS_REQUIRED}
PATHS ${_qt5_module_paths} NO_DEFAULT_PATH
)
if (NOT Qt5${module}_FOUND)
string(CONFIGURE ${_qt5_module_location_template} _expected_module_location @ONLY)
if (Qt5_FIND_REQUIRED_${module})
set(_Qt5_NOTFOUND_MESSAGE \"${_Qt5_NOTFOUND_MESSAGE}Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_expected_module_location}\\\"\\n\")
elseif(NOT Qt5_FIND_QUIETLY)
message(WARNING \"Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_expected_module_location}\\\"\")
endif()
unset(_expected_module_location)
endif()
endforeach()
if (_Qt5_NOTFOUND_MESSAGE)
set(Qt5_NOT_FOUND_MESSAGE \"${_Qt5_NOTFOUND_MESSAGE}\")
set(Qt5_FOUND False)
endif()
_qt5_Core_check_file_exists(\"${CMAKE_CURRENT_LIST_DIR}/Qt5ConfigVersion.cmake\")

View File

@ -1,6 +0,0 @@
!!IF isEmpty(CMAKE_HOST_DATA_DIR_IS_ABSOLUTE)
set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_HOST_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
!!ELSE
set(_qt5_corelib_extra_includes \"$${CMAKE_HOST_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
!!ENDIF

View File

@ -1,6 +0,0 @@
!!IF isEmpty(CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE)
set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_INSTALL_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
!!ELSE
set(_qt5_corelib_extra_includes \"$${CMAKE_INSTALL_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
!!ENDIF

View File

@ -1,15 +0,0 @@
!!IF !isEmpty(_QMAKE_SUPER_CACHE_)
get_filename_component(_qt5_root_dir \"${CMAKE_CURRENT_LIST_DIR}/../../../..\" ABSOLUTE)
file(GLOB qtmodules ${_qt5_root_dir} "${_qt5_root_dir}/*")
foreach(qtmodule ${qtmodules})
if(IS_DIRECTORY ${qtmodule})
list(APPEND _qt5_module_paths "${qtmodule}" "${qtmodule}/lib/cmake")
endif()
endforeach()
!!ELSE
set(_qt5_root_dir ${_qt5_install_prefix})
set(_qt5_module_paths ${_qt5_install_prefix})
!!ENDIF
set(_qt5_module_location_template ${_qt5_root_dir})

View File

@ -1,6 +0,0 @@
set(_qt5_root_dir ${_qt5_install_prefix})
set(_qt5_module_paths ${_qt5_install_prefix})
set(_qt5_at "@")
set(_qt5_module_location_template ${_qt5_install_prefix}/Qt5${_qt5_at}module${_qt5_at}/Qt5${_qt5_at}module${_qt5_at}Config.cmake)
unset(_qt5_at)

View File

@ -1,31 +0,0 @@
if (NOT TARGET Qt5::uic)
add_executable(Qt5::uic IMPORTED)
!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
set(imported_location \"${_qt5Widgets_install_prefix}/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
!!ELSE
set(imported_location \"$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
!!ENDIF
_qt5_Widgets_check_file_exists(${imported_location})
set_target_properties(Qt5::uic PROPERTIES
IMPORTED_LOCATION ${imported_location}
)
endif()
if (QT5_STRICT_PLUGIN_GLOB OR Qt5$${CMAKE_MODULE_NAME}_STRICT_PLUGIN_GLOB)
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5Widgets_AccessibleFactory.cmake\" OPTIONAL)
endif()
set(Qt5Widgets_UIC_EXECUTABLE Qt5::uic)
# Create versionless tool targets.
foreach(__qt_tool uic)
if(NOT \"${QT_NO_CREATE_VERSIONLESS_TARGETS}\" AND NOT TARGET Qt::${__qt_tool}
AND TARGET Qt5::${__qt_tool})
add_executable(Qt::${__qt_tool} IMPORTED)
get_target_property(__qt_imported_location Qt5::${__qt_tool} IMPORTED_LOCATION)
set_target_properties(Qt::${__qt_tool}
PROPERTIES IMPORTED_LOCATION \"${__qt_imported_location}\")
endif()
endforeach()