diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2016-12-02 10:21:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-12-07 13:24:01 (GMT) |
commit | 8c9358386b0b2826ffc3da4385474a4227477eef (patch) | |
tree | 7c71407d1038423b13c82e0fbe9117b2b76aaf52 /Source/cmQtAutoGeneratorInitializer.cxx | |
parent | 8f47a5f16aa685e15e6b49c0b90a58b18ea38d0a (diff) | |
download | CMake-8c9358386b0b2826ffc3da4385474a4227477eef.zip CMake-8c9358386b0b2826ffc3da4385474a4227477eef.tar.gz CMake-8c9358386b0b2826ffc3da4385474a4227477eef.tar.bz2 |
QtAutogen: Generate included ui_ and moc_ files in _automoc/includes
ui_ and moc_ files that are include in source files get generated in
$CURRENT_BUILD_DIR/$TARGETNAME_automoc/include.
The directory is added to the INCLUDE_DIRECTORIES of the origin target
in the generation stage.
From now on all autogen files get generated below
$CURRENT_BUILD_DIR/$TARGETNAME_automoc.
Diffstat (limited to 'Source/cmQtAutoGeneratorInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGeneratorInitializer.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 9766a5a..bc75c59 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -658,8 +658,8 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenSources( { if (target->GetPropertyAsBool("AUTOMOC")) { cmMakefile* makefile = target->Target->GetMakefile(); - std::string mocCppFile = GetAutogenTargetBuildDir(target); - mocCppFile += "moc_compilation.cpp"; + const std::string mocCppFile = + GetAutogenTargetBuildDir(target) + "moc_compilation.cpp"; makefile->GetOrCreateSource(mocCppFile, true); makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", mocCppFile.c_str(), false); @@ -675,6 +675,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( // Create a custom target for running generators at buildtime const std::string autogenTargetName = GetAutogenTargetName(target); + const std::string autogenBuildDir = GetAutogenTargetBuildDir(target); const std::string workingDirectory = cmSystemTools::CollapseFullPath("", makefile->GetCurrentBinaryDirectory()); @@ -683,6 +684,18 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( qtMajorVersion = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR"); } + // Create autogen target build directory + cmSystemTools::MakeDirectory(autogenBuildDir); + + // Create autogen target includes directory and + // add it to the origin target INCLUDE_DIRECTORIES + if (target->GetPropertyAsBool("AUTOMOC") || + target->GetPropertyAsBool("AUTOUIC")) { + const std::string incsDir = autogenBuildDir + "include"; + cmSystemTools::MakeDirectory(incsDir); + target->AddIncludeDirectory(incsDir, true); + } + // Initialize autogen target dependencies std::vector<std::string> depends; if (const char* autogenDepends = |