diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-06-19 17:10:21 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-06-19 17:10:21 (GMT) |
commit | c0d000d234525c709b8f6226d1c78c3cc0b632b3 (patch) | |
tree | fce16d3de49d612d0c545e2b385eed04b736a945 /Source/cmInstallExportGenerator.h | |
parent | 617602e9e9e0ff57a3ef35e62e17d4a764edf920 (diff) | |
download | CMake-c0d000d234525c709b8f6226d1c78c3cc0b632b3.zip CMake-c0d000d234525c709b8f6226d1c78c3cc0b632b3.tar.gz CMake-c0d000d234525c709b8f6226d1c78c3cc0b632b3.tar.bz2 |
ENH: add INSTALL(EXPORT ...) mode and INSTALL( TARGETS ... EXPORT <set> ) ,
tests still have to be added
Alex
Diffstat (limited to 'Source/cmInstallExportGenerator.h')
-rw-r--r-- | Source/cmInstallExportGenerator.h | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h new file mode 100644 index 0000000..9dc2eff --- /dev/null +++ b/Source/cmInstallExportGenerator.h @@ -0,0 +1,92 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmInstallExportGenerator_h +#define cmInstallExportGenerator_h + +#include "cmInstallGenerator.h" + +class cmTarget; + + +class cmInstallTargetGenerator; + +/* cmInstallExportTarget is used in cmGlobalGenerator to collect the +install generators for the exported targets. These are then used by the +cmInstallExportGenerator. +*/ +class cmTargetExport +{ +public: + cmTargetExport(cmTarget* tgt, + cmInstallTargetGenerator* archive, + cmInstallTargetGenerator* runtime, + cmInstallTargetGenerator* library + ) : Target(tgt), ArchiveGenerator(archive), + RuntimeGenerator(runtime), LibraryGenerator(library) {} + + cmTarget* Target; + cmInstallTargetGenerator* ArchiveGenerator; + cmInstallTargetGenerator* RuntimeGenerator; + cmInstallTargetGenerator* LibraryGenerator; +private: + cmTargetExport(); +}; + + +/** \class cmInstallExportGenerator + * \brief Generate rules for creating an export files. + */ +class cmInstallExportGenerator: public cmInstallGenerator +{ +public: + cmInstallExportGenerator(const char* dest, const char* file_permissions, + const std::vector<std::string>& configurations, + const char* filename, const char* prefix, + const char* tempOutputDir); + + bool SetExportSet(const char* name, + const std::vector<cmTargetExport*>* exportSet); +protected: + // internal class which collects all the properties which will be set + // in the export file for the target + class cmTargetWithProperties + { + public: + cmTargetWithProperties(cmTarget* target):Target(target) {} + cmTarget* Target; + std::map<std::string, std::string> Properties; + private: + cmTargetWithProperties(); + }; + + virtual void GenerateScript(std::ostream& os); + static bool AddInstallLocations(cmTargetWithProperties *twp, + cmInstallTargetGenerator* generator, + const char* prefix); + + std::string Name; + std::string FilePermissions; + const std::vector<std::string> Configurations; + std::string Filename; + std::string Prefix; + std::string TempOutputDir; + std::string ExportFilename; + + std::vector<cmTargetWithProperties*> Targets; +}; + +#endif |