BUG: fix build directory problem
This commit is contained in:
parent
435a8a7033
commit
818b0e5bc1
|
@ -365,11 +365,11 @@ void CMakeSetupDialog::LoadFromRegistry()
|
|||
|
||||
void CMakeSetupDialog::OnBuildProjects()
|
||||
{
|
||||
// get all the info from the screen
|
||||
this->UpdateData();
|
||||
::SetCursor(LoadCursor(NULL, IDC_WAIT));
|
||||
// copy the GUI cache values into the cache manager
|
||||
this->FillCacheManagerFromCacheEditor();
|
||||
// get all the info from the screen
|
||||
this->UpdateData();
|
||||
CString makefileIn = m_WhereSource;
|
||||
makefileIn += "/CMakeLists.txt";
|
||||
m_Makefile.ReadListFile(makefileIn);
|
||||
|
@ -397,9 +397,18 @@ void CMakeSetupDialog::FillCacheEditorFromCacheManager()
|
|||
switch(value.m_Type )
|
||||
{
|
||||
case cmCacheManager::BOOL:
|
||||
if(cmCacheManager::GetInstance()->IsOn(value.m_Value.c_str()))
|
||||
{
|
||||
m_CacheEntriesList.AddProperty(key,
|
||||
value.m_Value.c_str(),
|
||||
"ON",
|
||||
PIT_CHECKBOX,"");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_CacheEntriesList.AddProperty(key,
|
||||
"OFF",
|
||||
PIT_CHECKBOX,"");
|
||||
}
|
||||
break;
|
||||
case cmCacheManager::PATH:
|
||||
m_CacheEntriesList.AddProperty(key, value.m_Value.c_str(),
|
||||
|
|
|
@ -24,13 +24,14 @@ bool cmBuildSharedLibrariesCommand::Invoke(std::vector<std::string>& args)
|
|||
= cmCacheManager::GetInstance()->GetCacheValue("BUILD_SHARED_LIBS");
|
||||
if(!cacheValue)
|
||||
{
|
||||
cmCacheManager::GetInstance()->AddCacheEntry("BUILD_SHARED_LIBS","0",
|
||||
cmCacheManager::BOOL);
|
||||
m_Makefile->AddDefinition("BUILD_SHARED_LIBS", "0");
|
||||
cmCacheManager::GetInstance()->AddCacheEntry("BUILD_SHARED_LIBS",false);
|
||||
m_Makefile->AddDefinition("BUILD_SHARED_LIBS", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Makefile->AddDefinition("BUILD_SHARED_LIBS", cacheValue);
|
||||
m_Makefile->AddDefinition("BUILD_SHARED_LIBS",
|
||||
cmCacheManager::
|
||||
GetInstance()->IsOn("BUILD_SHARED_LIBS"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -161,6 +161,19 @@ const char* cmCacheManager::GetCacheValue(const char* key)
|
|||
}
|
||||
|
||||
|
||||
bool cmCacheManager::IsOn(const char* key)
|
||||
{
|
||||
if(!m_Cache.count(key))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
std::string &v = m_Cache[key].m_Value;
|
||||
return (v == "ON" || v == "on" || v == "1" || v == "true" || v == "yev"
|
||||
|| v == "TRUE" || v == "True" || v == "y" || v == "Y");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void cmCacheManager::PrintCache(std::ostream& out)
|
||||
{
|
||||
out << "=================================================" << std::endl;
|
||||
|
@ -176,3 +189,15 @@ void cmCacheManager::PrintCache(std::ostream& out)
|
|||
}
|
||||
|
||||
|
||||
void cmCacheManager::AddCacheEntry(const char* key, bool v)
|
||||
{
|
||||
if(v)
|
||||
{
|
||||
this->AddCacheEntry(key, "ON", cmCacheManager::BOOL);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->AddCacheEntry(key, "OFF", cmCacheManager::BOOL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ public:
|
|||
//! Singleton pattern get instance of the cmCacheManager.
|
||||
static cmCacheManager* GetInstance();
|
||||
|
||||
|
||||
//! Load a cache for given makefile. Loads from ouput home.
|
||||
bool LoadCache(cmMakefile*);
|
||||
|
||||
|
@ -57,11 +58,17 @@ public:
|
|||
//! Add an entry into the cache
|
||||
void AddCacheEntry(const char* key, const char* value, CacheEntryType type);
|
||||
|
||||
//! Add a BOOL entry into the cache
|
||||
void AddCacheEntry(const char* key, bool);
|
||||
|
||||
//! Remove an entry from the cache
|
||||
void RemoveCacheEntry(const char* key);
|
||||
|
||||
//! Get a value from the cache given a key
|
||||
const char* GetCacheValue(const char* key);
|
||||
//! Test a boolean cache entry to see if it is true or false, returns false
|
||||
// if no entry.
|
||||
bool IsOn(const char*);
|
||||
|
||||
//! Print the cache to a stream
|
||||
void PrintCache(std::ostream&);
|
||||
|
|
|
@ -361,6 +361,17 @@ void cmMakefile::AddDefinition(const char* name, const char* value)
|
|||
{
|
||||
m_Definitions.insert(DefinitionMap::value_type(name, value));
|
||||
}
|
||||
void cmMakefile::AddDefinition(const char* name, bool value)
|
||||
{
|
||||
if(value)
|
||||
{
|
||||
m_Definitions.insert(DefinitionMap::value_type(name, "ON"));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Definitions.insert(DefinitionMap::value_type(name, "OFF"));
|
||||
}
|
||||
}
|
||||
|
||||
void cmMakefile::SetProjectName(const char* p)
|
||||
{
|
||||
|
|
|
@ -144,6 +144,11 @@ public:
|
|||
*/
|
||||
void AddDefinition(const char* name, const char* value);
|
||||
|
||||
/**
|
||||
* Add bool variable definition to the build.
|
||||
*/
|
||||
void AddDefinition(const char* name, bool);
|
||||
|
||||
/**
|
||||
* Specify the name of the project for this build.
|
||||
*/
|
||||
|
|
|
@ -30,8 +30,7 @@ bool cmOptionCommand::Invoke(std::vector<std::string>& args)
|
|||
= cmCacheManager::GetInstance()->GetCacheValue(args[0].c_str());
|
||||
if(!cacheValue)
|
||||
{
|
||||
cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(),"0",
|
||||
cmCacheManager::BOOL);
|
||||
cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(),false);
|
||||
m_Makefile->AddDefinition(args[0].c_str(), "0");
|
||||
}
|
||||
else
|
||||
|
|
|
@ -26,9 +26,7 @@ bool cmWrapTclCommand::Invoke(std::vector<std::string>& args)
|
|||
|
||||
// Now check and see if the value has been stored in the cache
|
||||
// already, if so use that value and don't look for the program
|
||||
const char* cacheValue
|
||||
= cmCacheManager::GetInstance()->GetCacheValue("WRAP_TCL");
|
||||
if(!cacheValue || !strcmp(cacheValue,"0"))
|
||||
if(!cmCacheManager::GetInstance()->IsOn("WRAP_TCL"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue