diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2022-03-07 22:48:18 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2022-03-07 23:03:16 (GMT) |
commit | f54507c2f6826e9b2b021dbf3b3fa75dcdce22fe (patch) | |
tree | 017a3aebc0cb87ac32482c0f8c0cff70928baa75 /Source/cmCMakePresetsGraph.cxx | |
parent | 7a8536e0eab97d5467dbcca9b14f1a9deaf934ae (diff) | |
download | CMake-f54507c2f6826e9b2b021dbf3b3fa75dcdce22fe.zip CMake-f54507c2f6826e9b2b021dbf3b3fa75dcdce22fe.tar.gz CMake-f54507c2f6826e9b2b021dbf3b3fa75dcdce22fe.tar.bz2 |
CMakePresets.json: Add ${fileDir} macro
Fixes: #23214
Diffstat (limited to 'Source/cmCMakePresetsGraph.cxx')
-rw-r--r-- | Source/cmCMakePresetsGraph.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmCMakePresetsGraph.cxx b/Source/cmCMakePresetsGraph.cxx index 705e2b0..dc14831 100644 --- a/Source/cmCMakePresetsGraph.cxx +++ b/Source/cmCMakePresetsGraph.cxx @@ -353,6 +353,14 @@ bool ExpandMacros(const cmCMakePresetsGraph& graph, const T& preset, macroOut += cmSystemTools::GetSystemName(); return ExpandMacroResult::Ok; } + if (macroName == "fileDir") { + if (version < 4) { + return ExpandMacroResult::Error; + } + macroOut += + cmSystemTools::GetParentDirectory(preset.OriginFile->Filename); + return ExpandMacroResult::Ok; + } } return ExpandMacroResult::Ignore; |