invitation: try compiling kdelibs using cmake

William A. Hoffman billlist at nycap.rr.com
Thu Jan 26 20:57:09 CET 2006


At 02:34 PM 1/26/2006, Mickael Marchand wrote:

>hmm, I ran 'ccmake ..' from my build dir.
>set CMAKE_BUILD_TYPE to Debug (also tried 'debug')
>then pressed 'c' to configure,
>and it failed with the same error ;)
>
>I think the problem comes from the CMakeLists.txt in kdeui (and other
>libs probably)
>QT_QTGUI_LIBRARY is used in this file, so I think cmake tells me that
>it's required (regardless of whether QT_QTGUI_LIBRARY_DEBUG is available
>or not).
>maybe there should be some kind of syntax to say :
>"I want to link with QT_QTGUI_LIBRARY _or_ QT_QTGUI_LIBRARY_DEBUG" in
>the CMakeLists files
>or a wrapper variable which is set to the correct library.

Yes, this a problem.   It should work by doing this:

find_package(Qt4 required)

include(${QT_USE_FILE})
target_link_libraries(target ${QT_LIBRARIES})

There are some options for the QT_USE_FILE:


# QT_USE_FILE which is the path to a CMake file that can be included to compile
# Qt 4 applications and libraries.  By default, the QtCore and QtGui 
# libraries are loaded. This behavior can be changed by setting one or more 
# of the following variables to true:
#                    QT_DONT_USE_QTCORE
#                    QT_DONT_USE_QTGUI
#                    QT_USE_QT3SUPPORT
#                    QT_USE_QTASSISTANT
#                    QT_USE_QTDESIGNER
#                    QT_USE_QTMOTIF
#                    QT_USE_QTNETWORK
#                    QT_USE_QTNSPLUGIN
#                    QT_USE_QTOPENGL
#                    QT_USE_QTSQL
#                    QT_USE_QTXML


>(unrelated:
>the CMAKE_INSTALL_PREFIX variable seems to be always misdetected (as
>/usr/local, whereas I have cmake in /opt/kde4)

CMAKE_INSTALL_PREFIX is where the current project will be installed.
The default value for that is /usr/local.



More information about the Kde-buildsystem mailing list