summaryrefslogtreecommitdiffstats
path: root/Source/cmakemain.cxx
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2011-07-13 16:59:51 (GMT)
committerAlex Neundorf <neundorf@kde.org>2011-08-09 14:32:45 (GMT)
commit7690edffd9801c41dcfa4ef2a6213d4883e55c83 (patch)
tree4cdcf1954e228b3d69fa3f311a8fe367f4bf3df9 /Source/cmakemain.cxx
parente4f603b698a13857e79a5f6df18a7461b20d4bd4 (diff)
downloadCMake-7690edffd9801c41dcfa4ef2a6213d4883e55c83.zip
CMake-7690edffd9801c41dcfa4ef2a6213d4883e55c83.tar.gz
CMake-7690edffd9801c41dcfa4ef2a6213d4883e55c83.tar.bz2
Replace cmake::GetScriptMode() with GetWorkingMode()
GetWorkingMode() returns a new enum WorkingMode, which is one of NORMAL_MODE, SCRIPT_MODE and FIND_PACKAGE_MODE. Alex
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r--Source/cmakemain.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index ae4529a..c744dcd 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -436,8 +436,7 @@ int do_cmake(int ac, char** av)
bool list_all_cached = false;
bool list_help = false;
bool view_only = false;
- bool script_mode = false;
- bool find_package_mode = false;
+ cmake::WorkingMode workingMode = cmake::NORMAL_MODE;
std::vector<std::string> args;
for(int i =0; i < ac; ++i)
{
@@ -485,7 +484,7 @@ int do_cmake(int ac, char** av)
}
else
{
- script_mode = true;
+ workingMode = cmake::SCRIPT_MODE;
args.push_back(av[i]);
i++;
args.push_back(av[i]);
@@ -494,7 +493,7 @@ int do_cmake(int ac, char** av)
else if (!command && strncmp(av[i], "--find-package",
strlen("--find-package")) == 0)
{
- find_package_mode = true;
+ workingMode = cmake::FIND_PACKAGE_MODE;
args.push_back(av[i]);
}
else
@@ -521,8 +520,7 @@ int do_cmake(int ac, char** av)
cmake cm;
cmSystemTools::SetErrorCallback(cmakemainErrorCallback, (void *)&cm);
cm.SetProgressCallback(cmakemainProgressCallback, (void *)&cm);
- cm.SetScriptMode(script_mode || find_package_mode);
- cm.SetFindPackageMode(find_package_mode);
+ cm.SetWorkingMode(workingMode);
int res = cm.Run(args, view_only);
if ( list_cached || list_all_cached )