summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpolygon
Commit message (Expand)AuthorAgeFilesLines
* Update copyright year to 2010Jason McDonald2010-01-061-1/+1
* Update license headers again.Jason McDonald2009-09-091-4/+4
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-311-13/+13
|\
| * Update tech preview license header.Jason McDonald2009-08-311-13/+13
| * Update license headers.Jason McDonald2009-08-111-1/+1
* | Merge commit 'qt/master'Jason Barron2009-08-131-1/+1
|\ \
| * | Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| |/
* | Merge commit 'qt/master-stable'Jason Barron2009-08-101-1/+1
|/
* Cleaned up test naming and platform-specific tests.Rohan McGovern2009-08-063-0/+102
> -rw-r--r--Help/prop_tgt/SOURCES.rst3
-rw-r--r--Help/release/dev/target-INTERFACE_SOURCES.rst5
-rw-r--r--Help/release/dev/target-SOURCES-write.rst6
-rw-r--r--Help/release/dev/target_sources-command.rst5
-rw-r--r--Help/variable/CMAKE_DEBUG_TARGET_PROPERTIES.rst3
-rw-r--r--Source/CMakeLists.txt1
-rw-r--r--Source/cmComputeTargetDepends.cxx70
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx3
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx3
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx3
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx3
-rw-r--r--Source/cmFLTKWrapUICommand.cxx2
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.cxx12
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.h5
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx9
-rw-r--r--Source/cmGeneratorTarget.cxx75
-rw-r--r--Source/cmGeneratorTarget.h32
-rw-r--r--Source/cmGlobalGenerator.cxx17
-rw-r--r--Source/cmGlobalKdevelopGenerator.cxx3
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx3
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx10
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx28
-rw-r--r--Source/cmLocalGenerator.cxx7
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx6
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx37
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx9
-rw-r--r--Source/cmMakefileTargetGenerator.cxx29
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx3
-rw-r--r--Source/cmNinjaTargetGenerator.cxx16
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.cxx4
-rw-r--r--Source/cmQtAutoGenerators.cxx4
-rw-r--r--Source/cmTarget.cxx321
-rw-r--r--Source/cmTarget.h18
-rw-r--r--Source/cmTargetSourcesCommand.cxx64
-rw-r--r--Source/cmTargetSourcesCommand.h55
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx29
-rw-r--r--Tests/CMakeLists.txt5
-rw-r--r--Tests/ConfigSources/CMakeLists.txt17
-rw-r--r--Tests/ConfigSources/iface_debug.h4
-rw-r--r--Tests/ConfigSources/iface_debug_src.cpp7
-rw-r--r--Tests/ConfigSources/iface_src.cpp5
-rw-r--r--Tests/ConfigSources/main.cpp7
-rw-r--r--Tests/QtAutogen/CMakeLists.txt8
-rw-r--r--Tests/QtAutogen/debug_class.cpp9
-rw-r--r--Tests/QtAutogen/debug_class.h20
-rw-r--r--Tests/QtAutogen/debug_class.ui45
-rw-r--r--Tests/QtAutogen/debug_resource.qrc5
-rw-r--r--Tests/QtAutogen/main.cpp9
-rw-r--r--Tests/QtAutogen/resourcetester.cpp4
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/TargetSources/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/TargetSources/ConfigNotAllowed-result.txt1
-rw-r--r--Tests/RunCMake/TargetSources/ConfigNotAllowed-stderr.txt14
-rw-r--r--Tests/RunCMake/TargetSources/ConfigNotAllowed.cmake2
-rw-r--r--Tests/RunCMake/TargetSources/OriginDebug-result.txt1
-rw-r--r--Tests/RunCMake/TargetSources/OriginDebug-stderr.txt31
-rw-r--r--Tests/RunCMake/TargetSources/OriginDebug.cmake20
-rw-r--r--Tests/RunCMake/TargetSources/OriginDebugIDE-result.txt1
-rw-r--r--Tests/RunCMake/TargetSources/OriginDebugIDE-stderr.txt40
-rw-r--r--Tests/RunCMake/TargetSources/OriginDebugIDE.cmake4
-rw-r--r--Tests/RunCMake/TargetSources/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/TargetSources/empty_1.cpp7
-rw-r--r--Tests/RunCMake/TargetSources/empty_2.cpp7
-rw-r--r--Tests/RunCMake/TargetSources/empty_3.cpp7
-rw-r--r--Tests/RunCMake/TargetSources/empty_4.cpp7
-rw-r--r--Tests/SourcesProperty/CMakeLists.txt12
-rw-r--r--Tests/SourcesProperty/iface.cpp5
-rw-r--r--Tests/SourcesProperty/iface.h4
-rw-r--r--Tests/SourcesProperty/main.cpp7
-rw-r--r--Tests/SourcesProperty/prop.cpp5
74 files changed, 1098 insertions, 183 deletions
diff --git a/Help/command/target_sources.rst b/Help/command/target_sources.rst
new file mode 100644
index 0000000..ff756b4
--- /dev/null
+++ b/Help/command/target_sources.rst
@@ -0,0 +1,28 @@
+target_sources
+--------------
+
+Add sources to a target.
+
+::
+
+ target_sources(<target>
+ <INTERFACE|PUBLIC|PRIVATE> [items1...]
+ [<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
+
+Specify sources to use when compiling a given target. The
+named ``<target>`` must have been created by a command such as
+:command:`add_executable` or :command:`add_library` and must not be an
+:prop_tgt:`IMPORTED Target`.
+
+The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
+specify the scope of the following arguments. ``PRIVATE`` and ``PUBLIC``
+items will populate the :prop_tgt:`SOURCES` property of
+``<target>``. ``PUBLIC`` and ``INTERFACE`` items will populate the
+:prop_tgt:`INTERFACE_SOURCES` property of ``<target>``. The
+following arguments specify sources. Repeated calls for the same
+``<target>`` append items in the order called.
+
+Arguments to ``target_sources`` may use "generator expressions"
+with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
+manual for available expressions. See the :manual:`cmake-buildsystem(7)`
+manual for more on defining buildsystem properties.
diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst
index fb0d2b5..4b1dbed 100644
--- a/Help/manual/cmake-commands.7.rst
+++ b/Help/manual/cmake-commands.7.rst
@@ -94,6 +94,7 @@ These commands may be used freely in CMake projects.
/command/target_compile_options
/command/target_include_directories
/command/target_link_libraries
+ /command/target_sources
/command/try_compile
/command/try_run
/command/unset
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 6ea5839..fd16eb9 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -152,6 +152,7 @@ Properties on Targets
/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES
/prop_tgt/INTERFACE_LINK_LIBRARIES
/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE
+ /prop_tgt/INTERFACE_SOURCES
/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
/prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG
/prop_tgt/INTERPROCEDURAL_OPTIMIZATION
diff --git a/Help/prop_tgt/INTERFACE_SOURCES.rst b/Help/prop_tgt/INTERFACE_SOURCES.rst
new file mode 100644
index 0000000..fb28231
--- /dev/null
+++ b/Help/prop_tgt/INTERFACE_SOURCES.rst
@@ -0,0 +1,15 @@
+INTERFACE_SOURCES
+-----------------
+
+List of interface sources to pass to the compiler.
+
+Targets may populate this property to publish the sources
+for consuming targets to compile. Consuming
+targets can add entries to their own :prop_tgt:`SOURCES` property
+such as ``$<TARGET_PROPERTY:foo,INTERFACE_SOURCES>`` to use the
+sources specified in the interface of ``foo``.
+
+Contents of ``INTERFACE_SOURCES`` may use "generator expressions"
+with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
+manual for available expressions. See the :manual:`cmake-buildsystem(7)`
+manual for more on defining buildsystem properties.
diff --git a/Help/prop_tgt/SOURCES.rst b/Help/prop_tgt/SOURCES.rst
index 833b65a..493643e 100644
--- a/Help/prop_tgt/SOURCES.rst
+++ b/Help/prop_tgt/SOURCES.rst
@@ -3,5 +3,4 @@ SOURCES
Source names specified for a target.
-Read-only list of sources specified for a target. The names returned
-are suitable for passing to the set_source_files_properties command.
+List of sources specified for a target.
diff --git a/Help/release/dev/target-INTERFACE_SOURCES.rst b/Help/release/dev/target-INTERFACE_SOURCES.rst
new file mode 100644
index 0000000..4e34943
--- /dev/null
+++ b/Help/release/dev/target-INTERFACE_SOURCES.rst
@@ -0,0 +1,5 @@
+target-INTERFACE_SOURCES
+------------------------
+
+* A new :prop_tgt:`INTERFACE_SOURCES` target property was introduced. This is
+ consumed by dependent targets, which compile and link the listed sources.
diff --git a/Help/release/dev/target-SOURCES-write.rst b/Help/release/dev/target-SOURCES-write.rst
new file mode 100644
index 0000000..a754a73
--- /dev/null
+++ b/Help/release/dev/target-SOURCES-write.rst
@@ -0,0 +1,6 @@
+target-SOURCES-write.rst
+------------------------
+
+* It is now possible to write and append to the :prop_tgt:`SOURCES` target
+ property. The :variable:`CMAKE_DEBUG_TARGET_PROPERTIES` variable may be
+ used to trace the origin of sources.
diff --git a/Help/release/dev/target_sources-command.rst b/Help/release/dev/target_sources-command.rst
new file mode 100644
index 0000000..abfb303
--- /dev/null
+++ b/Help/release/dev/target_sources-command.rst
@@ -0,0 +1,5 @@
+target_sources-command
+----------------------
+
+* The :command:`target_sources` command was added to add to the
+ :prop_tgt:`SOURCES` target property.
diff --git a/Help/variable/CMAKE_DEBUG_TARGET_PROPERTIES.rst b/Help/variable/CMAKE_DEBUG_TARGET_PROPERTIES.rst
index 11aed0c..edd8fa1 100644
--- a/Help/variable/CMAKE_DEBUG_TARGET_PROPERTIES.rst
+++ b/Help/variable/CMAKE_DEBUG_TARGET_PROPERTIES.rst
@@ -6,7 +6,8 @@ Enables tracing output for target properties.
This variable can be populated with a list of properties to generate
debug output for when evaluating target properties. Currently it can
only be used when evaluating the :prop_tgt:`INCLUDE_DIRECTORIES`,
-:prop_tgt:`COMPILE_DEFINITIONS`, :prop_tgt:`COMPILE_OPTIONS`, :prop_tgt:`AUTOUIC_OPTIONS`,
+:prop_tgt:`COMPILE_DEFINITIONS`, :prop_tgt:`COMPILE_OPTIONS`,
+:prop_tgt:`AUTOUIC_OPTIONS`, :prop_tgt:`SOURCES`,
:prop_tgt:`POSITION_INDEPENDENT_CODE` target properties and any other property
listed in :prop_tgt:`COMPATIBLE_INTERFACE_STRING` and other ``COMPATIBLE_INTERFACE_``
properties. It outputs an origin for each entry in the target property.
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 27d099d..4c678d8 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -348,6 +348,7 @@ foreach(command_file
cmTargetCompileDefinitionsCommand
cmTargetCompileOptionsCommand
cmTargetIncludeDirectoriesCommand
+ cmTargetSourcesCommand
cmUseMangledMesaCommand
cmUtilitySourceCommand
cmVariableRequiresCommand
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 27fc862..eb62455 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -213,56 +213,42 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
// deal with config-specific dependencies.
{
std::set<std::string> emitted;
- {
cmGeneratorTarget* gt = depender->GetMakefile()->GetLocalGenerator()
->GetGlobalGenerator()
->GetGeneratorTarget(depender);
- std::vector<cmSourceFile const*> objectFiles;
- gt->GetExternalObjects(objectFiles);
- for(std::vector<cmSourceFile const*>::const_iterator
- it = objectFiles.begin(); it != objectFiles.end(); ++it)
- {
- std::string objLib = (*it)->GetObjectLibrary();
- if (!objLib.empty() && emitted.insert(objLib).second)
- {
- if(depender->GetType() != cmTarget::EXECUTABLE &&
- depender->GetType() != cmTarget::STATIC_LIBRARY &&
- depender->GetType() != cmTarget::SHARED_LIBRARY &&
- depender->GetType() != cmTarget::MODULE_LIBRARY)
- {
- this->GlobalGenerator->GetCMakeInstance()
- ->IssueMessage(cmake::FATAL_ERROR,
- "Only executables and non-OBJECT libraries may "
- "reference target objects.",
- depender->GetBacktrace());
- return;
- }
- const_cast<cmTarget*>(depender)->AddUtility(objLib);
- }
- }
- }
- {
- std::vector<std::string> tlibs;
- depender->GetDirectLinkLibraries("", tlibs, depender);
- // A target should not depend on itself.
- emitted.insert(depender->GetName());
- for(std::vector<std::string>::const_iterator lib = tlibs.begin();
- lib != tlibs.end(); ++lib)
- {
- // Don't emit the same library twice for this target.
- if(emitted.insert(*lib).second)
- {
- this->AddTargetDepend(depender_index, *lib, true);
- this->AddInterfaceDepends(depender_index, *lib,
- true, emitted);
- }
- }
- }
+
std::vector<std::string> configs;
depender->GetMakefile()->GetConfigurations(configs);
+ if (configs.empty())
+ {
+ configs.push_back("");
+ }
for (std::vector<std::string>::const_iterator it = configs.begin();
it != configs.end(); ++it)
{
+ std::vector<cmSourceFile const*> objectFiles;
+ gt->GetExternalObjects(objectFiles, *it);
+ for(std::vector<cmSourceFile const*>::const_iterator
+ oi = objectFiles.begin(); oi != objectFiles.end(); ++oi)
+ {
+ std::string objLib = (*oi)->GetObjectLibrary();
+ if (!objLib.empty() && emitted.insert(objLib).second)
+ {
+ if(depender->GetType() != cmTarget::EXECUTABLE &&
+ depender->GetType() != cmTarget::STATIC_LIBRARY &&
+ depender->GetType() != cmTarget::SHARED_LIBRARY &&
+ depender->GetType() != cmTarget::MODULE_LIBRARY)
+ {
+ this->GlobalGenerator->GetCMakeInstance()
+ ->IssueMessage(cmake::FATAL_ERROR,
+ "Only executables and non-OBJECT libraries may "
+ "reference target objects.",
+ depender->GetBacktrace());
+ return;
+ }
+ const_cast<cmTarget*>(depender)->AddUtility(objLib);
+ }
+ }
std::vector<std::string> tlibs;
depender->GetDirectLinkLibraries(*it, tlibs, depender);
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index e99bf04..6f76dc4 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -399,7 +399,8 @@ void cmExtraCodeBlocksGenerator
case cmTarget::UTILITY: // can have sources since 2.6.3
{
std::vector<cmSourceFile*> sources;
- ti->second.GetSourceFiles(sources);
+ ti->second.GetSourceFiles(sources,
+ makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
for (std::vector<cmSourceFile*>::const_iterator si=sources.begin();
si!=sources.end(); si++)
{
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 1cbd057..33ffc90 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -214,7 +214,8 @@ void cmExtraCodeLiteGenerator
case cmTarget::MODULE_LIBRARY:
{
std::vector<cmSourceFile*> sources;
- ti->second.GetSourceFiles(sources);
+ ti->second.GetSourceFiles(sources,
+ makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
for (std::vector<cmSourceFile*>::const_iterator si=sources.begin();
si!=sources.end(); si++)
{
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index fcb95a0..e23551e 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -560,7 +560,8 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(
// get the files from the source lists then add them to the groups
cmTarget* tgt = const_cast<cmTarget*>(&ti->second);
std::vector<cmSourceFile*> files;
- tgt->GetSourceFiles(files);
+ tgt->GetSourceFiles(files,
+ makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
for(std::vector<cmSourceFile*>::const_iterator sfIt = files.begin();
sfIt != files.end();
sfIt++)
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index ec5ffc2..7fe47c3 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -238,7 +238,8 @@ void cmExtraSublimeTextGenerator::
cmGeneratorTarget *gtgt = this->GlobalGenerator
->GetGeneratorTarget(target);
std::vector<cmSourceFile*> sourceFiles;
- target->GetSourceFiles(sourceFiles);
+ target->GetSourceFiles(sourceFiles,
+ makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
std::vector<cmSourceFile*>::const_iterator sourceFilesEnd =
sourceFiles.end();
for (std::vector<cmSourceFile*>::const_iterator iter =
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index e2b114a..f7d8243 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -133,7 +133,7 @@ void cmFLTKWrapUICommand::FinalPass()
return;
}
std::vector<cmSourceFile*> srcs;
- target->GetSourceFiles(srcs);
+ target->GetSourceFiles(srcs, "");
bool found = false;
for (unsigned int i = 0; i < srcs.size(); ++i)
{
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 07efba9..7f8e694 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -179,6 +179,18 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries(const char *tgt)
|| strcmp(prop, "INTERFACE_LINK_LIBRARIES") == 0;
}
+std::string cmGeneratorExpressionDAGChecker::TopTarget() const
+{
+ const cmGeneratorExpressionDAGChecker *top = this;
+ const cmGeneratorExpressionDAGChecker *parent = this->Parent;
+ while (parent)
+ {
+ top = parent;
+ parent = parent->Parent;
+ }
+ return top->Target;
+}
+
enum TransitiveProperty {
#define DEFINE_ENUM_ENTRY(NAME) NAME,
CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(DEFINE_ENUM_ENTRY)
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 6cbbd2a..b3147f7 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -25,7 +25,8 @@
SELECT(F, EvaluatingSystemIncludeDirectories, SYSTEM_INCLUDE_DIRECTORIES) \
SELECT(F, EvaluatingCompileDefinitions, COMPILE_DEFINITIONS) \
SELECT(F, EvaluatingCompileOptions, COMPILE_OPTIONS) \
- SELECT(F, EvaluatingAutoUicOptions, AUTOUIC_OPTIONS)
+ SELECT(F, EvaluatingAutoUicOptions, AUTOUIC_OPTIONS) \
+ SELECT(F, EvaluatingSources, SOURCES)
#define CM_FOR_EACH_TRANSITIVE_PROPERTY(F) \
CM_FOR_EACH_TRANSITIVE_PROPERTY_IMPL(F, CM_SELECT_BOTH)
@@ -70,6 +71,8 @@ struct cmGeneratorExpressionDAGChecker
void SetTransitivePropertiesOnly()
{ this->TransitivePropertiesOnly = true; }
+ std::string TopTarget() const;
+
private:
Result CheckGraph() const;
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 95227d2..a513921 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -985,7 +985,8 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
if (propertyName == "LINKER_LANGUAGE")
{
if (target->LinkLanguagePropagatesToDependents() &&
- dagCheckerParent && dagCheckerParent->EvaluatingLinkLibraries())
+ dagCheckerParent && (dagCheckerParent->EvaluatingLinkLibraries()
+ || dagCheckerParent->EvaluatingSources()))
{
reportError(context, content->GetOriginalExpression(),
"LINKER_LANGUAGE target property can not be used while evaluating "
@@ -1282,7 +1283,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
}
std::vector<cmSourceFile const*> objectSources;
- gt->GetObjectSources(objectSources);
+ gt->GetObjectSources(objectSources, context->Config);
std::map<cmSourceFile const*, std::string> mapping;
for(std::vector<cmSourceFile const*>::const_iterator it
@@ -1579,7 +1580,9 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
"Target \"" + name + "\" is not an executable or library.");
return std::string();
}
- if (dagChecker && dagChecker->EvaluatingLinkLibraries(name.c_str()))
+ if (dagChecker && (dagChecker->EvaluatingLinkLibraries(name.c_str())
+ || (dagChecker->EvaluatingSources()
+ && name == dagChecker->TopTarget())))
{
::reportError(context, content->GetOriginalExpression(),
"Expressions which require the linker language may not "
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 321dd42..01fad26 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -289,7 +289,7 @@ static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt,
#define IMPLEMENT_VISIT_IMPL(DATA, DATATYPE) \
{ \
std::vector<cmSourceFile*> sourceFiles; \
- this->Target->GetSourceFiles(sourceFiles); \
+ this->Target->GetSourceFiles(sourceFiles, config); \
TagVisitor<DATA ## Tag DATATYPE> visitor(this->Target, data); \
for(std::vector<cmSourceFile*>::const_iterator si = sourceFiles.begin(); \
si != sourceFiles.end(); ++si) \
@@ -308,7 +308,8 @@ static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt,
//----------------------------------------------------------------------------
void
cmGeneratorTarget
-::GetObjectSources(std::vector<cmSourceFile const*> &data) const
+::GetObjectSources(std::vector<cmSourceFile const*> &data,
+ const std::string& config) const
{
IMPLEMENT_VISIT(ObjectSources);
@@ -332,8 +333,19 @@ void cmGeneratorTarget::ComputeObjectMapping()
{
return;
}
- std::vector<cmSourceFile const*> sourceFiles;
- this->GetObjectSources(sourceFiles);
+
+ std::vector<std::string> configs;
+ this->Makefile->GetConfigurations(configs);
+ if (configs.empty())
+ {
+ configs.push_back("");
+ }
+ for(std::vector<std::string>::const_iterator ci = configs.begin();
+ ci != configs.end(); ++ci)
+ {
+ std::vector<cmSourceFile const*> sourceFiles;
+ this->GetObjectSources(sourceFiles, *ci);
+ }
}
//----------------------------------------------------------------------------
@@ -360,7 +372,8 @@ bool cmGeneratorTarget::HasExplicitObjectName(cmSourceFile const* file) const
//----------------------------------------------------------------------------
void cmGeneratorTarget
-::GetIDLSources(std::vector<cmSourceFile const*>& data) const
+::GetIDLSources(std::vector<cmSourceFile const*>& data,
+ const std::string& config) const
{
IMPLEMENT_VISIT(IDLSources);
}
@@ -368,14 +381,16 @@ void cmGeneratorTarget
//----------------------------------------------------------------------------
void
cmGeneratorTarget
-::GetHeaderSources(std::vector<cmSourceFile const*>& data) const
+::GetHeaderSources(std::vector<cmSourceFile const*>& data,
+ const std::string& config) const
{
IMPLEMENT_VISIT(HeaderSources);
}
//----------------------------------------------------------------------------
void cmGeneratorTarget
-::GetExtraSources(std::vector<cmSourceFile const*>& data) const
+::GetExtraSources(std::vector<cmSourceFile const*>& data,
+ const std::string& config) const
{
IMPLEMENT_VISIT(ExtraSources);
}
@@ -383,7 +398,8 @@ void cmGeneratorTarget
//----------------------------------------------------------------------------
void
cmGeneratorTarget
-::GetCustomCommands(std::vector<cmSourceFile const*>& data) const
+::GetCustomCommands(std::vector<cmSourceFile const*>& data,
+ const std::string& config) const
{
IMPLEMENT_VISIT(CustomCommands);
}
@@ -391,14 +407,16 @@ cmGeneratorTarget
//----------------------------------------------------------------------------
void
cmGeneratorTarget
-::GetExternalObjects(std::vector<cmSourceFile const*>& data) const
+::GetExternalObjects(std::vector<cmSourceFile const*>& data,
+ const std::string& config) const
{
IMPLEMENT_VISIT(ExternalObjects);
}
//----------------------------------------------------------------------------
void
-cmGeneratorTarget::GetExpectedResxHeaders(std::set<std::string>& srcs) const
+cmGeneratorTarget::GetExpectedResxHeaders(std::set<std::string>& srcs,
+ const std::string& config) const
{
ResxData data;
IMPLEMENT_VISIT_IMPL(Resx, COMMA cmGeneratorTarget::ResxData)
@@ -407,7 +425,8 @@ cmGeneratorTarget::GetExpectedResxHeaders(std::set<std::string>& srcs) const
//----------------------------------------------------------------------------
void cmGeneratorTarget
-::GetResxSources(std::vector<cmSourceFile const*>& srcs) const
+::GetResxSources(std::vector<cmSourceFile const*>& srcs,
+ const std::string& config) const
{
ResxData data;
IMPLEMENT_VISIT_IMPL(Resx, COMMA cmGeneratorTarget::ResxData)
@@ -517,13 +536,15 @@ bool cmGeneratorTarget::GetPropertyAsBool(const std::string& prop) const
}
//----------------------------------------------------------------------------
-void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*> &files) const
+void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*> &files,
+ const std::string& config) const
{
- this->Target->GetSourceFiles(files);
+ this->Target->GetSourceFiles(files, config);
}
//----------------------------------------------------------------------------
-std::string cmGeneratorTarget::GetModuleDefinitionFile() const
+std::string
+cmGeneratorTarget::GetModuleDefinitionFile(const std::string& config) const
{
std::string data;
IMPLEMENT_VISIT_IMPL(ModuleDefinitionFile, COMMA std::string)
@@ -532,10 +553,11 @@ std::string cmGeneratorTarget::GetModuleDefinitionFile() const
//----------------------------------------------------------------------------
void
-cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs) const
+cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs,
+ const std::string &config) const
{
std::vector<cmSourceFile const*> objectFiles;
- this->GetExternalObjects(objectFiles);
+ this->GetExternalObjects(objectFiles, config);
std::vector<cmTarget*> objectLibraries;
std::set<cmTarget*> emitted;
for(std::vector<cmSourceFile const*>::const_iterator
@@ -559,7 +581,7 @@ cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs) const
cmGeneratorTarget* ogt =
this->GlobalGenerator->GetGeneratorTarget(objLib);
std::vector<cmSourceFile const*> objectSources;
- ogt->GetObjectSources(objectSources);
+ ogt->GetObjectSources(objectSources, config);
for(std::vector<cmSourceFile const*>::const_iterator
si = objectSources.begin();
si != objectSources.end(); ++si)
@@ -615,11 +637,26 @@ cmTargetTraceDependencies
if (this->Target->GetType() != cmTarget::INTERFACE_LIBRARY)
{
std::vector<std::string> sources;
- this->Target->GetSourceFiles(sources);
+ std::vector<std::string> configs;
+ this->Makefile->GetConfigurations(configs);
+ if (configs.empty())
+ {
+ configs.push_back("");
+ }
+ for(std::vector<std::string>::const_iterator ci = configs.begin();
+ ci != configs.end(); ++ci)
+ {
+ this->Target->GetSourceFiles(sources, *ci);
+ }
+ std::set<std::string> emitted;
for(std::vector<std::string>::const_iterator si = sources.begin();
si != sources.end(); ++si)
{
- this->QueueSource(*si);
+ if(emitted.insert(*si).second && this->SourcesQueued.insert(*si).second)
+ {
+ this->SourceQueue.push(*si);
+ this->Makefile->GetOrCreateSource(*si);
+ }
}
}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 38e6510..9d13e6c 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -30,21 +30,30 @@ public:
std::string GetName() const;
const char *GetProperty(const std::string& prop) const;
bool GetPropertyAsBool(const std::string& prop) const;
- void GetSourceFiles(std::vector<cmSourceFile*>& files) const;
+ void GetSourceFiles(std::vector<cmSourceFile*>& files,
+ const std::string& config) const;
- void GetObjectSources(std::vector<cmSourceFile const*> &) const;
+ void GetObjectSources(std::vector<cmSourceFile const*> &,
+ const std::string& config) const;
const std::string& GetObjectName(cmSourceFile const* file);
bool HasExplicitObjectName(cmSourceFile const* file) const;
void AddExplicitObjectName(cmSourceFile const* sf);
- void GetResxSources(std::vector<cmSourceFile const*>&) const;
- void GetIDLSources(std::vector<cmSourceFile const*>&) const;
- void GetExternalObjects(std::vector<cmSourceFile const*>&) const;
- void GetHeaderSources(std::vector<cmSourceFile const*>&) const;
- void GetExtraSources(std::vector<cmSourceFile const*>&) const;
- void GetCustomCommands(std::vector<cmSourceFile const*>&) const;
- void GetExpectedResxHeaders(std::set<std::string>&) const;
+ void GetResxSources(std::vector<cmSourceFile const*>&,
+ const std::string& config) const;
+ void GetIDLSources(std::vector<cmSourceFile const*>&,
+ const std::string& config) const;
+ void GetExternalObjects(std::vector<cmSourceFile const*>&,
+ const std::string& config) const;
+ void GetHeaderSources(std::vector<cmSourceFile const*>&,
+ const std::string& config) const;
+ void GetExtraSources(std::vector<cmSourceFile const*>&,
+ const std::string& config) const;
+ void GetCustomCommands(std::vector<cmSourceFile const*>&,
+ const std::string& config) const;
+ void GetExpectedResxHeaders(std::set<std::string>&,
+ const std::string& config) const;
void ComputeObjectMapping();
@@ -53,14 +62,15 @@ public:
cmLocalGenerator* LocalGenerator;
cmGlobalGenerator const* GlobalGenerator;
- std::string GetModuleDefinitionFile() const;
+ std::string GetModuleDefinitionFile(const std::string& config) const;
/** Full path with trailing slash to the top-level directory
holding object files for this target. Includes the build
time config name placeholder if needed for the generator. */
std::string ObjectDirectory;
- void UseObjectLibraries(std::vector<std::string>& objs) const;
+ void UseObjectLibraries(std::vector<std::string>& objs,
+ const std::string& config) const;
void GetAppleArchs(const std::string& config,
std::vector<std::string>& archVec) const;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index a12b68f..f09f7b3 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2902,10 +2902,25 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target)
// List the source files with any per-source labels.
fout << "# Source files and their labels\n";
std::vector<cmSourceFile*> sources;
- target->GetSourceFiles(sources);
+ std::vector<std::string> configs;
+ target->GetMakefile()->GetConfigurations(configs);
+ if (configs.empty())
+ {
+ configs.push_back("");
+ }
+ for(std::vector<std::string>::const_iterator ci = configs.begin();
+ ci != configs.end(); ++ci)
+ {
+ target->GetSourceFiles(sources, *ci);
+ }
+ std::set<cmSourceFile*> emitted;
for(std::vector<cmSourceFile*>::const_iterator si = sources.begin();
si != sources.end(); ++si)
{
+ if (!emitted.insert(*si).second)
+ {
+ continue;
+ }
cmSourceFile* sf = *si;
fout << sf->GetFullPath() << "\n";
if(const char* svalue = sf->GetProperty("LABELS"))
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index df3ce10..89d25c4 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -139,7 +139,8 @@ bool cmGlobalKdevelopGenerator
ti != targets.end(); ti++)
{
std::vector<cmSourceFile*> sources;
- ti->second.GetSourceFiles(sources);
+ ti->second.GetSourceFiles(sources, ti->second.GetMakefile()
+ ->GetSafeDefinition("CMAKE_BUILD_TYPE"));
for (std::vector<cmSourceFile*>::const_iterator si=sources.begin();
si!=sources.end(); si++)
{
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 3aa293e..8dae81b 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -1081,7 +1081,8 @@ bool cmGlobalUnixMakefileGenerator3
::NeedRequiresStep(cmTarget const& target)
{
std::set<std::string> languages;
- target.GetLanguages(languages);
+ target.GetLanguages(languages,
+ target.GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"));
for(std::set<std::string>::const_iterator l = languages.begin();
l != languages.end(); ++l)
{
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx