diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-08-06 08:40:49 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-08-07 17:48:02 (GMT) |
commit | ca2923110c9999c5cd538a91ec61b10d0b336c48 (patch) | |
tree | 24d145f2a2ae0ce07a4298a5f3539f7445eaa015 /Source/cmQtAutoGenGlobalInitializer.cxx | |
parent | d02a99d9d3aa8d8f33efbd3255c78d6b87a99a22 (diff) | |
download | CMake-ca2923110c9999c5cd538a91ec61b10d0b336c48.zip CMake-ca2923110c9999c5cd538a91ec61b10d0b336c48.tar.gz CMake-ca2923110c9999c5cd538a91ec61b10d0b336c48.tar.bz2 |
Autogen: Modernize to use cmStrCat for string concatenation
Diffstat (limited to 'Source/cmQtAutoGenGlobalInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGenGlobalInitializer.cxx | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx index f172b77..ca5a587 100644 --- a/Source/cmQtAutoGenGlobalInitializer.cxx +++ b/Source/cmQtAutoGenGlobalInitializer.cxx @@ -1,8 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmQtAutoGenGlobalInitializer.h" -#include "cmQtAutoGen.h" -#include "cmQtAutoGenInitializer.h" #include "cmCustomCommandLines.h" #include "cmDuration.h" @@ -11,15 +9,18 @@ #include "cmMakefile.h" #include "cmMessageType.h" #include "cmProcessOutput.h" +#include "cmQtAutoGen.h" +#include "cmQtAutoGenInitializer.h" #include "cmState.h" #include "cmStateTypes.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmTarget.h" -#include <utility> - #include "cm_memory.hxx" +#include <utility> + cmQtAutoGenGlobalInitializer::Keywords::Keywords() : AUTOMOC("AUTOMOC") , AUTOUIC("AUTOUIC") @@ -119,23 +120,17 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer( bool const uicDisabled = (uic && !uicAvailable); bool const rccDisabled = (rcc && !rccAvailable); if (mocDisabled || uicDisabled || rccDisabled) { - std::string msg = "AUTOGEN: No valid Qt version found for target "; - msg += target->GetName(); - msg += ". "; - msg += cmQtAutoGen::Tools(mocDisabled, uicDisabled, rccDisabled); - msg += " disabled. Consider adding:\n"; - { - std::string version = (qtVersion.second == 0) - ? std::string("<QTVERSION>") - : std::to_string(qtVersion.second); - std::string comp = uicDisabled ? "Widgets" : "Core"; - msg += " find_package(Qt"; - msg += version; - msg += " COMPONENTS "; - msg += comp; - msg += ")\n"; - } - msg += "to your CMakeLists.txt file."; + cmAlphaNum version = (qtVersion.second == 0) + ? cmAlphaNum("<QTVERSION>") + : cmAlphaNum(qtVersion.second); + cmAlphaNum component = uicDisabled ? "Widgets" : "Core"; + + std::string const msg = cmStrCat( + "AUTOGEN: No valid Qt version found for target ", + target->GetName(), ". ", + cmQtAutoGen::Tools(mocDisabled, uicDisabled, rccDisabled), + " disabled. Consider adding:\n", " find_package(Qt", version, + " COMPONENTS ", component, ")\n", "to your CMakeLists.txt file."); target->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, msg); } if (mocIsValid || uicIsValid || rccIsValid) { |