[Cmake] FindTcl.cmake : manual install support

Sebastien BARRE sebastien at barre.nom.fr
Thu May 24 21:21:45 EDT 2001


At 22/05/2001 10:39, Ken Martin wrote:

> > At 12/05/2001 03:17, Sebastien BARRE wrote:
> >
> > No answers either, so I might implement this one :
> >
> > GET_FILEPATH(varname fullpathname)
> >
> > but it looks a bit too specific to me...
>
>I'd probably stick with GET_FILEPATH
>since it is more consistent with the other commands and I can't think
>of too many system commands that would be used.

Please welcome a new command : GET_FILENAME_COMPONENT
       "GET_FILENAME_COMPONENT(VarName FileName PATH|NAME|EXT|NAME_WE)\n"
       "Set VarName to be the path (PATH), file name (NAME), file "
       "extension (EXT) or file name without extension (NAME_WE) of 
FileName.\n"
       "Note that the path is converted to Unix slashes format and has no "
       "trailing slashes. The longest file extension is always considered.";

As this is my first CMake command, please feel free to check it carefully :)

cmGetFilenameComponentCommand.h
cmGetFilenameComponentCommand.cxx :
         were added. Note that as I consider this command as a "utility" 
command, the cache is not modified. It's up to the user to put this new 
definition in the cache if he wants to, but I did not want to clutter the 
cache with intermediate values.

CMakeLib.dsp :
         has been changed to include this command, but I do not know 
exactly where to do the same for Unix. I guess as cmCommands.cxx includes 
everything, it should be fine.

cmCommands.cxx
         now includes cmGetFilenameComponentCommand

FindTcl.cmake :
         has been changed accordingly : it tries to find tclsh or wish and 
use that path to find the include or lib directories. Note that 
TK_INTERNAL_PATH is searched too (path to tkWinInt.h), and if it's not 
found, the default value set in the VTK Rendering/CMakeLists.txt is used.

cmFindPathCommand.cxx :
         has been slightly changed to collapse the path found.

cmSystemTools :
         now includes 4 brand new functions :

 >   ///! return path of a full filename (no trailing slashes).
 >   static std::string GetFilenamePath(const std::string&);
 >
 >   ///! return file name of a full filename (i.e. file name without path).
 >   static std::string GetFilenameName(const std::string&);
 >
 >   ///! return file extension of a full filename (dot included).
 >   static std::string GetFilenameExtension(const std::string&);
 >
 >   ///! return file name without extension of a full filename.
 >   static std::string GetFilenameNameWithoutExtension(const std::string&);

         At this point, you might ask me why these functions are "system 
specific", and why they are in cmSystemTools :) Well, I do not know, I 
guess they could also be static function in cmGetFilenameComponentCommand, 
but I'm not sure someone would notice them, and I think they can be useful 
in many other situations. What do you think.

OK, now my Tcl is found correctly :) Good.





More information about the CMake mailing list