View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014091CMakeCMakepublic2013-04-15 17:202013-11-04 09:33
ReporterDave Abrahams 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformMacOSOS XOS Version10.8
Product VersionCMake 2.8.10.2 
Target VersionFixed in Version 
Summary0014091: get_filename_component PATH docs and parameter naming kinda suck
Description<rant on>
       get_filename_component
              Get a specific component of a full filename.

                get_filename_component(<VAR> FileName
                                       PATH|ABSOLUTE|NAME|EXT|NAME_WE|REALPATH
                                       [CACHE])

              Set <VAR> to be the path (PATH), file name (NAME), file extension
              (EXT), file name without extension (NAME_WE) of FileName, the full
              path (ABSOLUTE), or the full path with all symlinks resolved (REAL-
              PATH). Note that the path is converted to Unix slashes format and

What PATH actually does is not to get the "path of FIlename", but the directory of Filename. The fact that ABSOLUTE actually does get the path of filename should make this screamingly obvious. It's not like the results of PATH are some relative version of what ABSOLUTE yields. Nobody should have to troll stackoverflow (http://stackoverflow.com/questions/7035734/cmake-parent-directory [^]) for answers like this one. Recommended fix: deprecate PATH and replace it with DIRECTORY
</rant off>
TagsNo tags attached.
Attached Files

 Relationships
related to 0014192closed get_filename_component(REALPATH) doesn't resolve symlink if the file doesn't exists. 

  Notes
(0032852)
Brad King (manager)
2013-04-16 09:48

These commits should take care of it:

 get_filename_component: Document path components more clearly (0014091)
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df71f968 [^]

 get_filename_component: Add explicit unit tests
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ec1ba9b0 [^]

 get_filename_component: Add DIRECTORY option (0014091)
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7d1590e6 [^]
(0034358)
Robert Maynard (manager)
2013-11-04 09:33

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-04-15 17:20 Dave Abrahams New Issue
2013-04-16 09:48 Brad King Note Added: 0032852
2013-04-16 09:48 Brad King Assigned To => Brad King
2013-04-16 09:48 Brad King Status new => resolved
2013-04-16 09:48 Brad King Resolution open => fixed
2013-06-04 08:04 Brad King Relationship added related to 0014192
2013-11-04 09:33 Robert Maynard Note Added: 0034358
2013-11-04 09:33 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team