From 49b60a07dc1d22c613f94348d7bef1d7a5cbf0ea Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 11 Apr 2022 15:35:52 +0200 Subject: 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. Change-Id: If52d9634f4885caefb828976b3c99592a6db3d3c Reviewed-by: Alexandru Croitor (cherry picked from commit 8eef32d460d06f823fa20b364e3ffe6ca5cd6977) Reviewed-by: Alexey Edelev --- cmake/QtPkgConfigHelpers.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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}" - "$<$:-DPOSTFIX=${postfix}>" + ${extra_args} -P "${QT_CMAKE_DIR}/QtFinishPkgConfigFile.cmake" VERBATIM COMMENT "Generating pc file for target ${target}" -- cgit v1.2.3