ENH: Removed cmMakefile arguments from cmTarget methods because cmTarget has the ivar m_Makefile now. Re-implemented cmLocalUnixMakefileGenerator3::AppendAnyDepend to use the new global knowledge and avoid the need to look at the cache for information about other targets. This should fix problems with custom commands and executables with the OUTPUT_NAME set. Also the <target>_LIBRARY_TYPE cache variable is no longer needed at all and has been removed.
This commit is contained in:
parent
af36d6e2e7
commit
163e3ff56c
|
@ -363,7 +363,7 @@ void cmLocalGenerator::GenerateInstallRules()
|
||||||
case cmTarget::STATIC_LIBRARY:
|
case cmTarget::STATIC_LIBRARY:
|
||||||
case cmTarget::MODULE_LIBRARY:
|
case cmTarget::MODULE_LIBRARY:
|
||||||
fname = libOutPath;
|
fname = libOutPath;
|
||||||
fname += l->second.GetFullName(m_Makefile);
|
fname += l->second.GetFullName();
|
||||||
files = fname.c_str();
|
files = fname.c_str();
|
||||||
this->AddInstallRule(fout, dest, type, files);
|
this->AddInstallRule(fout, dest, type, files);
|
||||||
break;
|
break;
|
||||||
|
@ -371,7 +371,7 @@ void cmLocalGenerator::GenerateInstallRules()
|
||||||
{
|
{
|
||||||
// Special code to handle DLL
|
// Special code to handle DLL
|
||||||
fname = libOutPath;
|
fname = libOutPath;
|
||||||
fname += l->second.GetFullName(m_Makefile);
|
fname += l->second.GetFullName();
|
||||||
std::string ext = cmSystemTools::GetFilenameExtension(fname);
|
std::string ext = cmSystemTools::GetFilenameExtension(fname);
|
||||||
ext = cmSystemTools::LowerCase(ext);
|
ext = cmSystemTools::LowerCase(ext);
|
||||||
if ( ext == ".dll" )
|
if ( ext == ".dll" )
|
||||||
|
@ -428,7 +428,7 @@ void cmLocalGenerator::GenerateInstallRules()
|
||||||
if(l->second.GetPropertyAsBool("MACOSX_BUNDLE"))
|
if(l->second.GetPropertyAsBool("MACOSX_BUNDLE"))
|
||||||
{
|
{
|
||||||
fname = exeOutPath;
|
fname = exeOutPath;
|
||||||
fname += l->second.GetFullName(m_Makefile);
|
fname += l->second.GetFullName();
|
||||||
std::string plist = fname;
|
std::string plist = fname;
|
||||||
plist += ".app/Contents/Info.plist";
|
plist += ".app/Contents/Info.plist";
|
||||||
fname += ".app/Contents/MacOS/";
|
fname += ".app/Contents/MacOS/";
|
||||||
|
@ -451,7 +451,7 @@ void cmLocalGenerator::GenerateInstallRules()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fname = exeOutPath;
|
fname = exeOutPath;
|
||||||
fname += l->second.GetFullName(m_Makefile);
|
fname += l->second.GetFullName();
|
||||||
files = fname.c_str();
|
files = fname.c_str();
|
||||||
this->AddInstallRule(fout, dest, type, files, false,
|
this->AddInstallRule(fout, dest, type, files, false,
|
||||||
properties.c_str());
|
properties.c_str());
|
||||||
|
@ -668,7 +668,7 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang, cmTarget& target)
|
||||||
std::string createRule = "CMAKE_";
|
std::string createRule = "CMAKE_";
|
||||||
createRule += llang;
|
createRule += llang;
|
||||||
createRule += target.GetCreateRuleVariable();
|
createRule += target.GetCreateRuleVariable();
|
||||||
std::string targetName = target.GetFullName(m_Makefile);
|
std::string targetName = target.GetFullName();
|
||||||
// Executable :
|
// Executable :
|
||||||
// Shared Library:
|
// Shared Library:
|
||||||
// Static Library:
|
// Static Library:
|
||||||
|
|
|
@ -1301,7 +1301,7 @@ cmLocalUnixMakefileGenerator3
|
||||||
// Get the name of the executable to generate.
|
// Get the name of the executable to generate.
|
||||||
std::string targetName;
|
std::string targetName;
|
||||||
std::string targetNameReal;
|
std::string targetNameReal;
|
||||||
target.GetExecutableNames(m_Makefile, targetName, targetNameReal);
|
target.GetExecutableNames(targetName, targetNameReal);
|
||||||
|
|
||||||
// Construct the full path version of the names.
|
// Construct the full path version of the names.
|
||||||
std::string outpath = m_ExecutableOutputPath;
|
std::string outpath = m_ExecutableOutputPath;
|
||||||
|
@ -1382,8 +1382,7 @@ cmLocalUnixMakefileGenerator3
|
||||||
{
|
{
|
||||||
std::string cleanName;
|
std::string cleanName;
|
||||||
std::string cleanRealName;
|
std::string cleanRealName;
|
||||||
target.GetExecutableCleanNames(m_Makefile, cleanName,
|
target.GetExecutableCleanNames(cleanName, cleanRealName);
|
||||||
cleanRealName);
|
|
||||||
std::string cleanFullName = outpath + cleanName;
|
std::string cleanFullName = outpath + cleanName;
|
||||||
std::string cleanFullRealName = outpath + cleanRealName;
|
std::string cleanFullRealName = outpath + cleanRealName;
|
||||||
exeCleanFiles.push_back
|
exeCleanFiles.push_back
|
||||||
|
@ -1646,8 +1645,7 @@ cmLocalUnixMakefileGenerator3
|
||||||
std::string targetNameSO;
|
std::string targetNameSO;
|
||||||
std::string targetNameReal;
|
std::string targetNameReal;
|
||||||
std::string targetNameBase;
|
std::string targetNameBase;
|
||||||
target.GetLibraryNames(m_Makefile,
|
target.GetLibraryNames(targetName, targetNameSO,
|
||||||
targetName, targetNameSO,
|
|
||||||
targetNameReal, targetNameBase);
|
targetNameReal, targetNameBase);
|
||||||
|
|
||||||
// Construct the full path version of the names.
|
// Construct the full path version of the names.
|
||||||
|
@ -1698,8 +1696,7 @@ cmLocalUnixMakefileGenerator3
|
||||||
std::string cleanSharedName;
|
std::string cleanSharedName;
|
||||||
std::string cleanSharedSOName;
|
std::string cleanSharedSOName;
|
||||||
std::string cleanSharedRealName;
|
std::string cleanSharedRealName;
|
||||||
target.GetLibraryCleanNames(m_Makefile,
|
target.GetLibraryCleanNames(cleanStaticName,
|
||||||
cleanStaticName,
|
|
||||||
cleanSharedName,
|
cleanSharedName,
|
||||||
cleanSharedSOName,
|
cleanSharedSOName,
|
||||||
cleanSharedRealName);
|
cleanSharedRealName);
|
||||||
|
@ -2178,85 +2175,52 @@ cmLocalUnixMakefileGenerator3
|
||||||
bool assume_unknown_is_file)
|
bool assume_unknown_is_file)
|
||||||
{
|
{
|
||||||
// There are a few cases for the name of the target:
|
// There are a few cases for the name of the target:
|
||||||
// - CMake target in this directory: depend on it.
|
// - CMake target.
|
||||||
// - CMake target in another directory: depend and add jump-and-build.
|
|
||||||
// - Full path to a file: depend on it.
|
// - Full path to a file: depend on it.
|
||||||
// - Other format (like -lm): do nothing.
|
// - Other format (like -lm): do nothing unless assume_unknown_is_file is true.
|
||||||
|
|
||||||
// If it is an executable or library target there will be a
|
// Look for a CMake target in the current makefile.
|
||||||
// definition for it.
|
cmTarget* target = m_Makefile->FindTarget(name);
|
||||||
std::string dirVar = name;
|
|
||||||
dirVar += "_CMAKE_PATH";
|
// If no target was found in the current makefile search globally.
|
||||||
const char* dir = m_Makefile->GetDefinition(dirVar.c_str());
|
bool local = target;
|
||||||
if(dir && *dir)
|
if(!local)
|
||||||
{
|
{
|
||||||
// This is a CMake target somewhere in this project.
|
target = m_GlobalGenerator->FindTarget(0, name);
|
||||||
// Get the type of the library. If it does not have a type then
|
|
||||||
// it is an executable.
|
|
||||||
std::string typeVar = name;
|
|
||||||
typeVar += "_LIBRARY_TYPE";
|
|
||||||
const char* libType = m_Makefile->GetDefinition(typeVar.c_str());
|
|
||||||
|
|
||||||
// Get the output path for this target type.
|
|
||||||
std::string tgtOutputPath;
|
|
||||||
if(libType)
|
|
||||||
{
|
|
||||||
tgtOutputPath = m_LibraryOutputPath;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tgtOutputPath = m_ExecutableOutputPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the path to the target.
|
|
||||||
std::string tgtPath;
|
|
||||||
if(tgtOutputPath.size())
|
|
||||||
{
|
|
||||||
tgtPath = tgtOutputPath;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tgtPath = dir;
|
|
||||||
tgtPath += "/";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the name of the targets's file. This depends on the type
|
|
||||||
// of the target.
|
|
||||||
std::string prefix;
|
|
||||||
std::string suffix;
|
|
||||||
if(!libType)
|
|
||||||
{
|
|
||||||
suffix = cmSystemTools::GetExecutableExtension();
|
|
||||||
}
|
|
||||||
else if(strcmp(libType, "SHARED") == 0)
|
|
||||||
{
|
|
||||||
prefix = m_Makefile->GetSafeDefinition("CMAKE_SHARED_LIBRARY_PREFIX");
|
|
||||||
suffix = m_Makefile->GetSafeDefinition("CMAKE_SHARED_LIBRARY_SUFFIX");
|
|
||||||
}
|
|
||||||
else if(strcmp(libType, "MODULE") == 0)
|
|
||||||
{
|
|
||||||
prefix = m_Makefile->GetSafeDefinition("CMAKE_SHARED_MODULE_PREFIX");
|
|
||||||
suffix = m_Makefile->GetSafeDefinition("CMAKE_SHARED_MODULE_SUFFIX");
|
|
||||||
}
|
|
||||||
else if(strcmp(libType, "STATIC") == 0)
|
|
||||||
{
|
|
||||||
prefix = m_Makefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_PREFIX");
|
|
||||||
suffix = m_Makefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_SUFFIX");
|
|
||||||
}
|
|
||||||
tgtPath += prefix;
|
|
||||||
tgtPath += name;
|
|
||||||
tgtPath += suffix;
|
|
||||||
|
|
||||||
// Add a dependency on the target.
|
|
||||||
depends.push_back(tgtPath.c_str());
|
|
||||||
}
|
}
|
||||||
else if(m_Makefile->GetTargets().find(name) !=
|
|
||||||
m_Makefile->GetTargets().end())
|
// If a target was found then depend on it.
|
||||||
|
if(target)
|
||||||
{
|
{
|
||||||
// This is a CMake target that is not an executable or library.
|
switch (target->GetType())
|
||||||
// It must be in this directory, so just depend on the name
|
{
|
||||||
// directly.
|
case cmTarget::EXECUTABLE:
|
||||||
depends.push_back(name);
|
case cmTarget::STATIC_LIBRARY:
|
||||||
|
case cmTarget::SHARED_LIBRARY:
|
||||||
|
case cmTarget::MODULE_LIBRARY:
|
||||||
|
{
|
||||||
|
// Get the location of the target's output file and depend on it.
|
||||||
|
if(const char* location = target->GetProperty("LOCATION"))
|
||||||
|
{
|
||||||
|
depends.push_back(location);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case cmTarget::UTILITY:
|
||||||
|
{
|
||||||
|
if(local)
|
||||||
|
{
|
||||||
|
// This is a utility target in the current makefile. Just
|
||||||
|
// depend on it directly.
|
||||||
|
depends.push_back(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case cmTarget::INSTALL_FILES:
|
||||||
|
case cmTarget::INSTALL_PROGRAMS:
|
||||||
|
// Do not depend on install targets.
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(cmSystemTools::FileIsFullPath(name))
|
else if(cmSystemTools::FileIsFullPath(name))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1096,38 +1096,6 @@ void cmMakefile::AddLibrary(const char* lname, int shared,
|
||||||
AddCacheEntry(libPath.c_str(),
|
AddCacheEntry(libPath.c_str(),
|
||||||
this->GetCurrentOutputDirectory(),
|
this->GetCurrentOutputDirectory(),
|
||||||
"Path to a library", cmCacheManager::INTERNAL);
|
"Path to a library", cmCacheManager::INTERNAL);
|
||||||
|
|
||||||
// Add an entry into the cache
|
|
||||||
std::string ltname = lname;
|
|
||||||
ltname += "_LIBRARY_TYPE";
|
|
||||||
switch (shared)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
this->GetCacheManager()->AddCacheEntry(ltname.c_str(),"STATIC",
|
|
||||||
"Whether a library is static, shared or module.",
|
|
||||||
cmCacheManager::INTERNAL);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
this->GetCacheManager()->
|
|
||||||
AddCacheEntry(ltname.c_str(),
|
|
||||||
"SHARED",
|
|
||||||
"Whether a library is static, shared or module.",
|
|
||||||
cmCacheManager::INTERNAL);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
this->GetCacheManager()->
|
|
||||||
AddCacheEntry(ltname.c_str(),
|
|
||||||
"MODULE",
|
|
||||||
"Whether a library is static, shared or module.",
|
|
||||||
cmCacheManager::INTERNAL);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
this->GetCacheManager()->
|
|
||||||
AddCacheEntry(ltname.c_str(),
|
|
||||||
"STATIC",
|
|
||||||
"Whether a library is static, shared or module.",
|
|
||||||
cmCacheManager::INTERNAL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cmTarget* cmMakefile::AddExecutable(const char *exeName,
|
cmTarget* cmMakefile::AddExecutable(const char *exeName,
|
||||||
|
|
|
@ -733,7 +733,7 @@ void cmTarget::UpdateLocation()
|
||||||
target_location += cfgid;
|
target_location += cfgid;
|
||||||
target_location += "/";
|
target_location += "/";
|
||||||
}
|
}
|
||||||
target_location += this->GetFullName(m_Makefile);
|
target_location += this->GetFullName();
|
||||||
this->SetProperty("LOCATION",target_location.c_str());
|
this->SetProperty("LOCATION",target_location.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -927,13 +927,12 @@ const char* cmTarget::GetPrefixVariableInternal(TargetType type)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmTarget::GetFullName(cmMakefile* mf)
|
std::string cmTarget::GetFullName()
|
||||||
{
|
{
|
||||||
return this->GetFullNameInternal(mf, this->GetType());
|
return this->GetFullNameInternal(this->GetType());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmTarget::GetFullNameInternal(cmMakefile* mf,
|
std::string cmTarget::GetFullNameInternal(TargetType type)
|
||||||
TargetType type)
|
|
||||||
{
|
{
|
||||||
const char* targetPrefix = this->GetProperty("PREFIX");
|
const char* targetPrefix = this->GetProperty("PREFIX");
|
||||||
const char* targetSuffix = this->GetProperty("SUFFIX");
|
const char* targetSuffix = this->GetProperty("SUFFIX");
|
||||||
|
@ -945,31 +944,31 @@ std::string cmTarget::GetFullNameInternal(cmMakefile* mf,
|
||||||
const char* suffixVar = this->GetSuffixVariableInternal(type);
|
const char* suffixVar = this->GetSuffixVariableInternal(type);
|
||||||
const char* ll =
|
const char* ll =
|
||||||
this->GetLinkerLanguage(
|
this->GetLinkerLanguage(
|
||||||
mf->GetLocalGenerator()->GetGlobalGenerator());
|
m_Makefile->GetLocalGenerator()->GetGlobalGenerator());
|
||||||
// first try language specific suffix
|
// first try language specific suffix
|
||||||
if(ll)
|
if(ll)
|
||||||
{
|
{
|
||||||
if(!targetSuffix && suffixVar && *suffixVar)
|
if(!targetSuffix && suffixVar && *suffixVar)
|
||||||
{
|
{
|
||||||
std::string langSuff = suffixVar + std::string("_") + ll;
|
std::string langSuff = suffixVar + std::string("_") + ll;
|
||||||
targetSuffix = mf->GetDefinition(langSuff.c_str());
|
targetSuffix = m_Makefile->GetDefinition(langSuff.c_str());
|
||||||
}
|
}
|
||||||
if(!targetPrefix && prefixVar && *prefixVar)
|
if(!targetPrefix && prefixVar && *prefixVar)
|
||||||
{
|
{
|
||||||
std::string langPrefix = prefixVar + std::string("_") + ll;
|
std::string langPrefix = prefixVar + std::string("_") + ll;
|
||||||
targetPrefix = mf->GetDefinition(langPrefix.c_str());
|
targetPrefix = m_Makefile->GetDefinition(langPrefix.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if there is no prefix on the target use the cmake definition
|
// if there is no prefix on the target use the cmake definition
|
||||||
if(!targetPrefix && prefixVar)
|
if(!targetPrefix && prefixVar)
|
||||||
{
|
{
|
||||||
targetPrefix = mf->GetSafeDefinition(prefixVar);
|
targetPrefix = m_Makefile->GetSafeDefinition(prefixVar);
|
||||||
}
|
}
|
||||||
// if there is no suffix on the target use the cmake definition
|
// if there is no suffix on the target use the cmake definition
|
||||||
if(!targetSuffix && suffixVar)
|
if(!targetSuffix && suffixVar)
|
||||||
{
|
{
|
||||||
targetSuffix = mf->GetSafeDefinition(suffixVar);
|
targetSuffix = m_Makefile->GetSafeDefinition(suffixVar);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Begin the final name with the prefix.
|
// Begin the final name with the prefix.
|
||||||
|
@ -994,13 +993,13 @@ std::string cmTarget::GetFullNameInternal(cmMakefile* mf,
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmTarget::GetBaseName(cmMakefile* mf)
|
std::string cmTarget::GetBaseName()
|
||||||
{
|
{
|
||||||
return this->GetBaseNameInternal(mf, this->GetType());
|
return this->GetBaseNameInternal(this->GetType());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
cmTarget::GetBaseNameInternal(cmMakefile* mf, TargetType type)
|
cmTarget::GetBaseNameInternal(TargetType type)
|
||||||
{
|
{
|
||||||
std::string pathPrefix = "";
|
std::string pathPrefix = "";
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
@ -1018,16 +1017,16 @@ cmTarget::GetBaseNameInternal(cmMakefile* mf, TargetType type)
|
||||||
// first check for a language specific suffix var
|
// first check for a language specific suffix var
|
||||||
const char* ll =
|
const char* ll =
|
||||||
this->GetLinkerLanguage(
|
this->GetLinkerLanguage(
|
||||||
mf->GetLocalGenerator()->GetGlobalGenerator());
|
m_Makefile->GetLocalGenerator()->GetGlobalGenerator());
|
||||||
if(ll)
|
if(ll)
|
||||||
{
|
{
|
||||||
std::string langPrefix = prefixVar + std::string("_") + ll;
|
std::string langPrefix = prefixVar + std::string("_") + ll;
|
||||||
targetPrefix = mf->GetDefinition(langPrefix.c_str());
|
targetPrefix = m_Makefile->GetDefinition(langPrefix.c_str());
|
||||||
}
|
}
|
||||||
// if there not a language specific suffix then use the general one
|
// if there not a language specific suffix then use the general one
|
||||||
if(!targetPrefix)
|
if(!targetPrefix)
|
||||||
{
|
{
|
||||||
targetPrefix = mf->GetSafeDefinition(prefixVar);
|
targetPrefix = m_Makefile->GetSafeDefinition(prefixVar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::string name = pathPrefix;
|
std::string name = pathPrefix;
|
||||||
|
@ -1036,21 +1035,19 @@ cmTarget::GetBaseNameInternal(cmMakefile* mf, TargetType type)
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmTarget::GetLibraryNames(cmMakefile* mf,
|
void cmTarget::GetLibraryNames(std::string& name,
|
||||||
std::string& name,
|
|
||||||
std::string& soName,
|
std::string& soName,
|
||||||
std::string& realName,
|
std::string& realName,
|
||||||
std::string& baseName)
|
std::string& baseName)
|
||||||
{
|
{
|
||||||
// Get the names based on the real type of the library.
|
// Get the names based on the real type of the library.
|
||||||
this->GetLibraryNamesInternal(mf, name, soName, realName, this->GetType());
|
this->GetLibraryNamesInternal(name, soName, realName, this->GetType());
|
||||||
|
|
||||||
// The library name without extension.
|
// The library name without extension.
|
||||||
baseName = this->GetBaseName(mf);
|
baseName = this->GetBaseName();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmTarget::GetLibraryCleanNames(cmMakefile* mf,
|
void cmTarget::GetLibraryCleanNames(std::string& staticName,
|
||||||
std::string& staticName,
|
|
||||||
std::string& sharedName,
|
std::string& sharedName,
|
||||||
std::string& sharedSOName,
|
std::string& sharedSOName,
|
||||||
std::string& sharedRealName)
|
std::string& sharedRealName)
|
||||||
|
@ -1058,7 +1055,7 @@ void cmTarget::GetLibraryCleanNames(cmMakefile* mf,
|
||||||
// Get the name as if this were a static library.
|
// Get the name as if this were a static library.
|
||||||
std::string soName;
|
std::string soName;
|
||||||
std::string realName;
|
std::string realName;
|
||||||
this->GetLibraryNamesInternal(mf, staticName, soName, realName,
|
this->GetLibraryNamesInternal(staticName, soName, realName,
|
||||||
cmTarget::STATIC_LIBRARY);
|
cmTarget::STATIC_LIBRARY);
|
||||||
|
|
||||||
// Get the names as if this were a shared library.
|
// Get the names as if this were a shared library.
|
||||||
|
@ -1069,19 +1066,18 @@ void cmTarget::GetLibraryCleanNames(cmMakefile* mf,
|
||||||
// shared library will never be present. In the latter case the
|
// shared library will never be present. In the latter case the
|
||||||
// type will never be MODULE. Either way the only names that
|
// type will never be MODULE. Either way the only names that
|
||||||
// might have to be cleaned are the shared library names.
|
// might have to be cleaned are the shared library names.
|
||||||
this->GetLibraryNamesInternal(mf, sharedName, sharedSOName,
|
this->GetLibraryNamesInternal(sharedName, sharedSOName,
|
||||||
sharedRealName, cmTarget::SHARED_LIBRARY);
|
sharedRealName, cmTarget::SHARED_LIBRARY);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Use the name of the real type of the library (shared or module).
|
// Use the name of the real type of the library (shared or module).
|
||||||
this->GetLibraryNamesInternal(mf, sharedName, sharedSOName,
|
this->GetLibraryNamesInternal(sharedName, sharedSOName,
|
||||||
sharedRealName, this->GetType());
|
sharedRealName, this->GetType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmTarget::GetLibraryNamesInternal(cmMakefile* mf,
|
void cmTarget::GetLibraryNamesInternal(std::string& name,
|
||||||
std::string& name,
|
|
||||||
std::string& soName,
|
std::string& soName,
|
||||||
std::string& realName,
|
std::string& realName,
|
||||||
TargetType type)
|
TargetType type)
|
||||||
|
@ -1089,7 +1085,7 @@ void cmTarget::GetLibraryNamesInternal(cmMakefile* mf,
|
||||||
// Construct the name of the soname flag variable for this language.
|
// Construct the name of the soname flag variable for this language.
|
||||||
const char* ll =
|
const char* ll =
|
||||||
this->GetLinkerLanguage(
|
this->GetLinkerLanguage(
|
||||||
mf->GetLocalGenerator()->GetGlobalGenerator());
|
m_Makefile->GetLocalGenerator()->GetGlobalGenerator());
|
||||||
std::string sonameFlag = "CMAKE_SHARED_LIBRARY_SONAME";
|
std::string sonameFlag = "CMAKE_SHARED_LIBRARY_SONAME";
|
||||||
if(ll)
|
if(ll)
|
||||||
{
|
{
|
||||||
|
@ -1102,7 +1098,7 @@ void cmTarget::GetLibraryNamesInternal(cmMakefile* mf,
|
||||||
const char* version = this->GetProperty("VERSION");
|
const char* version = this->GetProperty("VERSION");
|
||||||
const char* soversion = this->GetProperty("SOVERSION");
|
const char* soversion = this->GetProperty("SOVERSION");
|
||||||
if((type != cmTarget::SHARED_LIBRARY && type != cmTarget::MODULE_LIBRARY) ||
|
if((type != cmTarget::SHARED_LIBRARY && type != cmTarget::MODULE_LIBRARY) ||
|
||||||
!mf->GetDefinition(sonameFlag.c_str()))
|
!m_Makefile->GetDefinition(sonameFlag.c_str()))
|
||||||
{
|
{
|
||||||
// Versioning is supported only for shared libraries and modules,
|
// Versioning is supported only for shared libraries and modules,
|
||||||
// and then only when the platform supports an soname flag.
|
// and then only when the platform supports an soname flag.
|
||||||
|
@ -1117,7 +1113,7 @@ void cmTarget::GetLibraryNamesInternal(cmMakefile* mf,
|
||||||
}
|
}
|
||||||
|
|
||||||
// The library name.
|
// The library name.
|
||||||
name = this->GetFullNameInternal(mf, type);
|
name = this->GetFullNameInternal(type);
|
||||||
|
|
||||||
// The library's soname.
|
// The library's soname.
|
||||||
soName = name;
|
soName = name;
|
||||||
|
@ -1141,24 +1137,21 @@ void cmTarget::GetLibraryNamesInternal(cmMakefile* mf,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmTarget::GetExecutableNames(cmMakefile* mf,
|
void cmTarget::GetExecutableNames(std::string& name,
|
||||||
std::string& name,
|
|
||||||
std::string& realName)
|
std::string& realName)
|
||||||
{
|
{
|
||||||
// Get the names based on the real type of the executable.
|
// Get the names based on the real type of the executable.
|
||||||
this->GetExecutableNamesInternal(mf, name, realName, this->GetType());
|
this->GetExecutableNamesInternal(name, realName, this->GetType());
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmTarget::GetExecutableCleanNames(cmMakefile* mf,
|
void cmTarget::GetExecutableCleanNames(std::string& name,
|
||||||
std::string& name,
|
|
||||||
std::string& realName)
|
std::string& realName)
|
||||||
{
|
{
|
||||||
// Get the name and versioned name of this executable.
|
// Get the name and versioned name of this executable.
|
||||||
this->GetExecutableNamesInternal(mf, name, realName, cmTarget::EXECUTABLE);
|
this->GetExecutableNamesInternal(name, realName, cmTarget::EXECUTABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmTarget::GetExecutableNamesInternal(cmMakefile* mf,
|
void cmTarget::GetExecutableNamesInternal(std::string& name,
|
||||||
std::string& name,
|
|
||||||
std::string& realName,
|
std::string& realName,
|
||||||
TargetType type)
|
TargetType type)
|
||||||
{
|
{
|
||||||
|
@ -1176,7 +1169,7 @@ void cmTarget::GetExecutableNamesInternal(cmMakefile* mf,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// The executable name.
|
// The executable name.
|
||||||
name = this->GetFullNameInternal(mf, type);
|
name = this->GetFullNameInternal(type);
|
||||||
|
|
||||||
// The executable's real name on disk.
|
// The executable's real name on disk.
|
||||||
realName = name;
|
realName = name;
|
||||||
|
|
|
@ -163,18 +163,18 @@ public:
|
||||||
///! Return the name of the variable to look up the target suffix
|
///! Return the name of the variable to look up the target suffix
|
||||||
const char* GetPrefixVariable();
|
const char* GetPrefixVariable();
|
||||||
|
|
||||||
/** Get the full name of the target according to the settings in the
|
/** Get the full name of the target according to the settings in its
|
||||||
given makefile. */
|
makefile. */
|
||||||
std::string GetFullName(cmMakefile* mf);
|
std::string GetFullName();
|
||||||
|
|
||||||
/** Get the base name (no suffix) of the target according to the
|
/** Get the base name (no suffix) of the target according to the
|
||||||
settings in the given makefile. */
|
settings in its makefile. */
|
||||||
std::string GetBaseName(cmMakefile* mf);
|
std::string GetBaseName();
|
||||||
|
|
||||||
/** Get the names of the library needed to generate a build rule
|
/** Get the names of the library needed to generate a build rule
|
||||||
that takes into account shared library version numbers. This
|
that takes into account shared library version numbers. This
|
||||||
should be called only on a library target. */
|
should be called only on a library target. */
|
||||||
void GetLibraryNames(cmMakefile* mf, std::string& name,
|
void GetLibraryNames(std::string& name,
|
||||||
std::string& soName, std::string& realName,
|
std::string& soName, std::string& realName,
|
||||||
std::string& baseName);
|
std::string& baseName);
|
||||||
|
|
||||||
|
@ -182,8 +182,7 @@ public:
|
||||||
the library from the build tree either before linking or during
|
the library from the build tree either before linking or during
|
||||||
a clean step. This should be called only on a library
|
a clean step. This should be called only on a library
|
||||||
target. */
|
target. */
|
||||||
void GetLibraryCleanNames(cmMakefile* mf,
|
void GetLibraryCleanNames(std::string& staticName,
|
||||||
std::string& staticName,
|
|
||||||
std::string& sharedName,
|
std::string& sharedName,
|
||||||
std::string& sharedSOName,
|
std::string& sharedSOName,
|
||||||
std::string& sharedRealName);
|
std::string& sharedRealName);
|
||||||
|
@ -191,15 +190,13 @@ public:
|
||||||
/** Get the names of the executable needed to generate a build rule
|
/** Get the names of the executable needed to generate a build rule
|
||||||
that takes into account executable version numbers. This should
|
that takes into account executable version numbers. This should
|
||||||
be called only on an executable target. */
|
be called only on an executable target. */
|
||||||
void GetExecutableNames(cmMakefile* mf, std::string& name,
|
void GetExecutableNames(std::string& name, std::string& realName);
|
||||||
std::string& realName);
|
|
||||||
|
|
||||||
/** Get the names of the executable used to remove existing copies
|
/** Get the names of the executable used to remove existing copies
|
||||||
of the executable from the build tree either before linking or
|
of the executable from the build tree either before linking or
|
||||||
during a clean step. This should be called only on an
|
during a clean step. This should be called only on an
|
||||||
executable target. */
|
executable target. */
|
||||||
void GetExecutableCleanNames(cmMakefile* mf, std::string& name,
|
void GetExecutableCleanNames(std::string& name, std::string& realName);
|
||||||
std::string& realName);
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* A list of direct dependencies. Use in conjunction with DependencyMap.
|
* A list of direct dependencies. Use in conjunction with DependencyMap.
|
||||||
|
@ -256,15 +253,13 @@ private:
|
||||||
|
|
||||||
const char* GetSuffixVariableInternal(TargetType type);
|
const char* GetSuffixVariableInternal(TargetType type);
|
||||||
const char* GetPrefixVariableInternal(TargetType type);
|
const char* GetPrefixVariableInternal(TargetType type);
|
||||||
std::string GetFullNameInternal(cmMakefile* mf, TargetType type);
|
std::string GetFullNameInternal(TargetType type);
|
||||||
std::string GetBaseNameInternal(cmMakefile* mf, TargetType type);
|
std::string GetBaseNameInternal(TargetType type);
|
||||||
void GetLibraryNamesInternal(cmMakefile* mf,
|
void GetLibraryNamesInternal(std::string& name,
|
||||||
std::string& name,
|
|
||||||
std::string& soName,
|
std::string& soName,
|
||||||
std::string& realName,
|
std::string& realName,
|
||||||
TargetType type);
|
TargetType type);
|
||||||
void GetExecutableNamesInternal(cmMakefile* mf,
|
void GetExecutableNamesInternal(std::string& name,
|
||||||
std::string& name,
|
|
||||||
std::string& realName,
|
std::string& realName,
|
||||||
TargetType type);
|
TargetType type);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue