summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-01-28 13:38:36 (GMT)
committerBrad King <brad.king@kitware.com>2008-01-28 13:38:36 (GMT)
commit5594ad488576a77d9c6b8c3c1999a04fb4e6867d (patch)
treef22726476b6eaaf3832e48c185fe3c112601db17 /Source/cmTarget.h
parenta7cb9d1120c0555f1da67dd585bd1b4fd16d389d (diff)
downloadCMake-5594ad488576a77d9c6b8c3c1999a04fb4e6867d.zip
CMake-5594ad488576a77d9c6b8c3c1999a04fb4e6867d.tar.gz
CMake-5594ad488576a77d9c6b8c3c1999a04fb4e6867d.tar.bz2
ENH: Updated exporting and importing of targets to support libraries and configurations.
- Created cmExportFileGenerator hierarchy to implement export file generation - Installed exports use per-config import files loaded by a central one. - Include soname of shared libraries in import information - Renamed PREFIX to NAMESPACE in INSTALL(EXPORT) and EXPORT() commands - Move addition of CMAKE_INSTALL_PREFIX to destinations to install generators - Import files compute the installation prefix relative to their location when loaded - Add mapping of importer configurations to importee configurations - Rename IMPORT targets to IMPORTED targets to distinguish from windows import libraries - Scope IMPORTED targets within directories to isolate them - Place all properties created by import files in the IMPORTED namespace - Document INSTALL(EXPORT) and EXPORT() commands. - Document IMPORTED signature of add_executable and add_library - Enable finding of imported targets in cmComputeLinkDepends
Diffstat (limited to 'Source/cmTarget.h')
-rw-r--r--Source/cmTarget.h45
1 files changed, 32 insertions, 13 deletions
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 50e8429..b983629 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -194,6 +194,11 @@ public:
bool IsImported() const {return this->IsImportedTarget;}
+ /** Get link libraries for the given configuration of an imported
+ target. */
+ std::vector<std::string> const*
+ GetImportedLinkLibraries(const char* config);
+
/** Get the directory in which this target will be built. If the
configuration name is given then the generator will add its
subdirectory for that configuration. Otherwise just the canonical
@@ -226,13 +231,16 @@ public:
/** Get the full name of the target according to the settings in its
makefile. */
std::string GetFullName(const char* config=0, bool implib = false);
- void GetFullName(std::string& prefix,
- std::string& base, std::string& suffix,
- const char* config=0, bool implib = false);
+ void GetFullNameComponents(std::string& prefix,
+ std::string& base, std::string& suffix,
+ const char* config=0, bool implib = false);
/** Get the name of the pdb file for the target. */
std::string GetPDBName(const char* config=0);
+ /** Get the soname of the target. Allowed only for a shared library. */
+ std::string GetSOName(const char* config);
+
/** Get the full path to the target according to the settings in its
makefile and the configuration type. */
std::string GetFullPath(const char* config=0, bool implib = false);
@@ -308,6 +316,10 @@ public:
// until we have per-target object file properties.
void GetLanguages(std::set<cmStdString>& languages) const;
+ /** Return whether this target is an executable with symbol exports
+ enabled. */
+ bool IsExecutableWithExports();
+
private:
/**
* A list of direct dependencies. Use in conjunction with DependencyMap.
@@ -393,20 +405,14 @@ private:
const char* ImportedGetLocation(const char* config);
const char* NormalGetLocation(const char* config);
- void NormalGetFullNameInternal(TargetType type, const char* config,
- bool implib,
- std::string& outPrefix,
- std::string& outBase,
- std::string& outSuffix);
- void ImportedGetFullNameInternal(TargetType type, const char* config,
- bool implib,
- std::string& outPrefix,
- std::string& outBase,
- std::string& outSuffix);
+ std::string GetFullNameImported(const char* config, bool implib);
const char* ImportedGetDirectory(const char* config, bool implib);
const char* NormalGetDirectory(const char* config, bool implib);
+ std::string ImportedGetFullPath(const char* config, bool implib);
+ std::string NormalGetFullPath(const char* config, bool implib);
+
private:
std::string Name;
std::vector<cmCustomCommand> PreBuildCommands;
@@ -436,6 +442,19 @@ private:
bool DLLPlatform;
bool IsImportedTarget;
+ // Cache import information from properties for each configuration.
+ struct ImportInfo
+ {
+ std::string Location;
+ std::string SOName;
+ std::string ImportLibrary;
+ std::vector<std::string> LinkLibraries;
+ };
+ typedef std::map<cmStdString, ImportInfo> ImportInfoMapType;
+ ImportInfoMapType ImportInfoMap;
+ ImportInfo const* GetImportInfo(const char* config);
+ void ComputeImportInfo(std::string const& desired_config, ImportInfo& info);
+
// The cmMakefile instance that owns this target. This should
// always be set.
cmMakefile* Makefile;