[cmake-developers] [CMake 0014462]: RELATIVE_PATH does not return a relative path when there is a double slash in the original path

Mantis Bug Tracker mantis at public.kitware.com
Tue Oct 8 03:10:12 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=14462 
====================================================================== 
Reported By:                Ronan Collobert
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14462
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-10-08 03:10 EDT
Last Modified:              2013-10-08 03:10 EDT
====================================================================== 
Summary:                    RELATIVE_PATH does not return a relative path when
there is a double slash in the original path
Description: 
Assuming:

SET(PATH1 "/foo/bar")
SET(PATH2 "/foo/bar//aaa/bbb")

FILE(RELATIVE_PATH RELPATH12 "${PATH1}" "${PATH2}")

MESSAGE("RELATIVE PATH: ${RELPATH12}")

This will print:
RELATIVE PATH: /aaa/bbb

Which is *not* a relative path in any ways (it should have been "aaa/bbb"). It
is common that there are extra / in paths (often occurring when two paths are
concatenated), and CMake should not take in account those ones.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-10-08 03:10 Ronan CollobertNew Issue                                    
======================================================================




More information about the cmake-developers mailing list