diff options
author | Brad King <brad.king@kitware.com> | 2019-01-17 16:43:02 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-01-17 16:43:09 (GMT) |
commit | 68e20f674a48be38d60e129f600faf7c483f2b97 (patch) | |
tree | 12eace6e569c0aa97f86f4405fdcbcdb75068adc /Source/cmakemain.cxx | |
parent | bd3685b6cfac90bb553df0330e1732c066fe7dca (diff) | |
parent | 4568d046c46a7357ab48ddfb1117bad39e65572c (diff) | |
download | CMake-68e20f674a48be38d60e129f600faf7c483f2b97.zip CMake-68e20f674a48be38d60e129f600faf7c483f2b97.tar.gz CMake-68e20f674a48be38d60e129f600faf7c483f2b97.tar.bz2 |
Merge topic 'cmake_role-global-property'
4568d046c4 Properties: Add CMAKE_ROLE global property
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2805
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r-- | Source/cmakemain.cxx | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index e52f2b3..84d1414 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -217,7 +217,7 @@ int do_cmake(int ac, char const* const* av) doc.addCMakeStandardDocSections(); if (doc.CheckOptions(ac, av)) { // Construct and print requested documentation. - cmake hcm(cmake::RoleInternal); + cmake hcm(cmake::RoleInternal, cmState::Unknown); hcm.SetHomeDirectory(""); hcm.SetHomeOutputDirectory(""); hcm.AddCMakePaths(); @@ -299,7 +299,7 @@ int do_cmake(int ac, char const* const* av) } } if (sysinfo) { - cmake cm(cmake::RoleProject); + cmake cm(cmake::RoleProject, cmState::Project); cm.SetHomeDirectory(""); cm.SetHomeOutputDirectory(""); int ret = cm.GetSystemInformation(args); @@ -307,7 +307,19 @@ int do_cmake(int ac, char const* const* av) } cmake::Role const role = workingMode == cmake::SCRIPT_MODE ? cmake::RoleScript : cmake::RoleProject; - cmake cm(role); + cmState::Mode mode = cmState::Unknown; + switch (workingMode) { + case cmake::NORMAL_MODE: + mode = cmState::Project; + break; + case cmake::SCRIPT_MODE: + mode = cmState::Script; + break; + case cmake::FIND_PACKAGE_MODE: + mode = cmState::FindPackage; + break; + } + cmake cm(role, mode); cm.SetHomeDirectory(""); cm.SetHomeOutputDirectory(""); cmSystemTools::SetMessageCallback(cmakemainMessageCallback, &cm); @@ -463,7 +475,7 @@ static int do_build(int ac, char const* const* av) return 1; } - cmake cm(cmake::RoleInternal); + cmake cm(cmake::RoleInternal, cmState::Unknown); cmSystemTools::SetMessageCallback(cmakemainMessageCallback, &cm); cm.SetProgressCallback(cmakemainProgressCallback, &cm); return cm.Build(jobs, dir, target, config, nativeOptions, clean); @@ -501,7 +513,7 @@ static int do_open(int ac, char const* const* av) return 1; } - cmake cm(cmake::RoleInternal); + cmake cm(cmake::RoleInternal, cmState::Unknown); cmSystemTools::SetMessageCallback(cmakemainMessageCallback, &cm); cm.SetProgressCallback(cmakemainProgressCallback, &cm); return cm.Open(dir, false) ? 0 : 1; |