[cmake-developers] [CMake 0016047]: automoc generates wrong #includes for projects in a symlinked path

Mantis Bug Tracker mantis at public.kitware.com
Fri Apr 1 13:36:36 EDT 2016


The following issue has been SUBMITTED. 
====================================================================== 
https://cmake.org/Bug/view.php?id=16047 
====================================================================== 
Reported By:                Maurizio Paolini
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   16047
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2016-04-01 13:36 EDT
Last Modified:              2016-04-01 13:36 EDT
====================================================================== 
Summary:                    automoc generates wrong #includes for projects in a
symlinked path
Description: 
project "kig" uses cmake and automoc.
My local copy of the git sources are located in a folder that I reach following
a symlink
(it resides in a local partition whereas my home is on an NFS-mounted
filesystem).
after a cmake and then a "make", the generated "moc*" files contain
an "#include" like this:

#include
"../../../../../misc/euclide/paolini/Git/kdeedu/kig/modes/popup/popup.h"

There is a wrong number of ".." and the path does not work.
using "make VERBOSE=1 kigpart_automoc" it turns out that the following command
is issued:

/usr/lib/qt5/bin/moc -I/home/matem/paolini/Git/kdeedu/kig/modes [...] -o
/home/matem/paolini/Git/kdeedu/kig/moc_popup.cpp
/home/misc/euclide/paolini/Git/kdeedu/kig/modes/popup/popup.h

where the [...] part contains many more -I and various options. Notice that
"/home/matem/paolini/Git/" and "/home/misc/euclide/paolini/Git/" point to the
same place, the first through the symlink "Git", the second is the physical
path.
I guess that then "moc" tries hard to walk (with a relative path) from
one path to the other, but there is no way to successfully climb up
a path with a symlink in it using the ".." directory.

This problem was previously reported in the QT bug tracker
https://bugreports.qt.io/browse/QTBUG-51964



Steps to Reproduce: 
$ mkdir -p a/b
$ ln -s a/b a.lnk
$ cd a.lnk
$ <create a cmake project here that uses automoc>
$ cd <project>
$ cmake . [...]
$ make

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2016-04-01 13:36 Maurizio PaoliniNew Issue                                    
======================================================================



More information about the cmake-developers mailing list