Qt5 cmake stuff

Alexander Neundorf neundorf at kde.org
Mon May 14 21:05:01 UTC 2012


On Monday 14 May 2012, David Faure wrote:
> On Monday 14 May 2012 18:10:19 David Faure wrote:
> > Hi (Steve),
> > 
> > It seems that updating Qt5 to the latest master broke my
> > kdelibs-frameworks-qt5 build?
> > 
> > CMake Error at
> > /d/qt/5/qtbase-master/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:60
> > (add_library): add_library cannot create imported target "Qt5::Core"
> > because another target with the same name already exists.
> > Call Stack (most recent call first):
> > 
> > /d/kde/inst/kde_frameworks-qt5/share/ECM-0.0.4/find-modules/FindQt5Transi
> > ti onal.cmake:2 (find_package) tier1/itemmodels/CMakeLists.txt:19
> > (find_package)
> > 
> > (and many more such errors about duplicate targets)
> > 
> > Unfortunately cmake doesn't say *where* it saw the target the first time,
> > so I have no clue how to debug this.
> 
> Actually it seems to happen both times in the same file.
> It's trying to prevent calling add_library(Qt5::Core SHARED IMPORTED)
> twice, but the mechanism to prevent that is not working...
> 
> Qt5CoreConfig.cmake says:
> 
> get_property(_qt5CoreTargetExists DIRECTORY PROPERTY _Qt5Core_target)
> if (NOT _qt5CoreTargetExists)
>     set_property(DIRECTORY PROPERTY _Qt5Core_target TRUE)
>     message(STATUS "DF: Qt5CoreConfig.cmake add_library(Qt5::Core SHARED
> IMPORTED)") add_library(Qt5::Core SHARED IMPORTED)
> endif()
> 
> but the output from make says
> [...]
> -- DF: Qt5CoreConfig.cmake add_library(Qt5::Core SHARED IMPORTED)
> [...]
> -- DF: Qt5CoreConfig.cmake add_library(Qt5::Core SHARED IMPORTED)
> [...]
> 
> so clearly this "directory property" stuff isn't working.

I'm quite sure it, but maybe not as we think it does ;-)

> Steve, Alex: help ;-)
> 
> Which directory is this supposed to be about?

To see where output comes from you can run cmake with --debug-output:

cmake --debug-output .

in the build dir.
 
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20120514/117e3696/attachment.html>


More information about the Kde-frameworks-devel mailing list