Use add_compile_definitions instead of add_definitions

add_compile_definitions allows having the generator expressions as
the items in the definition list. add_definitions do not support pure
$<...> without the prescending macro name with the assignment.

Pick-to: 6.7 6.5
Change-Id: I1e79f1cf395b62b1e481eb0f3c74f93c61f06381
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 032fdcbcc00380e9a181f5adf2be767194bb35d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexey Edelev 2024-07-02 18:06:29 +02:00 committed by Qt Cherry-pick Bot
parent 16f95639a1
commit 9bf92f9a5a
3 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ include_directories(
${Qt6Test_INCLUDE_DIRS}
)
add_definitions(
add_compile_definitions(
${Qt6Gui_DEFINITIONS}
${Qt6Test_DEFINITIONS}
)

View File

@ -20,7 +20,7 @@ include_directories(
${Qt6Test_INCLUDE_DIRS}
)
add_definitions(
add_compile_definitions(
${Qt6Widgets_DEFINITIONS}
${Qt6Test_DEFINITIONS}
)

View File

@ -120,7 +120,7 @@ if(TARGET Qt::Gui)
endif()
# Ensure uniform location info between release and debug builds
add_definitions(-DQT_MESSAGELOGCONTEXT)
add_compile_definitions(QT_MESSAGELOGCONTEXT)
foreach(subprogram IN LISTS subprograms)
add_subdirectory(${subprogram})