Just stumbled upon that problem. I have files like *.darwin.cpp
And get_filename_component returns  .darwin.cpp for the extension which is 
wrong!
The extension  is .cpp.

Let s take the example of toto.tar.gz. It s a gz file, not tar.gz file.  To  
see why it s  wrong we can think of file association, which is most cases would 
associate .gz and not .tar.gz

Right now I use that regex "(\.[^\.]*)$" to get the right extension.

But I really think it should be corrected.

Martin
From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of 
Brian Davis
Sent: Wednesday, November 25, 2009 9:24 PM
To: cmake@cmake.org
Subject: [CMake] get_file_name_component - how to return true extension


for a given file of the form:

openssl-0.9.8a.tar.gz

I call as an example:

 get_filename_component( TAR_EXT openssl-0.9.8a.tar.gz EXT )

and I get for TAR_EXT

.9.1.tar.gz

Which is not quite what I was expecting.

I was expecting .gz and with successive calls I would get  .tar

Is there a mechanism in CMake for getting the trailing extension?

--
Brian J. Davis
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to