diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmMakefile.cxx | 17 | ||||
-rw-r--r-- | Source/cmMakefile.h | 1 |
2 files changed, 17 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index d47832e..2745905 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -74,7 +74,8 @@ cmMakefile::cmMakefile() this->AddSourceGroup("Header Files", "\\.(h|h\\+\\+|hm|hpp|hxx|in|txx|inl)$"); this->AddSourceGroup("CMake Rules", "\\.rule$"); this->AddDefaultDefinitions(); - m_cmDefineRegex.compile("#cmakedefine[ \t]*([A-Za-z_0-9]*)"); + m_cmDefineRegex.compile("#cmakedefine[ \t]+([A-Za-z_0-9]*)"); + m_cmDefine01Regex.compile("#cmakedefine01[ \t]+([A-Za-z_0-9]*)"); this->PreOrder = false; } @@ -2399,6 +2400,20 @@ void cmMakefile::ConfigureString(const std::string& input, output += " */"; } } + else if(m_cmDefine01Regex.find(line)) + { + const char* def = this->GetDefinition(m_cmDefine01Regex.match(1).c_str()); + cmSystemTools::ReplaceString(line, "#cmakedefine01", "#define"); + output += line; + if(!cmSystemTools::IsOff(def)) + { + output += " 1"; + } + else + { + output += " 0"; + } + } else { output += line; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index ab0c89a..dba2763 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -726,6 +726,7 @@ private: DefinitionMap::key_type m_TemporaryDefinitionKey; cmsys::RegularExpression m_cmDefineRegex; + cmsys::RegularExpression m_cmDefine01Regex; std::map<cmStdString,cmStdString> m_Properties; |