View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011484CMakeModulespublic2010-11-19 05:172010-11-19 14:14
ReporterDavid Coppa 
Assigned ToClinton Stimpson 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionno change required 
PlatformAllOSOS Version
Product VersionCMake 2.8.3 
Target VersionFixed in Version 
Summary0011484: Issue into Qt4ConfigDependentSettings.cmake
DescriptionThere was a wrong commit for Modules/Qt4ConfigDependentSettings.cmake:

http://cmake.org/gitweb?p=cmake.git;a=commit;h=5e1a2408fedd379467693b3548d46dad464f72ad [^]

Starting at line 66:

IF(NOT QT_IS_STATIC)
 RETURN()
ENDIF(NOT QT_IS_STATIC)

This is incorrect and it should be the opposite.
By now, QT_QT*_LIB_DEPENDENCIES usage is broken due to this.

I've attached a simple diff that fixes the problem.

Ciao,
David
TagsNo tags attached.
Attached Filesdiff file icon Qt4ConfigDependentSettings.diff [^] (514 bytes) 2010-11-19 05:17 [Show Content]

 Relationships

  Notes
(0023432)
Clinton Stimpson (developer)
2010-11-19 09:58

Can you tell me what your problem is?
As far as I can see, your suggestion will break builds against static Qt and cause overlinking against shared Qt.
(0023433)
David Coppa (reporter)
2010-11-19 10:12
edited on: 2010-11-19 10:43

Libraries that should be brought in as dependencies of Qt4 libraries are not registered into ELF headers.

See http://pastie.org/1308360 [^]
Notice the difference between "objdump -p" output and ldd output.

You have "extra" libs, namely ICE.9 SM.8 X11.14 Xext.11 Xi.11 Xinerama.5 Xrender.5 fontconfig.7 freetype.17 glib-2.0.2600 gobject-2.0.2600 gthread-2.0.2600 iconv.6 intl.5 png.10 z.4

And this is a problem for a ports system like the OpenBSD one that needs to take trace of inter libraries dependencies (to update a package from one version to a newer one).

This used to work well with cmake 2.8.1:

When, in a CMakeLists.txt, you have:

TARGET_LINK_LIBRARIES(foo
  ...
  ${QT_QTCORE_LIBRARY} ${QT_QTCORE_LIB_DEPENDENCIES}
  ${QT_QTGUI_LIBRARY} ${QT_QTGUI_LIB_DEPENDENCIES}
  ${QT_QTNETWORK_LIBRARY} ${QT_QTNETWORK_LIB_DEPENDENCIES}

Now ${QT_QTCORE_LIB_DEPENDENCIES}, ${QT_QTGUI_LIB_DEPENDENCIES}, and ${QT_QTNETWORK_LIB_DEPENDENCIES} are empty.

(0023434)
David Coppa (reporter)
2010-11-19 10:18
edited on: 2010-11-19 10:33

If I have understood the implications with static Qt correctly, maybe just removing that check would be a better approach...

(0023438)
Clinton Stimpson (developer)
2010-11-19 12:20

The pastie.org link doesn't work for me.

First of all, QT_QT*_LIB_DEPENDENCIES are not documented as part of the FindQt4 api, and are therefore internal to FindQt4.cmake/UseQt4.cmake. They should not be used in any CMakeLists.txt file.

Here's an example of what is preferable:
If foo depends on QtOpenGL, and makes calls into the OpenGL library, then the CMakeLists.txt for foo should do:
find_package(Qt4)
find_package(OpenGL)
...
target_link_libraries(foo ${QT_QTOPENGL_LIBRARY} ${OPENGL_LIBRARIES})
and link with only the libraries that foo makes calls to.

The problem with using QT_QT*_LIB_DEPENDENCIES is that one links foo against libraries that foo doesn't use. I thought this overlinking was a problem for package maintainers because it causes too many packages to be updated that don't really need to be. If this is not true for package maintainers, then can you respond with how it is supposed to work?
(0023449)
David Coppa (reporter)
2010-11-19 14:05

Ok. I've understood. You can close this issue.

Sorry for the noise,
David

 Issue History
Date Modified Username Field Change
2010-11-19 05:17 David Coppa New Issue
2010-11-19 05:17 David Coppa File Added: Qt4ConfigDependentSettings.diff
2010-11-19 07:43 Brad King Assigned To => Clinton Stimpson
2010-11-19 07:43 Brad King Status new => assigned
2010-11-19 09:58 Clinton Stimpson Note Added: 0023432
2010-11-19 10:12 David Coppa Note Added: 0023433
2010-11-19 10:18 David Coppa Note Added: 0023434
2010-11-19 10:26 David Coppa Note Edited: 0023433
2010-11-19 10:33 David Coppa Note Edited: 0023434
2010-11-19 10:43 David Coppa Note Edited: 0023433
2010-11-19 12:20 Clinton Stimpson Note Added: 0023438
2010-11-19 14:05 David Coppa Note Added: 0023449
2010-11-19 14:14 Clinton Stimpson Status assigned => closed
2010-11-19 14:14 Clinton Stimpson Resolution open => no change required


Copyright © 2000 - 2018 MantisBT Team