summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2014-05-15 17:12:40 (GMT)
committerBrad King <brad.king@kitware.com>2014-05-28 16:28:18 (GMT)
commit15a8af21e8bd8354dfff2063e01f695f85efdeb8 (patch)
treeb7d98cab3ba63f61074a4f63a250934f0294826a /Source/cmGlobalGenerator.cxx
parent032961c6ac81d82270a7b1986935111aa5e32a56 (diff)
downloadCMake-15a8af21e8bd8354dfff2063e01f695f85efdeb8.zip
CMake-15a8af21e8bd8354dfff2063e01f695f85efdeb8.tar.gz
CMake-15a8af21e8bd8354dfff2063e01f695f85efdeb8.tar.bz2
Add an "installed file" property scope
Teach set_property and get_property an "INSTALL" property type to be associated with install-tree file paths. Make the properties available to CPack for use during packaging. Add a "prop_inst" Sphinx domain object type for documentation of such properties.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx44
1 files changed, 44 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 2a30593..dba4f46 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -28,6 +28,7 @@
#include "cmGeneratorExpression.h"
#include "cmGeneratorExpressionEvaluationFile.h"
#include "cmExportBuildFileGenerator.h"
+#include "cmCPackPropertiesGenerator.h"
#include <cmsys/Directory.hxx>
#include <cmsys/FStream.hxx>
@@ -1269,6 +1270,13 @@ void cmGlobalGenerator::Generate()
}
this->SetCurrentLocalGenerator(0);
+ if(!this->GenerateCPackPropertiesFile())
+ {
+ this->GetCMakeInstance()->IssueMessage(
+ cmake::FATAL_ERROR, "Could not write CPack properties file.",
+ cmListFileBacktrace());
+ }
+
for (std::map<std::string, cmExportBuildFileGenerator*>::iterator
it = this->BuildExportSets.begin(); it != this->BuildExportSets.end();
++it)
@@ -3014,3 +3022,39 @@ std::string cmGlobalGenerator::ExpandCFGIntDir(const std::string& str,
{
return str;
}
+
+//----------------------------------------------------------------------------
+bool cmGlobalGenerator::GenerateCPackPropertiesFile()
+{
+ cmake::InstalledFilesMap const& installedFiles =
+ this->CMakeInstance->GetInstalledFiles();
+
+ cmMakefile* mf = this->LocalGenerators[0]->GetMakefile();
+
+ std::vector<std::string> configs;
+ std::string config = mf->GetConfigurations(configs, false);
+
+ std::string path = this->CMakeInstance->GetStartOutputDirectory();
+ path += "/CPackProperties.cmake";
+
+ if(!cmSystemTools::FileExists(path.c_str()) && installedFiles.empty())
+ {
+ return true;
+ }
+
+ cmGeneratedFileStream file(path.c_str());
+ file << "# CPack properties\n";
+
+ for(cmake::InstalledFilesMap::const_iterator i = installedFiles.begin();
+ i != installedFiles.end(); ++i)
+ {
+ cmInstalledFile const& installedFile = i->second;
+
+ cmCPackPropertiesGenerator cpackPropertiesGenerator(
+ mf, installedFile, configs);
+
+ cpackPropertiesGenerator.Generate(file, config, configs);
+ }
+
+ return true;
+}