mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Merge topic 'cmake_autogen_verbose'
5b85ef5cd0Autogen: Add release notes for CMAKE_AUTOGEN_VERBOSE6651aab2abAutogen: Add documentation for CMAKE_AUTOGEN_VERBOSEaa7d8a092cAutogen: Enable CMAKE_AUTOGEN_VERBOSE in all testse28dc3b1d8Autogen: Add CMAKE_AUTOGEN_VERBOSE variable support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2157
This commit is contained in:
@@ -290,6 +290,7 @@ Variables that Control the Build
|
||||
/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY
|
||||
/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG
|
||||
/variable/CMAKE_AUTOGEN_PARALLEL
|
||||
/variable/CMAKE_AUTOGEN_VERBOSE
|
||||
/variable/CMAKE_AUTOMOC
|
||||
/variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES
|
||||
/variable/CMAKE_AUTOMOC_DEPEND_FILTERS
|
||||
|
||||
6
Help/release/dev/CMAKE_AUTOGEN_VERBOSE.rst
Normal file
6
Help/release/dev/CMAKE_AUTOGEN_VERBOSE.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
CMAKE_AUTOGEN_VERBOSE
|
||||
---------------------
|
||||
|
||||
* The new variable :variable:`CMAKE_AUTOGEN_VERBOSE` allows
|
||||
to increase the verbosity of :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTOUIC` and
|
||||
:prop_tgt:`AUTORCC` from within CMakeLists.txt.
|
||||
13
Help/variable/CMAKE_AUTOGEN_VERBOSE.rst
Normal file
13
Help/variable/CMAKE_AUTOGEN_VERBOSE.rst
Normal file
@@ -0,0 +1,13 @@
|
||||
CMAKE_AUTOGEN_VERBOSE
|
||||
---------------------
|
||||
|
||||
Sets the verbosity of :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTOUIC` and
|
||||
:prop_tgt:`AUTORCC`. A positive integer value or a true boolean value
|
||||
lets the ``AUTO*`` generators output additional processing information.
|
||||
|
||||
Setting :variable:`CMAKE_AUTOGEN_VERBOSE` has the same effect
|
||||
as setting the ``VERBOSE`` environment variable during
|
||||
generation (e.g. by calling ``make VERBOSE=1``).
|
||||
The extra verbosity is limited to the ``AUTO*`` generators though.
|
||||
|
||||
By default :variable:`CMAKE_AUTOGEN_VERBOSE` is unset.
|
||||
@@ -210,6 +210,19 @@ void cmQtAutoGenInitializer::InitCustomTargets()
|
||||
cmLocalGenerator* localGen = this->Target->GetLocalGenerator();
|
||||
cmGlobalGenerator* globalGen = localGen->GetGlobalGenerator();
|
||||
|
||||
// Verbosity
|
||||
{
|
||||
this->Verbosity = makefile->GetSafeDefinition("CMAKE_AUTOGEN_VERBOSE");
|
||||
if (!this->Verbosity.empty()) {
|
||||
unsigned long iVerb = 0;
|
||||
if (!cmSystemTools::StringToULong(this->Verbosity.c_str(), &iVerb)) {
|
||||
// Non numeric verbosity
|
||||
this->Verbosity =
|
||||
cmSystemTools::IsOn(this->Verbosity.c_str()) ? "1" : "0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Configurations
|
||||
this->MultiConfig = globalGen->IsMultiConfig();
|
||||
this->ConfigDefault = makefile->GetConfigurations(this->ConfigsList);
|
||||
@@ -944,6 +957,7 @@ void cmQtAutoGenInitializer::SetupCustomTargets()
|
||||
ofs << "# Meta\n";
|
||||
CWrite("AM_MULTI_CONFIG", this->MultiConfig ? "TRUE" : "FALSE");
|
||||
CWrite("AM_PARALLEL", this->Parallel);
|
||||
CWrite("AM_VERBOSITY", this->Verbosity);
|
||||
|
||||
ofs << "# Directories\n";
|
||||
CWrite("AM_CMAKE_SOURCE_DIR", MfDef("CMAKE_SOURCE_DIR"));
|
||||
@@ -1036,7 +1050,7 @@ void cmQtAutoGenInitializer::SetupCustomTargets()
|
||||
// Write
|
||||
ofs << "# Configurations\n";
|
||||
CWrite("ARCC_MULTI_CONFIG", this->MultiConfig ? "TRUE" : "FALSE");
|
||||
|
||||
CWrite("ARCC_VERBOSITY", this->Verbosity);
|
||||
ofs << "# Settings file\n";
|
||||
if (this->MultiConfig) {
|
||||
std::map<std::string, std::string> settingsFiles;
|
||||
|
||||
@@ -83,6 +83,7 @@ private:
|
||||
std::string ConfigDefault;
|
||||
std::vector<std::string> ConfigsList;
|
||||
std::string Parallel;
|
||||
std::string Verbosity;
|
||||
// Names
|
||||
std::string AutogenTargetName;
|
||||
std::string AutogenFolder;
|
||||
|
||||
@@ -17,9 +17,14 @@
|
||||
|
||||
// -- Class methods
|
||||
|
||||
void cmQtAutoGenerator::Logger::SetVerbose(bool value)
|
||||
void cmQtAutoGenerator::Logger::RaiseVerbosity(std::string const& value)
|
||||
{
|
||||
Verbose_ = value;
|
||||
unsigned long verbosity = 0;
|
||||
if (cmSystemTools::StringToULong(value.c_str(), &verbosity)) {
|
||||
if (this->Verbosity_ < verbosity) {
|
||||
this->Verbosity_ = static_cast<unsigned int>(verbosity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cmQtAutoGenerator::Logger::SetColorOutput(bool value)
|
||||
@@ -632,7 +637,18 @@ cmQtAutoGenerator::cmQtAutoGenerator()
|
||||
: FileSys_(&Logger_)
|
||||
{
|
||||
// Initialize logger
|
||||
Logger_.SetVerbose(cmSystemTools::HasEnv("VERBOSE"));
|
||||
{
|
||||
std::string verbose;
|
||||
if (cmSystemTools::GetEnv("VERBOSE", verbose) && !verbose.empty()) {
|
||||
unsigned long iVerbose = 0;
|
||||
if (cmSystemTools::StringToULong(verbose.c_str(), &iVerbose)) {
|
||||
Logger_.SetVerbosity(static_cast<unsigned int>(iVerbose));
|
||||
} else {
|
||||
// Non numeric verbosity
|
||||
Logger_.SetVerbose(cmSystemTools::IsOn(verbose.c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
std::string colorEnv;
|
||||
cmSystemTools::GetEnv("COLOR", colorEnv);
|
||||
|
||||
@@ -33,8 +33,11 @@ public:
|
||||
{
|
||||
public:
|
||||
// -- Verbosity
|
||||
bool Verbose() const { return this->Verbose_; }
|
||||
void SetVerbose(bool value);
|
||||
unsigned int Verbosity() const { return this->Verbosity_; }
|
||||
void SetVerbosity(unsigned int value) { this->Verbosity_ = value; }
|
||||
void RaiseVerbosity(std::string const& value);
|
||||
bool Verbose() const { return (this->Verbosity_ != 0); }
|
||||
void SetVerbose(bool value) { this->Verbosity_ = value ? 1 : 0; }
|
||||
bool ColorOutput() const { return this->ColorOutput_; }
|
||||
void SetColorOutput(bool value);
|
||||
// -- Log info
|
||||
@@ -56,8 +59,8 @@ public:
|
||||
|
||||
private:
|
||||
std::mutex Mutex_;
|
||||
bool volatile Verbose_ = false;
|
||||
bool volatile ColorOutput_ = false;
|
||||
unsigned int Verbosity_ = 0;
|
||||
bool ColorOutput_ = false;
|
||||
};
|
||||
|
||||
/// @brief Thread safe file system interface
|
||||
|
||||
@@ -1222,6 +1222,7 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
|
||||
}
|
||||
|
||||
// -- Meta
|
||||
Log().RaiseVerbosity(InfoGet("AM_VERBOSITY"));
|
||||
Base_.MultiConfig = InfoGetBool("AM_MULTI_CONFIG");
|
||||
{
|
||||
unsigned long num = Base_.NumThreads;
|
||||
|
||||
@@ -70,6 +70,7 @@ bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile)
|
||||
}
|
||||
|
||||
// - Configurations
|
||||
Log().RaiseVerbosity(InfoGet("ARCC_VERBOSITY"));
|
||||
MultiConfig_ = makefile->IsOn("ARCC_MULTI_CONFIG");
|
||||
|
||||
// - Directories
|
||||
|
||||
@@ -16,6 +16,7 @@ try_compile(MOC_RERUN
|
||||
"${mocBasicSrcDir}"
|
||||
MocBasic
|
||||
CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
|
||||
"-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
|
||||
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
|
||||
OUTPUT_VARIABLE output
|
||||
)
|
||||
|
||||
@@ -19,6 +19,7 @@ try_compile(MOC_PLUGIN
|
||||
"${mocPlugSrcDir}"
|
||||
MocPlugin
|
||||
CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
|
||||
"-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
|
||||
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
|
||||
OUTPUT_VARIABLE output
|
||||
)
|
||||
|
||||
@@ -19,6 +19,7 @@ try_compile(RCC_DEPENDS
|
||||
"${rccDepSD}"
|
||||
RccConfigChange
|
||||
CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
|
||||
"-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
|
||||
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
|
||||
OUTPUT_VARIABLE output
|
||||
)
|
||||
|
||||
@@ -21,6 +21,7 @@ try_compile(RCC_DEPENDS
|
||||
"${rccDepSD}"
|
||||
RccDepends
|
||||
CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
|
||||
"-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
|
||||
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
|
||||
OUTPUT_VARIABLE output
|
||||
)
|
||||
|
||||
@@ -4,6 +4,7 @@ if(NOT _isMultiConfig) # Set in Tests/CMakeLists.txt
|
||||
list(APPEND Autogen_BUILD_OPTIONS "-DCMAKE_BUILD_TYPE=$<CONFIGURATION>")
|
||||
endif()
|
||||
list(APPEND Autogen_BUILD_OPTIONS
|
||||
"-DCMAKE_AUTOGEN_VERBOSE=1"
|
||||
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user