From e50a36df488be05dfbc85005c88ec8d4c5314a76 Mon Sep 17 00:00:00 2001 From: Tushar Maheshwari Date: Thu, 24 Jan 2019 22:38:52 +0530 Subject: cmGetFilenameComponentCommand: Add more components LAST_EXT: gets last extension from filename with multiple periods NAME_WLE: gets the name without the last extension --- Source/cmGetFilenameComponentCommand.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source/cmGetFilenameComponentCommand.cxx') diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index ffb895e535..163b4c8abc 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -88,6 +88,10 @@ bool cmGetFilenameComponentCommand::InitialPass( result = cmSystemTools::GetFilenameExtension(filename); } else if (args[2] == "NAME_WE") { result = cmSystemTools::GetFilenameWithoutExtension(filename); + } else if (args[2] == "LAST_EXT") { + result = cmSystemTools::GetFilenameLastExtension(filename); + } else if (args[2] == "NAME_WLE") { + result = cmSystemTools::GetFilenameWithoutLastExtension(filename); } else if (args[2] == "ABSOLUTE" || args[2] == "REALPATH") { // If the path given is relative, evaluate it relative to the // current source directory unless the user passes a different -- cgit v1.2.1