diff options
author | Brad King <brad.king@kitware.com> | 2015-10-28 09:00:51 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-10-28 09:03:10 -0400 |
commit | e78fcc6329483c99e61cebffbe5d82b67a3361ae (patch) | |
tree | 9ce8882e0b902e784cc9332c564ac132fc39f5a5 /Source/cmQtAutoGeneratorInitializer.cxx | |
parent | 5ba3209247b7c7e4e4cc7c38b8702bee4879d50f (diff) | |
download | cmake-e78fcc6329483c99e61cebffbe5d82b67a3361ae.tar.gz |
QtAutogen: Fix rcc invocation for Qt 5.0 and 5.1 (#15644)
In commit v3.2.0-rc1~480^2 (QtAutogen: Regenerate qrc files if their
input changes, 2014-09-17) we added use of the rcc `--list` option.
Prior to Qt 5.2 this option was called just `-list`. Run `rcc --help`
to check for support for `--list` before using it and otherwise fall
back to the `-list` option for compatibility with older versions.
Diffstat (limited to 'Source/cmQtAutoGeneratorInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGeneratorInitializer.cxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 053c8052fa..2a7f1e64a2 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -490,11 +490,30 @@ static std::string ListQt5RccInputs(cmSourceFile* sf, { std::string rccCommand = GetRccExecutable(target); + + bool hasDashDashList = false; + { + std::vector<std::string> command; + command.push_back(rccCommand); + command.push_back("--help"); + std::string rccStdOut; + std::string rccStdErr; + int retVal = 0; + bool result = cmSystemTools::RunSingleCommand( + command, &rccStdOut, &rccStdErr, + &retVal, 0, cmSystemTools::OUTPUT_NONE); + if (result && retVal == 0 && + rccStdOut.find("--list") != std::string::npos) + { + hasDashDashList = true; + } + } + std::vector<std::string> qrcEntries; std::vector<std::string> command; command.push_back(rccCommand); - command.push_back("--list"); + command.push_back(hasDashDashList? "--list" : "-list"); std::string absFile = cmsys::SystemTools::GetRealPath( sf->GetFullPath()); |