diff options
author | Brad King <brad.king@kitware.com> | 2005-04-22 20:11:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2005-04-22 20:11:00 (GMT) |
commit | b1c528978705e7daab02660e19742bc4863fd8e9 (patch) | |
tree | 98a6bac0af6a3002c841cfda21f5337a76634a5f /Source/cmTarget.h | |
parent | 1b71f4477beeb41e3924993b5d4b78eadc092ec8 (diff) | |
download | CMake-b1c528978705e7daab02660e19742bc4863fd8e9.zip CMake-b1c528978705e7daab02660e19742bc4863fd8e9.tar.gz CMake-b1c528978705e7daab02660e19742bc4863fd8e9.tar.bz2 |
ENH: Created cmTarget::GetLibraryNames to replace cmLocalUnixMakefileGenerator2::GetLibraryNames. Added cmTarget::GetLibraryCleanNames to be used by cmLocalUnixMakefileGenerator2. Now when a library is linked both the shared and static versions are removed from the build tree. In this way we avoid having both kinds of libraries present when the user switches BUILD_SHARED_LIBS on/off. This prevents problems with turning off shared libraries and then expecting the linker to use the static libraries only to find it is using the out-of-date shared versions.
Diffstat (limited to 'Source/cmTarget.h')
-rw-r--r-- | Source/cmTarget.h | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/Source/cmTarget.h b/Source/cmTarget.h index e1ea2ee..12fc440 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -168,13 +168,30 @@ public: ///! Return the name of the variable to look up the target suffix const char* GetPrefixVariable() const; - // Get the full name of the target according to the settings in the - // given makefile. + /** Get the full name of the target according to the settings in the + given makefile. */ std::string GetFullName(cmMakefile* mf) const; - // Get the baes name (no suffix) of the target according to the - // settings in the given makefile. + /** Get the base name (no suffix) of the target according to the + settings in the given makefile. */ std::string GetBaseName(cmMakefile* mf) const; + + /** Get the names of the library needed to generate a build rule + that takes into account shared library version numbers. This + should be called only on a library target. */ + void GetLibraryNames(cmMakefile* mf, std::string& name, + std::string& soName, std::string& realName, + std::string& baseName) const; + + /** Get the names of the library used to remove existing copies of + the library from the build tree either before linking or during + a clean step. This should be called only on a library + target. */ + void GetLibraryCleanNames(cmMakefile* mf, + std::string& staticName, + std::string& sharedName, + std::string& sharedSOName, + std::string& sharedRealName) const; private: /** * A list of direct dependencies. Use in conjunction with DependencyMap. @@ -233,7 +250,11 @@ private: const char* GetPrefixVariableInternal(TargetType type) const; std::string GetFullNameInternal(cmMakefile* mf, TargetType type) const; std::string GetBaseNameInternal(cmMakefile* mf, TargetType type) const; - + void GetLibraryNamesInternal(cmMakefile* mf, + std::string& name, + std::string& soName, + std::string& realName, + TargetType type) const; private: std::string m_Name; std::vector<cmCustomCommand> m_PreBuildCommands; |