summaryrefslogtreecommitdiffstats
path: root/Source/cmIfCommand.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-06-06 12:49:18 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-06-06 12:49:18 (GMT)
commitc9f1af3913eb9aa8fdc7d374bf38bac59a6bbf59 (patch)
treec781327d9488029424be61d50b358b4c26b5d670 /Source/cmIfCommand.cxx
parent1358009382fe8bac2fea64e31851c75f750274b9 (diff)
downloadCMake-c9f1af3913eb9aa8fdc7d374bf38bac59a6bbf59.zip
CMake-c9f1af3913eb9aa8fdc7d374bf38bac59a6bbf59.tar.gz
CMake-c9f1af3913eb9aa8fdc7d374bf38bac59a6bbf59.tar.bz2
ENH: add IF(IS_ABSOLUTE path), so no regex matching is required in the cmake scripts
Alex
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r--Source/cmIfCommand.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 8faab58..cdcf79d 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -287,6 +287,22 @@ bool cmIfCommand::IsTrue(const std::vector<std::string> &args,
IncrementArguments(newArgs,argP1,argP2);
reducible = 1;
}
+ // is the given path an absolute path ?
+ if (*arg == "IS_ABSOLUTE" && argP1 != newArgs.end())
+ {
+ if(cmSystemTools::FileIsFullPath((argP1)->c_str()))
+ {
+ *arg = "1";
+ }
+ else
+ {
+ *arg = "0";
+ }
+ newArgs.erase(argP1);
+ argP1 = arg;
+ IncrementArguments(newArgs,argP1,argP2);
+ reducible = 1;
+ }
// does a command exist
if (*arg == "COMMAND" && argP1 != newArgs.end())
{