MantisBT - CMake
View Issue Details
0014091CMakeCMakepublic2013-04-15 17:202013-11-04 09:33
Dave Abrahams 
Brad King 
normalmajoralways
closedfixed 
MacOS X10.8
CMake 2.8.10.2 
 
0014091: get_filename_component PATH docs and parameter naming kinda suck
<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>
No tags attached.
related to 0014192closed  get_filename_component(REALPATH) doesn't resolve symlink if the file doesn't exists. 
Issue History
2013-04-15 17:20Dave AbrahamsNew Issue
2013-04-16 09:48Brad KingNote Added: 0032852
2013-04-16 09:48Brad KingAssigned To => Brad King
2013-04-16 09:48Brad KingStatusnew => resolved
2013-04-16 09:48Brad KingResolutionopen => fixed
2013-06-04 08:04Brad KingRelationship addedrelated to 0014192
2013-11-04 09:33Robert MaynardNote Added: 0034358
2013-11-04 09:33Robert MaynardStatusresolved => closed

Notes
(0032852)
Brad King   
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   
2013-11-04 09:33   
Closing resolved issues that have not been updated in more than 4 months.