summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-02-06 19:20:36 (GMT)
committerBrad King <brad.king@kitware.com>2008-02-06 19:20:36 (GMT)
commit9e64d5b272e0279d4a6d5e595118f34bc3c1f6c9 (patch)
tree91922579fd8e7264d435c8492e775fe777db611f /Source/cmInstallCommand.cxx
parentafad12431371d9a725b9a85db39f8c4da37fabaf (diff)
downloadCMake-9e64d5b272e0279d4a6d5e595118f34bc3c1f6c9.zip
CMake-9e64d5b272e0279d4a6d5e595118f34bc3c1f6c9.tar.gz
CMake-9e64d5b272e0279d4a6d5e595118f34bc3c1f6c9.tar.bz2
ENH: Improve exporting/importing of targets
- Use real name instead of link for location of versioned targets - Error when a target is exported multiple times
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r--Source/cmInstallCommand.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 868fb75..8fc77d1 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -394,6 +394,9 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
cmInstallFilesGenerator* publicHeaderGenerator = 0;
cmInstallFilesGenerator* resourceGenerator = 0;
+ // Track whether this is a namelink-only rule.
+ bool namelinkOnly = false;
+
switch(target.GetType())
{
case cmTarget::SHARED_LIBRARY:
@@ -464,6 +467,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
libraryGenerator = CreateInstallTargetGenerator(target,
libraryArgs, false);
libraryGenerator->SetNamelinkMode(namelinkMode);
+ namelinkOnly =
+ (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly);
}
else
{
@@ -503,6 +508,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
libraryGenerator = CreateInstallTargetGenerator(target, libraryArgs,
false);
libraryGenerator->SetNamelinkMode(namelinkMode);
+ namelinkOnly =
+ (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly);
}
else
{
@@ -583,7 +590,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
createInstallGeneratorsForTargetFileSets = false;
}
- if(createInstallGeneratorsForTargetFileSets)
+ if(createInstallGeneratorsForTargetFileSets && !namelinkOnly)
{
const char* files = target.GetProperty("PRIVATE_HEADER");
if ((files) && (*files))
@@ -673,7 +680,9 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
this->Makefile->AddInstallGenerator(publicHeaderGenerator);
this->Makefile->AddInstallGenerator(resourceGenerator);
- if (!exports.GetString().empty())
+ // Add this install rule to an export if one was specified and
+ // this is not a namelink-only rule.
+ if(!exports.GetString().empty() && !namelinkOnly)
{
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()
->AddTargetToExports(exports.GetCString(), &target,