COMP: Even more global target fixes
This commit is contained in:
parent
4675765601
commit
c4156b4531
|
@ -1309,11 +1309,13 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
|
||||||
cmd = "$(CMAKE_COMMAND)";
|
cmd = "$(CMAKE_COMMAND)";
|
||||||
}
|
}
|
||||||
singleLine.push_back(cmd.c_str());
|
singleLine.push_back(cmd.c_str());
|
||||||
const char* cmakeCfgIntDir = mf->GetDefinition("CMAKE_CFG_INTDIR");
|
const char* cmakeCfgIntDir = this->GetCMakeCFGInitDirectory();
|
||||||
|
std::cout << "CMakeCFG: " << cmakeCfgIntDir << std::endl;
|
||||||
if ( cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[1] != '.' )
|
if ( cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[1] != '.' )
|
||||||
{
|
{
|
||||||
std::string cfgArg = "-DBUILD_TYPE=";
|
std::string cfgArg = "-DBUILD_TYPE=";
|
||||||
cfgArg += mf->GetDefinition("CMAKE_CFG_INTDIR");
|
cfgArg += mf->GetDefinition("CMAKE_CFG_INTDIR");
|
||||||
|
singleLine.push_back(cfgArg);
|
||||||
}
|
}
|
||||||
singleLine.push_back("-P");
|
singleLine.push_back("-P");
|
||||||
singleLine.push_back("cmake_install.cmake");
|
singleLine.push_back("cmake_install.cmake");
|
||||||
|
|
|
@ -131,6 +131,9 @@ public:
|
||||||
///! What is the output extension for a given source file extension.
|
///! What is the output extension for a given source file extension.
|
||||||
const char* GetLanguageOutputExtensionFromExtension(const char* lang);
|
const char* GetLanguageOutputExtensionFromExtension(const char* lang);
|
||||||
|
|
||||||
|
///! What is the configurations directory variable called?
|
||||||
|
virtual const char* GetCMakeCFGInitDirectory() { return "."; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert the given remote path to a relative path with respect to
|
* Convert the given remote path to a relative path with respect to
|
||||||
* the given local path. The local path must be given in component
|
* the given local path. The local path must be given in component
|
||||||
|
|
|
@ -31,7 +31,6 @@ cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3()
|
||||||
void cmGlobalUnixMakefileGenerator3
|
void cmGlobalUnixMakefileGenerator3
|
||||||
::EnableLanguage(std::vector<std::string>const& languages, cmMakefile *mf)
|
::EnableLanguage(std::vector<std::string>const& languages, cmMakefile *mf)
|
||||||
{
|
{
|
||||||
mf->AddDefinition("CMAKE_CFG_INTDIR",".");
|
|
||||||
this->cmGlobalGenerator::EnableLanguage(languages, mf);
|
this->cmGlobalGenerator::EnableLanguage(languages, mf);
|
||||||
std::string path;
|
std::string path;
|
||||||
for(std::vector<std::string>::const_iterator l = languages.begin();
|
for(std::vector<std::string>::const_iterator l = languages.begin();
|
||||||
|
|
|
@ -27,7 +27,6 @@ cmGlobalVisualStudio6Generator::cmGlobalVisualStudio6Generator()
|
||||||
void cmGlobalVisualStudio6Generator::EnableLanguage(std::vector<std::string>const& lang,
|
void cmGlobalVisualStudio6Generator::EnableLanguage(std::vector<std::string>const& lang,
|
||||||
cmMakefile *mf)
|
cmMakefile *mf)
|
||||||
{
|
{
|
||||||
mf->AddDefinition("CMAKE_CFG_INTDIR","$(IntDir)");
|
|
||||||
mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
|
mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
|
||||||
mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
|
mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
|
||||||
mf->AddDefinition("CMAKE_GENERATOR_RC", "rc");
|
mf->AddDefinition("CMAKE_GENERATOR_RC", "rc");
|
||||||
|
@ -246,7 +245,8 @@ void cmGlobalVisualStudio6Generator::WriteDSWFile(std::ostream& fout,
|
||||||
{
|
{
|
||||||
if (al->second.IsInAll())
|
if (al->second.IsInAll())
|
||||||
{
|
{
|
||||||
if (al->second.GetType() == cmTarget::UTILITY)
|
if (al->second.GetType() == cmTarget::UTILITY ||
|
||||||
|
al->second.GetType() == cmTarget::GLOBAL_TARGET)
|
||||||
{
|
{
|
||||||
l->second.AddUtility(al->first.c_str());
|
l->second.AddUtility(al->first.c_str());
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,8 @@ public:
|
||||||
/** Append the subdirectory for the given configuration. */
|
/** Append the subdirectory for the given configuration. */
|
||||||
virtual void AppendDirectoryForConfig(const char* config, std::string& dir);
|
virtual void AppendDirectoryForConfig(const char* config, std::string& dir);
|
||||||
|
|
||||||
|
///! What is the configurations directory variable called?
|
||||||
|
virtual const char* GetCMakeCFGInitDirectory() { return "$(IntDir)"; }
|
||||||
private:
|
private:
|
||||||
void GenerateConfigurations(cmMakefile* mf);
|
void GenerateConfigurations(cmMakefile* mf);
|
||||||
void WriteDSWFile(std::ostream& fout);
|
void WriteDSWFile(std::ostream& fout);
|
||||||
|
|
|
@ -107,7 +107,7 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout,
|
||||||
{
|
{
|
||||||
if (al->second.IsInAll())
|
if (al->second.IsInAll())
|
||||||
{
|
{
|
||||||
if (al->second.GetType() == cmTarget::UTILITY &&
|
if (al->second.GetType() == cmTarget::UTILITY ||
|
||||||
al->second.GetType() == cmTarget::GLOBAL_TARGET)
|
al->second.GetType() == cmTarget::GLOBAL_TARGET)
|
||||||
{
|
{
|
||||||
l->second.AddUtility(al->first.c_str());
|
l->second.AddUtility(al->first.c_str());
|
||||||
|
|
|
@ -31,7 +31,6 @@ cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator()
|
||||||
void cmGlobalVisualStudio7Generator::EnableLanguage(std::vector<std::string>const & lang,
|
void cmGlobalVisualStudio7Generator::EnableLanguage(std::vector<std::string>const & lang,
|
||||||
cmMakefile *mf)
|
cmMakefile *mf)
|
||||||
{
|
{
|
||||||
mf->AddDefinition("CMAKE_CFG_INTDIR","$(OutDir)");
|
|
||||||
mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
|
mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
|
||||||
mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
|
mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
|
||||||
mf->AddDefinition("CMAKE_GENERATOR_RC", "rc");
|
mf->AddDefinition("CMAKE_GENERATOR_RC", "rc");
|
||||||
|
@ -315,7 +314,7 @@ void cmGlobalVisualStudio7Generator::WriteSLNFile(std::ostream& fout,
|
||||||
{
|
{
|
||||||
if (al->second.IsInAll())
|
if (al->second.IsInAll())
|
||||||
{
|
{
|
||||||
if (al->second.GetType() == cmTarget::UTILITY &&
|
if (al->second.GetType() == cmTarget::UTILITY ||
|
||||||
al->second.GetType() == cmTarget::GLOBAL_TARGET)
|
al->second.GetType() == cmTarget::GLOBAL_TARGET)
|
||||||
{
|
{
|
||||||
l->second.AddUtility(al->first.c_str());
|
l->second.AddUtility(al->first.c_str());
|
||||||
|
|
|
@ -84,6 +84,9 @@ public:
|
||||||
/** Append the subdirectory for the given configuration. */
|
/** Append the subdirectory for the given configuration. */
|
||||||
virtual void AppendDirectoryForConfig(const char* config, std::string& dir);
|
virtual void AppendDirectoryForConfig(const char* config, std::string& dir);
|
||||||
|
|
||||||
|
///! What is the configurations directory variable called?
|
||||||
|
virtual const char* GetCMakeCFGInitDirectory() { return "$(OutDir)"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void OutputSLNFile(cmLocalGenerator* root,
|
virtual void OutputSLNFile(cmLocalGenerator* root,
|
||||||
std::vector<cmLocalGenerator*>& generators);
|
std::vector<cmLocalGenerator*>& generators);
|
||||||
|
@ -103,6 +106,7 @@ protected:
|
||||||
const char* name, const char* path,
|
const char* name, const char* path,
|
||||||
const std::vector<std::string>& dependencies);
|
const std::vector<std::string>& dependencies);
|
||||||
|
|
||||||
|
|
||||||
std::vector<std::string> m_Configurations;
|
std::vector<std::string> m_Configurations;
|
||||||
std::map<cmStdString, cmStdString> m_GUIDMap;
|
std::map<cmStdString, cmStdString> m_GUIDMap;
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,9 @@ public:
|
||||||
virtual void WriteXCodePBXProj(std::ostream& fout,
|
virtual void WriteXCodePBXProj(std::ostream& fout,
|
||||||
cmLocalGenerator* root,
|
cmLocalGenerator* root,
|
||||||
std::vector<cmLocalGenerator*>& generators);
|
std::vector<cmLocalGenerator*>& generators);
|
||||||
|
|
||||||
|
///! What is the configurations directory variable called?
|
||||||
|
virtual const char* GetCMakeCFGInitDirectory() { return "$(CONFIGURATION)"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -111,11 +111,9 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vector<std::string>const&
|
||||||
mf->AddDefinition("XCODE","1");
|
mf->AddDefinition("XCODE","1");
|
||||||
if(m_XcodeVersion == 15)
|
if(m_XcodeVersion == 15)
|
||||||
{
|
{
|
||||||
mf->AddDefinition("CMAKE_CFG_INTDIR",".");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mf->AddDefinition("CMAKE_CFG_INTDIR","$(CONFIGURATION)");
|
|
||||||
mf->AddCacheDefinition(
|
mf->AddCacheDefinition(
|
||||||
"CMAKE_CONFIGURATION_TYPES",
|
"CMAKE_CONFIGURATION_TYPES",
|
||||||
"Debug;Release;MinSizeRel;RelWithDebInfo",
|
"Debug;Release;MinSizeRel;RelWithDebInfo",
|
||||||
|
|
|
@ -72,6 +72,9 @@ public:
|
||||||
/** Append the subdirectory for the given configuration. */
|
/** Append the subdirectory for the given configuration. */
|
||||||
virtual void AppendDirectoryForConfig(const char* config, std::string& dir);
|
virtual void AppendDirectoryForConfig(const char* config, std::string& dir);
|
||||||
|
|
||||||
|
///! What is the configurations directory variable called?
|
||||||
|
virtual const char* GetCMakeCFGInitDirectory() { return "."; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cmXCodeObject* CreateOrGetPBXGroup(cmTarget& cmtarget,
|
cmXCodeObject* CreateOrGetPBXGroup(cmTarget& cmtarget,
|
||||||
cmSourceGroup* sg);
|
cmSourceGroup* sg);
|
||||||
|
@ -148,7 +151,6 @@ private:
|
||||||
const char* varNameSuffix,
|
const char* varNameSuffix,
|
||||||
const char* default_flags);
|
const char* default_flags);
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
int m_XcodeVersion;
|
int m_XcodeVersion;
|
||||||
std::vector<cmXCodeObject*> m_XCodeObjects;
|
std::vector<cmXCodeObject*> m_XCodeObjects;
|
||||||
cmXCodeObject* m_RootObject;
|
cmXCodeObject* m_RootObject;
|
||||||
|
|
|
@ -455,8 +455,8 @@ void cmLocalVisualStudio6Generator::WriteGroup(const cmSourceGroup *sg, cmTarget
|
||||||
{
|
{
|
||||||
cmSystemTools::ExpandListArgument(dependsValue, depends);
|
cmSystemTools::ExpandListArgument(dependsValue, depends);
|
||||||
}
|
}
|
||||||
if (source != libName || target.GetType() == cmTarget::UTILITY
|
if (source != libName || target.GetType() == cmTarget::UTILITY ||
|
||||||
|| target.GetType() == cmTarget::GLOBAL_TARGET)
|
target.GetType() == cmTarget::GLOBAL_TARGET)
|
||||||
{
|
{
|
||||||
fout << "# Begin Source File\n\n";
|
fout << "# Begin Source File\n\n";
|
||||||
|
|
||||||
|
@ -721,8 +721,7 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target,
|
||||||
{
|
{
|
||||||
std::string customRuleCode = "";
|
std::string customRuleCode = "";
|
||||||
|
|
||||||
if (target.GetType() >= cmTarget::UTILITY ||
|
if (target.GetType() >= cmTarget::UTILITY )
|
||||||
target.GetType() >= cmTarget::GLOBAL_TARGET)
|
|
||||||
{
|
{
|
||||||
return customRuleCode;
|
return customRuleCode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1220,8 +1220,7 @@ void cmLocalVisualStudio7Generator::OutputTargetRules(std::ostream& fout,
|
||||||
cmTarget &target,
|
cmTarget &target,
|
||||||
const char * /*libName*/)
|
const char * /*libName*/)
|
||||||
{
|
{
|
||||||
if (target.GetType() > cmTarget::UTILITY ||
|
if (target.GetType() > cmTarget::GLOBAL_TARGET)
|
||||||
target.GetType() > cmTarget::GLOBAL_TARGET)
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2040,6 +2040,8 @@ cmSourceFile* cmMakefile::AddSource(cmSourceFile const&sf)
|
||||||
|
|
||||||
void cmMakefile::EnableLanguage(std::vector<std::string> const & lang)
|
void cmMakefile::EnableLanguage(std::vector<std::string> const & lang)
|
||||||
{
|
{
|
||||||
|
this->AddDefinition("CMAKE_CFG_INTDIR",
|
||||||
|
m_LocalGenerator->GetGlobalGenerator()->GetCMakeCFGInitDirectory());
|
||||||
m_LocalGenerator->GetGlobalGenerator()->EnableLanguage(lang, this);
|
m_LocalGenerator->GetGlobalGenerator()->EnableLanguage(lang, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,8 @@ class cmTarget
|
||||||
public:
|
public:
|
||||||
cmTarget();
|
cmTarget();
|
||||||
enum TargetType { EXECUTABLE, STATIC_LIBRARY,
|
enum TargetType { EXECUTABLE, STATIC_LIBRARY,
|
||||||
SHARED_LIBRARY, MODULE_LIBRARY, UTILITY, INSTALL_FILES,
|
SHARED_LIBRARY, MODULE_LIBRARY, UTILITY, GLOBAL_TARGET,
|
||||||
INSTALL_PROGRAMS, GLOBAL_TARGET};
|
INSTALL_FILES, INSTALL_PROGRAMS};
|
||||||
|
|
||||||
enum CustomCommandType { PRE_BUILD, PRE_LINK, POST_BUILD };
|
enum CustomCommandType { PRE_BUILD, PRE_LINK, POST_BUILD };
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue