summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallExportGenerator.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-08-27 20:04:57 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-08-27 20:04:57 (GMT)
commit3e12a6cb917d0e6a8b10e239a2e5fa9cf3a8c358 (patch)
tree2f3cc243afbebf29b997aa9d9333fdc1ee8b1539 /Source/cmInstallExportGenerator.cxx
parent556b1257ac5e961a5fbc652f51acf157f157bed8 (diff)
downloadCMake-3e12a6cb917d0e6a8b10e239a2e5fa9cf3a8c358.zip
CMake-3e12a6cb917d0e6a8b10e239a2e5fa9cf3a8c358.tar.gz
CMake-3e12a6cb917d0e6a8b10e239a2e5fa9cf3a8c358.tar.bz2
ENH: add install files generators for targets which have PUBLIC_HEADER,
PRIVATE_HEADER or RESOURCE_FILES property, use the destination for the public headers as include directory property for exported libraries Alex
Diffstat (limited to 'Source/cmInstallExportGenerator.cxx')
-rw-r--r--Source/cmInstallExportGenerator.cxx35
1 files changed, 33 insertions, 2 deletions
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index a61a8c0..e0ff82c 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -22,6 +22,7 @@
#include "cmTarget.h"
#include "cmInstallExportGenerator.h"
+#include "cmInstallFilesGenerator.h"
cmInstallExportGenerator::cmInstallExportGenerator(
const char* destination,
@@ -60,7 +61,7 @@ bool cmInstallExportGenerator::AddInstallLocations(cmTargetWithProperties* twp,
std::string propertyName = prefix;
propertyName += "LOCATION";
// check that this property doesn't exist yet and add it then
- if (twp->Properties.find(propertyName.c_str())== twp->Properties.end())
+ if (twp->Properties.find(propertyName.c_str()) == twp->Properties.end())
{
std::string destinationFilename = generator->GetDestination();
destinationFilename += "/";
@@ -83,7 +84,7 @@ bool cmInstallExportGenerator::AddInstallLocations(cmTargetWithProperties* twp,
propertyName += prefix;
propertyName += "LOCATION";
// check that this property doesn't exist yet and add it then
- if (twp->Properties.find(propertyName.c_str())== twp->Properties.end())
+ if (twp->Properties.find(propertyName.c_str()) == twp->Properties.end())
{
std::string destinationFilename = generator->GetDestination();
destinationFilename += "/";
@@ -100,6 +101,31 @@ bool cmInstallExportGenerator::AddInstallLocations(cmTargetWithProperties* twp,
}
+bool cmInstallExportGenerator::AddInstallLocations(cmTargetWithProperties* twp,
+ cmInstallFilesGenerator* generator,
+ const char* propertyName)
+{
+ if (generator == 0) // nothing to do
+ {
+ return true;
+ }
+
+ if ((propertyName == 0) || (*propertyName == '\0'))
+ {
+ return false;
+ }
+
+ // check that this property doesn't exist yet and add it then
+ if (twp->Properties.find(propertyName) == twp->Properties.end())
+ {
+ twp->Properties[propertyName] = generator->GetDestination();
+ return true;
+ }
+
+ return false;
+}
+
+
bool cmInstallExportGenerator::SetExportSet(const char* name,
const std::vector<cmTargetExport*>* set)
{
@@ -152,6 +178,11 @@ bool cmInstallExportGenerator::SetExportSet(const char* name,
{
return false;
}
+ if (this->AddInstallLocations(targetWithProps, (*it)->HeaderGenerator,
+ "PUBLIC_HEADER_LOCATION") == false)
+ {
+ return false;
+ }
}
return true;