mirror of
https://github.com/reactos/CMake.git
synced 2024-12-14 07:09:22 +00:00
Merge topic 'Autogen_Simplify'
7db05f42
AUTOGEN: Release notes for SKIP_AUTOX6eabac26
AUTOGEN: Documentation update: cmake-qt, AUTOMOC, AUTOUIC, AUTORCCcbc07d33
AUTOGEN: Documentation for SKIP_AUTOX source file propertiesc17e0a3a
AUTOGEN: Tests: AUTORCC SKIP_AUTORCC and SKIP_AUTOGEN test53787bf8
AUTOGEN: Tests: AUTOUIC SKIP_AUTOUIC and SKIP_AUTOGEN test8dbdd3e7
AUTOGEN: Tests: AUTOMOC SKIP_AUTOMOC and SKIP_AUTOGEN test0699760d
AUTOGEN: Generators: Do moc/uic skip test during file list generationa84f0bb7
AUTOGEN: Generators: Message upper/lower case unification7b766b83
AUTOGEN: Generators: Use single moc/uic skip test method only2964b8cc
AUTOGEN: Generators: Use AUTOMOC/UIC/RCC instead of AUTOGEN in messagesd58b6bf3
AUTOGEN: Generators: Moc/UicSkipTest methods94c319f9
AUTOGEN: Generators: Use separate header lists for MOC and UIC966be439
AUTOGEN: Generators: Be verbose about skipping filesde531432
AUTOGEN: Generators: Remove unused variabled8e45536
AUTOGEN: Initializer: Always remember skipped filesd9313a82
AUTOGEN: Initializer: Enable SKIP_AUTOGEN on all AUTOGEN generated sources ...
This commit is contained in:
commit
2eb5596503
@ -357,6 +357,10 @@ Properties on Source Files
|
||||
/prop_sf/MACOSX_PACKAGE_LOCATION
|
||||
/prop_sf/OBJECT_DEPENDS
|
||||
/prop_sf/OBJECT_OUTPUTS
|
||||
/prop_sf/SKIP_AUTOGEN
|
||||
/prop_sf/SKIP_AUTOMOC
|
||||
/prop_sf/SKIP_AUTORCC
|
||||
/prop_sf/SKIP_AUTOUIC
|
||||
/prop_sf/SYMBOLIC
|
||||
/prop_sf/VS_DEPLOYMENT_CONTENT
|
||||
/prop_sf/VS_DEPLOYMENT_LOCATION
|
||||
|
@ -83,6 +83,9 @@ following targets by setting the :variable:`CMAKE_AUTOMOC` variable. The
|
||||
options to pass to ``moc``. The :variable:`CMAKE_AUTOMOC_MOC_OPTIONS`
|
||||
variable may be populated to pre-set the options for all following targets.
|
||||
|
||||
Source C++ files can be excluded from :prop_tgt:`AUTOMOC` processing by
|
||||
enabling :prop_sf:`SKIP_AUTOMOC` or the broader :prop_sf:`SKIP_AUTOGEN`.
|
||||
|
||||
.. _`Qt AUTOUIC`:
|
||||
|
||||
AUTOUIC
|
||||
@ -149,6 +152,9 @@ result of linking with the :prop_tgt:`IMPORTED` target:
|
||||
Qt5::Widgets
|
||||
)
|
||||
|
||||
Source files can be excluded from :prop_tgt:`AUTOUIC` processing by
|
||||
enabling :prop_sf:`SKIP_AUTOUIC` or the broader :prop_sf:`SKIP_AUTOGEN`.
|
||||
|
||||
.. _`Qt AUTORCC`:
|
||||
|
||||
AUTORCC
|
||||
@ -171,6 +177,9 @@ populated to pre-set the options for all following targets. The
|
||||
``<name>.qrc`` file to set particular options for the file. This
|
||||
overrides options from the :prop_tgt:`AUTORCC_OPTIONS` target property.
|
||||
|
||||
Source files can be excluded from :prop_tgt:`AUTORCC` processing by
|
||||
enabling :prop_sf:`SKIP_AUTORCC` or the broader :prop_sf:`SKIP_AUTOGEN`.
|
||||
|
||||
qtmain.lib on Windows
|
||||
=====================
|
||||
|
||||
|
8
Help/prop_sf/SKIP_AUTOGEN.rst
Normal file
8
Help/prop_sf/SKIP_AUTOGEN.rst
Normal file
@ -0,0 +1,8 @@
|
||||
SKIP_AUTOGEN
|
||||
------------
|
||||
|
||||
Exclude the source file from :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTOUIC` and
|
||||
:prop_tgt:`AUTORCC` processing (for Qt projects).
|
||||
|
||||
For finer control see :prop_sf:`SKIP_AUTOMOC`, :prop_sf:`SKIP_AUTOUIC` and
|
||||
:prop_sf:`SKIP_AUTORCC`.
|
6
Help/prop_sf/SKIP_AUTOMOC.rst
Normal file
6
Help/prop_sf/SKIP_AUTOMOC.rst
Normal file
@ -0,0 +1,6 @@
|
||||
SKIP_AUTOMOC
|
||||
------------
|
||||
|
||||
Exclude the source file from :prop_tgt:`AUTOMOC` processing (for Qt projects).
|
||||
|
||||
For broader control see :prop_sf:`SKIP_AUTOGEN`
|
6
Help/prop_sf/SKIP_AUTORCC.rst
Normal file
6
Help/prop_sf/SKIP_AUTORCC.rst
Normal file
@ -0,0 +1,6 @@
|
||||
SKIP_AUTORCC
|
||||
------------
|
||||
|
||||
Exclude the source file from :prop_tgt:`AUTORCC` processing (for Qt projects).
|
||||
|
||||
For broader control see :prop_sf:`SKIP_AUTOGEN`
|
6
Help/prop_sf/SKIP_AUTOUIC.rst
Normal file
6
Help/prop_sf/SKIP_AUTOUIC.rst
Normal file
@ -0,0 +1,6 @@
|
||||
SKIP_AUTOUIC
|
||||
------------
|
||||
|
||||
Exclude the source file from :prop_tgt:`AUTOUIC` processing (for Qt projects).
|
||||
|
||||
For broader control see :prop_sf:`SKIP_AUTOGEN`
|
@ -47,5 +47,8 @@ See the documentation for this variable for more details.
|
||||
The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group the
|
||||
automoc targets together in an IDE, e.g. in MSVS.
|
||||
|
||||
Source C++ files can be excluded from :prop_tgt:`AUTOMOC` processing by
|
||||
enabling :prop_sf:`SKIP_AUTOMOC` or the broader :prop_sf:`SKIP_AUTOGEN`.
|
||||
|
||||
See the :manual:`cmake-qt(7)` manual for more information on using CMake
|
||||
with Qt.
|
||||
|
@ -24,5 +24,8 @@ generate unspecified unique names for ``rcc``. Therefore if
|
||||
``Q_INIT_RESOURCE()`` or ``Q_CLEANUP_RESOURCE()`` need to be used the
|
||||
``.qrc`` file name must be unique.
|
||||
|
||||
Source files can be excluded from :prop_tgt:`AUTORCC` processing by
|
||||
enabling :prop_sf:`SKIP_AUTORCC` or the broader :prop_sf:`SKIP_AUTOGEN`.
|
||||
|
||||
See the :manual:`cmake-qt(7)` manual for more information on using CMake
|
||||
with Qt.
|
||||
|
@ -20,5 +20,8 @@ Additional command line options for ``uic`` can be set via the
|
||||
The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group the
|
||||
autouic targets together in an IDE, e.g. in MSVS.
|
||||
|
||||
Source files can be excluded from :prop_tgt:`AUTOUIC` processing by
|
||||
enabling :prop_sf:`SKIP_AUTOUIC` or the broader :prop_sf:`SKIP_AUTOGEN`.
|
||||
|
||||
See the :manual:`cmake-qt(7)` manual for more information on using CMake
|
||||
with Qt.
|
||||
|
12
Help/release/dev/QtAutogen_Skip.rst
Normal file
12
Help/release/dev/QtAutogen_Skip.rst
Normal file
@ -0,0 +1,12 @@
|
||||
QtAutogen_Skip
|
||||
--------------
|
||||
|
||||
* The source file properties
|
||||
:prop_sf:`SKIP_AUTOMOC`,
|
||||
:prop_sf:`SKIP_AUTOUIC`,
|
||||
:prop_sf:`SKIP_AUTORCC` and
|
||||
:prop_sf:`SKIP_AUTOGEN`
|
||||
allow to exclude files from
|
||||
:prop_tgt:`AUTOMOC`,
|
||||
:prop_tgt:`AUTOUIC` and
|
||||
:prop_tgt:`AUTORCC` processing.
|
@ -1,7 +1,7 @@
|
||||
set(AM_SOURCES @_cpp_files@ )
|
||||
set(AM_SKIP_MOC @_skip_moc@ )
|
||||
set(AM_SKIP_UIC @_skip_uic@ )
|
||||
set(AM_HEADERS @_moc_headers@ )
|
||||
set(AM_SOURCES @_moc_uic_sources@)
|
||||
set(AM_HEADERS @_moc_uic_headers@)
|
||||
set(AM_SKIP_MOC @_skip_moc@)
|
||||
set(AM_SKIP_UIC @_skip_uic@)
|
||||
set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@)
|
||||
set(AM_MOC_INCLUDES @_moc_incs@)
|
||||
set(AM_MOC_OPTIONS @_moc_options@)
|
||||
|
@ -99,39 +99,64 @@ static std::string GetQtMajorVersion(cmGeneratorTarget const* target)
|
||||
}
|
||||
|
||||
static void SetupSourceFiles(cmGeneratorTarget const* target,
|
||||
std::vector<std::string>& skipMoc,
|
||||
std::vector<std::string>& mocSources,
|
||||
std::vector<std::string>& mocHeaders,
|
||||
std::vector<std::string>& skipUic)
|
||||
std::vector<std::string>& mocUicSources,
|
||||
std::vector<std::string>& mocUicHeaders,
|
||||
std::vector<std::string>& skipMocList,
|
||||
std::vector<std::string>& skipUicList)
|
||||
{
|
||||
cmMakefile* makefile = target->Target->GetMakefile();
|
||||
|
||||
std::vector<cmSourceFile*> srcFiles;
|
||||
target->GetConfigCommonSourceFiles(srcFiles);
|
||||
|
||||
const bool targetMoc = target->GetPropertyAsBool("AUTOMOC");
|
||||
const bool targetUic = target->GetPropertyAsBool("AUTOUIC");
|
||||
|
||||
cmFilePathChecksum fpathCheckSum(makefile);
|
||||
for (std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
|
||||
fileIt != srcFiles.end(); ++fileIt) {
|
||||
cmSourceFile* sf = *fileIt;
|
||||
const cmSystemTools::FileFormat fileType =
|
||||
cmSystemTools::GetFileFormat(sf->GetExtension().c_str());
|
||||
|
||||
if (!(fileType == cmSystemTools::CXX_FILE_FORMAT) &&
|
||||
!(fileType == cmSystemTools::HEADER_FILE_FORMAT)) {
|
||||
continue;
|
||||
}
|
||||
if (cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) {
|
||||
continue;
|
||||
}
|
||||
const std::string absFile =
|
||||
cmsys::SystemTools::GetRealPath(sf->GetFullPath());
|
||||
const std::string ext = sf->GetExtension();
|
||||
|
||||
if (cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC"))) {
|
||||
skipUic.push_back(absFile);
|
||||
// Skip flags
|
||||
const bool skipAll =
|
||||
cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOGEN"));
|
||||
const bool skipMoc =
|
||||
skipAll || cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"));
|
||||
const bool skipUic =
|
||||
skipAll || cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC"));
|
||||
// Add file name to skip lists.
|
||||
// Do this even when the file is not added to the sources/headers lists
|
||||
// because the file name may be extracted from an other file when
|
||||
// processing
|
||||
if (skipMoc) {
|
||||
skipMocList.push_back(absFile);
|
||||
}
|
||||
if (skipUic) {
|
||||
skipUicList.push_back(absFile);
|
||||
}
|
||||
|
||||
if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) {
|
||||
if (cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"))) {
|
||||
skipMoc.push_back(absFile);
|
||||
} else {
|
||||
cmSystemTools::FileFormat fileType =
|
||||
cmSystemTools::GetFileFormat(ext.c_str());
|
||||
if (fileType == cmSystemTools::CXX_FILE_FORMAT) {
|
||||
mocSources.push_back(absFile);
|
||||
} else if (fileType == cmSystemTools::HEADER_FILE_FORMAT) {
|
||||
mocHeaders.push_back(absFile);
|
||||
}
|
||||
if ((targetMoc && !skipMoc) || (targetUic && !skipUic)) {
|
||||
// Add file name to sources or headers list
|
||||
switch (fileType) {
|
||||
case cmSystemTools::CXX_FILE_FORMAT:
|
||||
mocUicSources.push_back(absFile);
|
||||
break;
|
||||
case cmSystemTools::HEADER_FILE_FORMAT:
|
||||
mocUicHeaders.push_back(absFile);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -158,7 +183,6 @@ static void GetCompileDefinitionsAndDirectories(
|
||||
static void MocSetupAutoTarget(
|
||||
cmGeneratorTarget const* target, const std::string& autogenTargetName,
|
||||
std::vector<std::string> const& skipMoc,
|
||||
std::vector<std::string> const& mocHeaders,
|
||||
std::map<std::string, std::string>& configIncludes,
|
||||
std::map<std::string, std::string>& configDefines)
|
||||
{
|
||||
@ -172,9 +196,6 @@ static void MocSetupAutoTarget(
|
||||
makefile->AddDefinition(
|
||||
"_skip_moc",
|
||||
cmOutputConverter::EscapeForCMake(cmJoin(skipMoc, ";")).c_str());
|
||||
makefile->AddDefinition(
|
||||
"_moc_headers",
|
||||
cmOutputConverter::EscapeForCMake(cmJoin(mocHeaders, ";")).c_str());
|
||||
bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE");
|
||||
makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE");
|
||||
|
||||
@ -569,7 +590,9 @@ static void RccSetupAutoTarget(cmGeneratorTarget const* target,
|
||||
std::string ext = sf->GetExtension();
|
||||
if (ext == "qrc") {
|
||||
std::string absFile = cmsys::SystemTools::GetRealPath(sf->GetFullPath());
|
||||
bool skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"));
|
||||
const bool skip =
|
||||
cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOGEN")) ||
|
||||
cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"));
|
||||
|
||||
if (!skip) {
|
||||
_rcc_files += sepRccFiles;
|
||||
@ -632,7 +655,8 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenSources(
|
||||
cmMakefile* makefile = target->Target->GetMakefile();
|
||||
const std::string mocCppFile =
|
||||
GetAutogenTargetBuildDir(target) + "moc_compilation.cpp";
|
||||
makefile->GetOrCreateSource(mocCppFile, true);
|
||||
cmSourceFile* gf = makefile->GetOrCreateSource(mocCppFile, true);
|
||||
gf->SetProperty("SKIP_AUTOGEN", "On");
|
||||
target->AddSource(mocCppFile);
|
||||
}
|
||||
}
|
||||
@ -747,6 +771,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
|
||||
fileIt != srcFiles.end(); ++fileIt) {
|
||||
cmSourceFile* sf = *fileIt;
|
||||
if (sf->GetExtension() == "qrc" &&
|
||||
!cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOGEN")) &&
|
||||
!cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"))) {
|
||||
{
|
||||
const std::string absFile =
|
||||
@ -763,7 +788,8 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
|
||||
rccOutputFile += ".cpp";
|
||||
|
||||
// Add rcc output file to origin target sources
|
||||
makefile->GetOrCreateSource(rccOutputFile, true);
|
||||
cmSourceFile* gf = makefile->GetOrCreateSource(rccOutputFile, true);
|
||||
gf->SetProperty("SKIP_AUTOGEN", "On");
|
||||
target->AddSource(rccOutputFile);
|
||||
// Register rcc output file as generated
|
||||
autogenOutputFiles.push_back(rccOutputFile);
|
||||
@ -850,10 +876,10 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
|
||||
cmOutputConverter::EscapeForCMake(target->GetName()).c_str());
|
||||
makefile->AddDefinition("_target_qt_version", qtMajorVersion.c_str());
|
||||
|
||||
std::vector<std::string> skipUic;
|
||||
std::vector<std::string> mocUicSources;
|
||||
std::vector<std::string> mocUicHeaders;
|
||||
std::vector<std::string> skipMoc;
|
||||
std::vector<std::string> mocSources;
|
||||
std::vector<std::string> mocHeaders;
|
||||
std::vector<std::string> skipUic;
|
||||
std::map<std::string, std::string> configMocIncludes;
|
||||
std::map<std::string, std::string> configMocDefines;
|
||||
std::map<std::string, std::string> configUicOptions;
|
||||
@ -861,14 +887,18 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
|
||||
if (target->GetPropertyAsBool("AUTOMOC") ||
|
||||
target->GetPropertyAsBool("AUTOUIC") ||
|
||||
target->GetPropertyAsBool("AUTORCC")) {
|
||||
SetupSourceFiles(target, skipMoc, mocSources, mocHeaders, skipUic);
|
||||
SetupSourceFiles(target, mocUicSources, mocUicHeaders, skipMoc, skipUic);
|
||||
}
|
||||
makefile->AddDefinition(
|
||||
"_cpp_files",
|
||||
cmOutputConverter::EscapeForCMake(cmJoin(mocSources, ";")).c_str());
|
||||
"_moc_uic_sources",
|
||||
cmOutputConverter::EscapeForCMake(cmJoin(mocUicSources, ";")).c_str());
|
||||
makefile->AddDefinition(
|
||||
"_moc_uic_headers",
|
||||
cmOutputConverter::EscapeForCMake(cmJoin(mocUicHeaders, ";")).c_str());
|
||||
|
||||
if (target->GetPropertyAsBool("AUTOMOC")) {
|
||||
MocSetupAutoTarget(target, autogenTargetName, skipMoc, mocHeaders,
|
||||
configMocIncludes, configMocDefines);
|
||||
MocSetupAutoTarget(target, autogenTargetName, skipMoc, configMocIncludes,
|
||||
configMocDefines);
|
||||
}
|
||||
if (target->GetPropertyAsBool("AUTOUIC")) {
|
||||
UicSetupAutoTarget(target, skipUic, configUicOptions);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5,6 +5,7 @@
|
||||
|
||||
#include <cmConfigure.h> // IWYU pragma: keep
|
||||
#include <cmFilePathChecksum.h>
|
||||
#include <cmsys/RegularExpression.hxx>
|
||||
|
||||
#include <list>
|
||||
#include <map>
|
||||
@ -48,37 +49,46 @@ private:
|
||||
bool GenerateQrc(const std::string& qrcInputFile,
|
||||
const std::string& qrcOutputFile, bool unique_n);
|
||||
|
||||
bool ParseCppFile(
|
||||
bool ParseSourceFile(
|
||||
const std::string& absFilename,
|
||||
const std::vector<std::string>& headerExtensions,
|
||||
std::map<std::string, std::string>& includedMocs,
|
||||
std::map<std::string, std::vector<std::string> >& includedUis);
|
||||
bool StrictParseCppFile(
|
||||
std::map<std::string, std::vector<std::string> >& includedUis,
|
||||
bool relaxed);
|
||||
void SearchHeadersForSourceFile(
|
||||
const std::string& absFilename,
|
||||
const std::vector<std::string>& headerExtensions,
|
||||
std::map<std::string, std::string>& includedMocs,
|
||||
std::map<std::string, std::vector<std::string> >& includedUis);
|
||||
void SearchHeadersForCppFile(
|
||||
const std::string& absFilename,
|
||||
const std::vector<std::string>& headerExtensions,
|
||||
std::set<std::string>& absHeaders);
|
||||
std::set<std::string>& absHeadersMoc,
|
||||
std::set<std::string>& absHeadersUic);
|
||||
|
||||
void ParseHeaders(
|
||||
const std::set<std::string>& absHeaders,
|
||||
const std::set<std::string>& absHeadersMoc,
|
||||
const std::set<std::string>& absHeadersUic,
|
||||
const std::map<std::string, std::string>& includedMocs,
|
||||
std::map<std::string, std::string>& notIncludedMocs,
|
||||
std::map<std::string, std::vector<std::string> >& includedUis);
|
||||
|
||||
void ParseForUic(
|
||||
bool requiresMocing(const std::string& text, std::string& macroName);
|
||||
|
||||
void ParseContentForUic(
|
||||
const std::string& fileName, const std::string& contentsString,
|
||||
std::map<std::string, std::vector<std::string> >& includedUis);
|
||||
|
||||
bool ParseContentForMoc(const std::string& absFilename,
|
||||
const std::string& contentsString,
|
||||
const std::vector<std::string>& headerExtensions,
|
||||
std::map<std::string, std::string>& includedMocs,
|
||||
bool relaxed);
|
||||
|
||||
void ParseForUic(
|
||||
const std::string& fileName,
|
||||
std::map<std::string, std::vector<std::string> >& includedUis);
|
||||
|
||||
void Init();
|
||||
|
||||
bool MocSkipTest(const std::string& absFilename);
|
||||
bool UicSkipTest(const std::string& absFilename);
|
||||
|
||||
bool NameCollisionTest(const std::map<std::string, std::string>& genFiles,
|
||||
std::multimap<std::string, std::string>& collisions);
|
||||
|
||||
@ -91,7 +101,7 @@ private:
|
||||
void LogError(const std::string& message);
|
||||
void LogCommand(const std::vector<std::string>& command);
|
||||
|
||||
bool makeParentDirectory(const std::string& filename);
|
||||
bool MakeParentDirectory(const std::string& filename);
|
||||
|
||||
std::string JoinExts(const std::vector<std::string>& lst);
|
||||
|
||||
@ -117,10 +127,10 @@ private:
|
||||
std::string UicExecutable;
|
||||
std::string RccExecutable;
|
||||
// - File lists
|
||||
std::string Sources;
|
||||
std::string Headers;
|
||||
std::vector<std::string> Sources;
|
||||
std::vector<std::string> Headers;
|
||||
// - Moc
|
||||
std::string SkipMoc;
|
||||
std::vector<std::string> SkipMoc;
|
||||
std::string MocCompileDefinitionsStr;
|
||||
std::string MocIncludesStr;
|
||||
std::string MocOptionsStr;
|
||||
@ -130,7 +140,7 @@ private:
|
||||
std::list<std::string> MocDefinitions;
|
||||
std::vector<std::string> MocOptions;
|
||||
// - Uic
|
||||
std::string SkipUic;
|
||||
std::vector<std::string> SkipUic;
|
||||
std::vector<std::string> UicTargetOptions;
|
||||
std::map<std::string, std::string> UicOptions;
|
||||
// - Rcc
|
||||
@ -142,6 +152,10 @@ private:
|
||||
std::string OldCompileSettingsStr;
|
||||
// - Utility
|
||||
cmFilePathChecksum fpathCheckSum;
|
||||
cmsys::RegularExpression RegExpQObject;
|
||||
cmsys::RegularExpression RegExpQGadget;
|
||||
cmsys::RegularExpression RegExpMocInclude;
|
||||
cmsys::RegularExpression RegExpUicInclude;
|
||||
// - Flags
|
||||
bool IncludeProjectDirsBefore;
|
||||
bool Verbose;
|
||||
|
@ -139,6 +139,69 @@ if (automoc_rerun_result)
|
||||
message(SEND_ERROR "Second build of automoc_rerun failed.")
|
||||
endif()
|
||||
|
||||
# -- Test: AUTOMOC, SKIP_AUTOMOC
|
||||
# Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target
|
||||
qtx_wrap_cpp(skipMocWrapMoc
|
||||
skipSource/qItemA.hpp
|
||||
skipSource/qItemB.hpp)
|
||||
set(skipMocSources
|
||||
skipMoc.cpp
|
||||
skipSource/qItemA.cpp
|
||||
skipSource/qItemB.cpp
|
||||
skipSource/qItemC.cpp)
|
||||
set_property(SOURCE skipSource/qItemA.cpp PROPERTY SKIP_AUTOMOC ON)
|
||||
set_property(SOURCE skipSource/qItemB.cpp PROPERTY SKIP_AUTOGEN ON)
|
||||
# AUTOMOC enabled only
|
||||
add_executable(skipMocA ${skipMocSources} ${skipMocWrapMoc})
|
||||
set_property(TARGET skipMocA PROPERTY AUTOMOC ON)
|
||||
target_link_libraries(skipMocA ${QT_LIBRARIES})
|
||||
# AUTOMOC and AUTOUIC enabled
|
||||
add_executable(skipMocB ${skipMocSources} ${skipMocWrapMoc})
|
||||
set_property(TARGET skipMocB PROPERTY AUTOMOC ON)
|
||||
set_property(TARGET skipMocB PROPERTY AUTOUIC ON)
|
||||
target_link_libraries(skipMocB ${QT_LIBRARIES})
|
||||
|
||||
# -- Test: AUTOUIC, SKIP_AUTOUIC
|
||||
# Test for SKIP_AUTOUIC and SKIP_AUTOGEN on an AUTOUIC enabled target
|
||||
set(skipUicSources
|
||||
skipUic.cpp
|
||||
skipSource/skipUicGen.cpp
|
||||
skipSource/skipUicNoGen1.cpp
|
||||
skipSource/skipUicNoGen2.cpp
|
||||
)
|
||||
set_property(SOURCE skipSource/skipUicNoGen1.cpp PROPERTY SKIP_AUTOUIC ON)
|
||||
set_property(SOURCE skipSource/skipUicNoGen2.cpp PROPERTY SKIP_AUTOGEN ON)
|
||||
# AUTOUIC enabled
|
||||
add_executable(skipUicA ${skipUicSources})
|
||||
set_property(TARGET skipUicA PROPERTY AUTOUIC ON)
|
||||
target_link_libraries(skipUicA ${QT_LIBRARIES})
|
||||
# AUTOUIC and AUTOMOC enabled
|
||||
add_executable(skipUicB ${skipUicSources})
|
||||
set_property(TARGET skipUicB PROPERTY AUTOUIC ON)
|
||||
set_property(TARGET skipUicB PROPERTY AUTOMOC ON)
|
||||
target_link_libraries(skipUicB ${QT_LIBRARIES})
|
||||
|
||||
# -- Test: AUTORCC, SKIP_AUTORCC
|
||||
# Test for SKIP_AUTORCC and SKIP_AUTOGEN on an AUTORCC enabled target
|
||||
set(skipRccSources
|
||||
skipRcc.cpp
|
||||
skipSource/skipRccBad1.qrc
|
||||
skipSource/skipRccBad2.qrc
|
||||
skipSource/skipRccGood.qrc
|
||||
)
|
||||
set_property(SOURCE skipSource/skipRccBad1.qrc PROPERTY SKIP_AUTORCC ON)
|
||||
set_property(SOURCE skipSource/skipRccBad2.qrc PROPERTY SKIP_AUTOGEN ON)
|
||||
# AUTORCC enabled
|
||||
add_executable(skipRccA ${skipRccSources})
|
||||
set_property(TARGET skipRccA PROPERTY AUTORCC ON)
|
||||
target_link_libraries(skipRccA ${QT_LIBRARIES})
|
||||
# AUTORCC, AUTOUIC and AUTOMOC enabled
|
||||
add_executable(skipRccB ${skipRccSources})
|
||||
set_property(TARGET skipRccB PROPERTY AUTORCC ON)
|
||||
set_property(TARGET skipRccB PROPERTY AUTOUIC ON)
|
||||
set_property(TARGET skipRccB PROPERTY AUTOMOC ON)
|
||||
target_link_libraries(skipRccB ${QT_LIBRARIES})
|
||||
|
||||
# -- Test: AUTOMOC AUTORCC
|
||||
# Source files with the same basename in different subdirectories
|
||||
add_subdirectory(sameName)
|
||||
|
14
Tests/QtAutogen/skipMoc.cpp
Normal file
14
Tests/QtAutogen/skipMoc.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
#include "skipSource/qItemA.hpp"
|
||||
#include "skipSource/qItemB.hpp"
|
||||
#include "skipSource/qItemC.hpp"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
QItemA itemA;
|
||||
QItemA itemB;
|
||||
QItemA itemC;
|
||||
|
||||
// Fails to link if the symbol is not present.
|
||||
return 0;
|
||||
}
|
9
Tests/QtAutogen/skipRcc.cpp
Normal file
9
Tests/QtAutogen/skipRcc.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
extern int qInitResources_skipRccGood();
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
// Fails to link if the symbol is not present.
|
||||
qInitResources_skipRccGood();
|
||||
return 0;
|
||||
}
|
5
Tests/QtAutogen/skipSource/qItemA.cpp
Normal file
5
Tests/QtAutogen/skipSource/qItemA.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
#include "qItemA.hpp"
|
||||
|
||||
void QItemA::go()
|
||||
{
|
||||
}
|
13
Tests/QtAutogen/skipSource/qItemA.hpp
Normal file
13
Tests/QtAutogen/skipSource/qItemA.hpp
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef QITEMA_HPP
|
||||
#define QITEMA_HPP
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QItemA : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_SLOT
|
||||
void go();
|
||||
};
|
||||
|
||||
#endif
|
5
Tests/QtAutogen/skipSource/qItemB.cpp
Normal file
5
Tests/QtAutogen/skipSource/qItemB.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
#include "qItemB.hpp"
|
||||
|
||||
void QItemB::go()
|
||||
{
|
||||
}
|
13
Tests/QtAutogen/skipSource/qItemB.hpp
Normal file
13
Tests/QtAutogen/skipSource/qItemB.hpp
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef QITEMB_HPP
|
||||
#define QITEMB_HPP
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QItemB : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_SLOT
|
||||
void go();
|
||||
};
|
||||
|
||||
#endif
|
5
Tests/QtAutogen/skipSource/qItemC.cpp
Normal file
5
Tests/QtAutogen/skipSource/qItemC.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
#include "qItemC.hpp"
|
||||
|
||||
void QItemC::go()
|
||||
{
|
||||
}
|
13
Tests/QtAutogen/skipSource/qItemC.hpp
Normal file
13
Tests/QtAutogen/skipSource/qItemC.hpp
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef QITEMC_HPP
|
||||
#define QITEMC_HPP
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QItemC : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_SLOT
|
||||
void go();
|
||||
};
|
||||
|
||||
#endif
|
5
Tests/QtAutogen/skipSource/skipRccBad1.qrc
Normal file
5
Tests/QtAutogen/skipSource/skipRccBad1.qrc
Normal file
@ -0,0 +1,5 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>skipRccGood.cpp</file>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
</qresource>
|
||||
</RCC>
|
5
Tests/QtAutogen/skipSource/skipRccBad2.qrc
Normal file
5
Tests/QtAutogen/skipSource/skipRccBad2.qrc
Normal file
@ -0,0 +1,5 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><
|
||||
<qresource>
|
||||
<file>skipRccGood.cpp</file>
|
||||
</qresource>
|
||||
</RCC>
|
6
Tests/QtAutogen/skipSource/skipRccGood.qrc
Normal file
6
Tests/QtAutogen/skipSource/skipRccGood.qrc
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>skipRccBad1.qrc</file>
|
||||
<file>skipRccBad2.qrc</file>
|
||||
</qresource>
|
||||
</RCC>
|
7
Tests/QtAutogen/skipSource/skipUicGen.cpp
Normal file
7
Tests/QtAutogen/skipSource/skipUicGen.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
#include "skipUicGen.hpp"
|
||||
#include "ui_uigen2.h"
|
||||
|
||||
void skipGen()
|
||||
{
|
||||
}
|
8
Tests/QtAutogen/skipSource/skipUicGen.hpp
Normal file
8
Tests/QtAutogen/skipSource/skipUicGen.hpp
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef SKIPUICGEN_HPP
|
||||
#define SKIPUICGEN_HPP
|
||||
|
||||
#include "ui_uigen1.h"
|
||||
|
||||
void skipGen();
|
||||
|
||||
#endif
|
7
Tests/QtAutogen/skipSource/skipUicNoGen1.cpp
Normal file
7
Tests/QtAutogen/skipSource/skipUicNoGen1.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
#include "skipUicNoGen1.hpp"
|
||||
#include "ui_nogen2.h"
|
||||
|
||||
void skipNoGen1()
|
||||
{
|
||||
}
|
8
Tests/QtAutogen/skipSource/skipUicNoGen1.hpp
Normal file
8
Tests/QtAutogen/skipSource/skipUicNoGen1.hpp
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef SKIPUICNOGEN1_H
|
||||
#define SKIPUICNOGEN1_H
|
||||
|
||||
#include "ui_nogen1.h"
|
||||
|
||||
void skipNoGen1();
|
||||
|
||||
#endif
|
7
Tests/QtAutogen/skipSource/skipUicNoGen2.cpp
Normal file
7
Tests/QtAutogen/skipSource/skipUicNoGen2.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
#include "skipUicNoGen2.hpp"
|
||||
#include "ui_nogen2.h"
|
||||
|
||||
void skipNoGen2()
|
||||
{
|
||||
}
|
8
Tests/QtAutogen/skipSource/skipUicNoGen2.hpp
Normal file
8
Tests/QtAutogen/skipSource/skipUicNoGen2.hpp
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef SKIPUICNOGEN2_H
|
||||
#define SKIPUICNOGEN2_H
|
||||
|
||||
#include "ui_nogen1.h"
|
||||
|
||||
void skipNoGen2();
|
||||
|
||||
#endif
|
6
Tests/QtAutogen/skipSource/ui_nogen1.h
Normal file
6
Tests/QtAutogen/skipSource/ui_nogen1.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef UI_NOGEN1_H
|
||||
#define UI_NOGEN1_H
|
||||
|
||||
void ui_nogen1();
|
||||
|
||||
#endif
|
6
Tests/QtAutogen/skipSource/ui_nogen2.h
Normal file
6
Tests/QtAutogen/skipSource/ui_nogen2.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef UI_NOGEN2_H
|
||||
#define UI_NOGEN2_H
|
||||
|
||||
void ui_nogen2();
|
||||
|
||||
#endif
|
24
Tests/QtAutogen/skipSource/uigen1.ui
Normal file
24
Tests/QtAutogen/skipSource/uigen1.ui
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>UiGen1</class>
|
||||
<widget class="QWidget" name="UiGen1">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QTreeView" name="treeView"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
24
Tests/QtAutogen/skipSource/uigen2.ui
Normal file
24
Tests/QtAutogen/skipSource/uigen2.ui
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>UiGen2</class>
|
||||
<widget class="QWidget" name="UiGen2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QTreeView" name="treeView"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
22
Tests/QtAutogen/skipUic.cpp
Normal file
22
Tests/QtAutogen/skipUic.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
#include "skipSource/skipUicGen.hpp"
|
||||
#include "skipSource/skipUicNoGen1.hpp"
|
||||
#include "skipSource/skipUicNoGen2.hpp"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
skipGen();
|
||||
skipNoGen1();
|
||||
skipNoGen2();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// -- Function definitions
|
||||
void ui_nogen1()
|
||||
{
|
||||
}
|
||||
|
||||
void ui_nogen2()
|
||||
{
|
||||
}
|
Loading…
Reference in New Issue
Block a user