summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2022-04-11 15:35:52 +0200
committerAlexey Edelev <alexey.edelev@qt.io>2022-04-12 04:57:14 +0000
commit8eef32d460d06f823fa20b364e3ffe6ca5cd6977 (patch)
treef5237dbc79baa5ea78af6b2708d5e5f24df5e223 /cmake
parentb8677bd31fdb8e0cc897dcd4e39e121baa3e9722 (diff)
Suppress cmake warning about empty string argument
When generating .pc files there is a warning when executing QtFinishPkgConfigFile.cmake: Ignoring empty string ("") provided on the command line. This happens because the 'postfix' argument is a part of the script command line even if it's empty. It also makes no sense to check if 'postfix' is empty using genex, use configuring-time check instead. Pick-to: 6.2 6.3 Change-Id: If52d9634f4885caefb828976b3c99592a6db3d3c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtPkgConfigHelpers.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/QtPkgConfigHelpers.cmake b/cmake/QtPkgConfigHelpers.cmake
index 45bbcbedf0..21a09365f2 100644
--- a/cmake/QtPkgConfigHelpers.cmake
+++ b/cmake/QtPkgConfigHelpers.cmake
@@ -119,6 +119,12 @@ function(qt_internal_generate_pkg_config_file module)
else()
set(postfix "")
endif()
+
+ set(extra_args "")
+ if(NOT postfix STREQUAL "")
+ list(APPEND extra_args "-DPOSTFIX=${postfix}")
+ endif()
+
qt_path_join(pc_step2_path "${build_dir}" ${step_prefix}_${config}_step2.pc)
qt_path_join(final_pc_path "${build_dir}" ${pkgconfig_file}${postfix}.pc)
@@ -129,7 +135,7 @@ function(qt_internal_generate_pkg_config_file module)
COMMAND ${CMAKE_COMMAND}
"-DIN_FILE=${pc_step2_path}"
"-DOUT_FILE=${final_pc_path}"
- "$<$<BOOL:${postfix}>:-DPOSTFIX=${postfix}>"
+ ${extra_args}
-P "${QT_CMAKE_DIR}/QtFinishPkgConfigFile.cmake"
VERBATIM
COMMENT "Generating pc file for target ${target}"