Qt4Macros: Replace obsolete/deprecated macro_add_file_dependencies()

The MacroAddFileDependencies module is deprecated as of CMake 3.14 but
doesn't emit warnings/deprecation notices yet. This for now only
upgrades the code usage of Qt4Macros module when used with FindQt4
without this deprecated module.

Additionally, the lowercase style is used in the documentation.
This commit is contained in:
Peter Kokot 2025-03-16 01:56:37 +01:00
parent b5b55827aa
commit cdda7d044d
No known key found for this signature in database
GPG Key ID: A94800907AA79B36
3 changed files with 7 additions and 5 deletions

View File

@ -333,10 +333,12 @@ endif()
include(${CMAKE_CURRENT_LIST_DIR}/CheckCXXSymbolExists.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/MacroAddFileDependencies.cmake)
include(FindPackageHandleStandardArgs)
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
# Included for backward compatibility, otherwise unused.
include(${CMAKE_CURRENT_LIST_DIR}/MacroAddFileDependencies.cmake)
set(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
set( QT_DEFINITIONS "")

View File

@ -9,7 +9,7 @@ MacroAddFileDependencies
.. code-block:: cmake
MACRO_ADD_FILE_DEPENDENCIES(<source> <files>...)
macro_add_file_dependencies(<source> <files>...)
Do not use this command in new code. It is just a wrapper around:

View File

@ -280,7 +280,7 @@ macro(QT4_ADD_DBUS_INTERFACE _sources _interface _basename)
QT4_GENERATE_MOC("${_header}" "${_moc}")
list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
set_property(SOURCE "${_impl}" APPEND PROPERTY OBJECT_DEPENDS "${_moc}")
endmacro()
@ -361,7 +361,7 @@ macro(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optional
QT4_GENERATE_MOC("${_header}" "${_moc}")
set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOMOC TRUE) # don't run automoc on this file
set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOUIC TRUE) # don't run autouic on this file
MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
set_property(SOURCE "${_impl}" APPEND PROPERTY OBJECT_DEPENDS "${_moc}")
list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
endmacro()
@ -405,7 +405,7 @@ macro(QT4_AUTOMOC)
endif()
set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "" "")
MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
set_property(SOURCE "${_abs_FILE}" APPEND PROPERTY OBJECT_DEPENDS "${_moc}")
endforeach ()
endif()
endif ()