summaryrefslogtreecommitdiffstats
path: root/Source/cmState.h
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2019-01-14 17:27:14 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2019-01-17 14:44:29 (GMT)
commit4568d046c46a7357ab48ddfb1117bad39e65572c (patch)
tree851a7fbee311593712dfff42fdcf9070a2187427 /Source/cmState.h
parentc59eae7ebc5423c2b06befd762f8639b0f23b7a0 (diff)
downloadCMake-4568d046c46a7357ab48ddfb1117bad39e65572c.zip
CMake-4568d046c46a7357ab48ddfb1117bad39e65572c.tar.gz
CMake-4568d046c46a7357ab48ddfb1117bad39e65572c.tar.bz2
Properties: Add CMAKE_ROLE global property
This property allows scripts to determine whether they're in project mode, script mode, find-package mode, CTest, or CPack.
Diffstat (limited to 'Source/cmState.h')
-rw-r--r--Source/cmState.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmState.h b/Source/cmState.h
index abe93ed..dfd6d2c 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -35,6 +35,16 @@ public:
cmState();
~cmState();
+ enum Mode
+ {
+ Unknown,
+ Project,
+ Script,
+ FindPackage,
+ CTest,
+ CPack,
+ };
+
static const char* GetTargetTypeName(cmStateEnums::TargetType targetType);
cmStateSnapshot CreateBaseSnapshot();
@@ -166,6 +176,12 @@ public:
unsigned int GetCacheMajorVersion() const;
unsigned int GetCacheMinorVersion() const;
+ Mode GetMode() const;
+ std::string GetModeString() const;
+ void SetMode(Mode mode);
+
+ static std::string ModeToString(Mode mode);
+
private:
friend class cmake;
void AddCacheEntry(const std::string& key, const char* value,
@@ -210,6 +226,7 @@ private:
bool MinGWMake = false;
bool NMake = false;
bool MSYSShell = false;
+ Mode CurrentMode = Unknown;
};
#endif