summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/MFCDialog/CMakeSetupDialog.cpp4
-rw-r--r--Source/cmCacheManager.cxx6
-rw-r--r--Source/cmMarkAsAdvancedCommand.cxx25
-rw-r--r--Source/cmMarkAsAdvancedCommand.h7
-rw-r--r--Templates/CMakeBorlandWindowsSystemConfig.cmake29
5 files changed, 60 insertions, 11 deletions
diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp
index b95d780..b21f229 100644
--- a/Source/MFCDialog/CMakeSetupDialog.cpp
+++ b/Source/MFCDialog/CMakeSetupDialog.cpp
@@ -633,9 +633,7 @@ void CMakeSetupDialog::FillCacheGUIFromCacheManager()
if(!m_AdvancedValues)
{
- std::string advancedVar = key;
- advancedVar += "-ADVANCED";
- if(cmCacheManager::GetInstance()->GetCacheEntry(advancedVar.c_str()))
+ if(cmCacheManager::GetInstance()->IsAdvanced(key))
{
continue;
}
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index a8ea49a..5392937 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -563,9 +563,11 @@ bool cmCacheManager::IsAdvanced(const char* key)
{
std::string advancedVar = key;
advancedVar += "-ADVANCED";
- if(cmCacheManager::GetInstance()->GetCacheEntry(advancedVar.c_str()))
+ const char* value =
+ cmCacheManager::GetInstance()->GetCacheValue(advancedVar.c_str());
+ if(value)
{
- return true;
+ return cmSystemTools::IsOn(value);
}
return false;
}
diff --git a/Source/cmMarkAsAdvancedCommand.cxx b/Source/cmMarkAsAdvancedCommand.cxx
index ed7d7a5..1187c16 100644
--- a/Source/cmMarkAsAdvancedCommand.cxx
+++ b/Source/cmMarkAsAdvancedCommand.cxx
@@ -48,15 +48,32 @@ bool cmMarkAsAdvancedCommand::InitialPass(std::vector<std::string> const& args)
this->SetError("called with incorrect number of arguments");
return false;
}
- for(unsigned int i =0; i < args.size(); ++i)
+ unsigned int i =0;
+ const char* value = "1";
+ bool overwrite = false;
+ if(args[0] == "CLEAR" || args[0] == "FORCE")
+ {
+ overwrite = true;
+ if(args[0] == "CLEAR")
+ {
+ value = "0";
+ }
+ i = 1;
+ }
+ for(; i < args.size(); ++i)
{
std::string variable = args[i];
variable += "-ADVANCED";
std::string doc = "Advanced flag for variable: ";
doc += args[i];
- m_Makefile->AddCacheDefinition(variable.c_str(), "1",
- doc.c_str(),
- cmCacheManager::INTERNAL);
+ // if not CLEAR or FORCE or it is not yet defined,
+ // then define variable-ADVANCED
+ if(overwrite || !m_Makefile->GetDefinition(variable.c_str()))
+ {
+ m_Makefile->AddCacheDefinition(variable.c_str(), value,
+ doc.c_str(),
+ cmCacheManager::INTERNAL);
+ }
}
return true;
}
diff --git a/Source/cmMarkAsAdvancedCommand.h b/Source/cmMarkAsAdvancedCommand.h
index f328667..c43d035 100644
--- a/Source/cmMarkAsAdvancedCommand.h
+++ b/Source/cmMarkAsAdvancedCommand.h
@@ -91,9 +91,12 @@ public:
virtual const char* GetFullDocumentation()
{
return
- "MARK_AS_ADVANCED(VAR VAR2 VAR... )\n"
+ "MARK_AS_ADVANCED([CLEAR|FORCE]VAR VAR2 VAR... )\n"
"Mark the named variables as advanced. An advanced variable will not be displayed in"
- " any of the cmake GUIs, unless the show advanced option is on.";
+ " any of the cmake GUIs, unless the show advanced option is on. "
+ "If CLEAR is the first argument advanced variables are changed back to unadvanced."
+ "If FORCE is the first arguement, then the variable is made advanced."
+ "If neither FORCE or CLEAR is specified, new values will be marked as advanced, but if the variable already has an advanced state, it will not be changed.";
}
cmTypeMacro(cmMarkAsAdvancedCommand, cmCommand);
diff --git a/Templates/CMakeBorlandWindowsSystemConfig.cmake b/Templates/CMakeBorlandWindowsSystemConfig.cmake
index 3910b59..26832ce 100644
--- a/Templates/CMakeBorlandWindowsSystemConfig.cmake
+++ b/Templates/CMakeBorlandWindowsSystemConfig.cmake
@@ -84,3 +84,32 @@ SET (CMAKE_MODULE_SUFFIX ".dll" CACHE STRING
"Module library suffix.")
FIND_PROGRAM(CMAKE_MAKE_PROGRAM make ${BCB_BIN_PATH})
+
+MARK_AS_ADVANCED(
+CMAKE_CXX_FLAGS_RELEASE
+CMAKE_CXX_FLAGS_RELWITHDEBINFO
+CMAKE_CXX_FLAGS_MINSIZEREL
+CMAKE_CXX_FLAGS_DEBUG
+CMAKE_LINKER_FLAGS
+CMAKE_LINKER_FLAGS_MINSIZEREL
+CMAKE_LINKER_FLAGS_RELEASE
+CMAKE_LINKER_FLAGS_RELWITHDEBINFO
+CMAKE_USE_WIN32_THREADS
+CMAKE_STANDARD_WINDOWS_LIBRARIES
+CMAKE_SHLIB_SUFFIX
+CMAKE_MODULE_SUFFIX
+CMAKE_OBJECT_FILE_SUFFIX
+CMAKE_EXECUTABLE_SUFFIX
+CMAKE_STATICLIB_SUFFIX
+CMAKE_SHLIB_SUFFIX
+CMAKE_MODULE_SUFFIX
+CMAKE_LINKER_FLAGS
+CMAKE_LINKER_FLAGS_DEBUG
+CMAKE_LINKER_FLAGS_MINSIZEREL
+CMAKE_LINKER_FLAGS_RELEASE
+CMAKE_LINKER_FLAGS_RELWITHDEBINFO
+)
+
+MARK_AS_ADVANCED( CLEAR
+TCL_LIBRARY
+TK_LIBRARY)