summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2001-07-02 19:38:02 (GMT)
committerBrad King <brad.king@kitware.com>2001-07-02 19:38:02 (GMT)
commite693d47253157c9372aeb7c2edbecef8d1fb6225 (patch)
tree296e6789a8596e112f2139b13e71b53219309bd0 /Source/cmMakefile.cxx
parentae2723878e08a8aa016869e90711e260d981df38 (diff)
downloadCMake-e693d47253157c9372aeb7c2edbecef8d1fb6225.zip
CMake-e693d47253157c9372aeb7c2edbecef8d1fb6225.tar.gz
CMake-e693d47253157c9372aeb7c2edbecef8d1fb6225.tar.bz2
ENH: Added support for selection of static/shared build on a per-library basis.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ccc477e..773000c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -541,10 +541,11 @@ void cmMakefile::SetProjectName(const char* p)
m_ProjectName = p;
}
-void cmMakefile::AddLibrary(const char* lname, const std::vector<std::string> &srcs)
+void cmMakefile::AddLibrary(const char* lname, bool shared,
+ const std::vector<std::string> &srcs)
{
cmTarget target;
- target.SetType(cmTarget::LIBRARY);
+ target.SetType(shared? cmTarget::SHARED_LIBRARY : cmTarget::STATIC_LIBRARY);
target.SetInAll(true);
target.GetSourceLists() = srcs;
m_Targets.insert(cmTargets::value_type(lname,target));
@@ -554,6 +555,15 @@ void cmMakefile::AddLibrary(const char* lname, const std::vector<std::string> &s
AddCacheEntry(lname,
this->GetCurrentOutputDirectory(),
"Path to a library", cmCacheManager::INTERNAL);
+
+ // Add an entry into the cache
+ std::string ltname = lname;
+ ltname += "_LIBRARY_TYPE";
+ cmCacheManager::GetInstance()->
+ AddCacheEntry(ltname.c_str(),
+ shared? "SHARED":"STATIC",
+ "Whether a library is static or shared.",
+ cmCacheManager::INTERNAL);
}
void cmMakefile::AddExecutable(const char *exeName,