Cmake and Qt library paths



  • Hi
    I have Qt project that i would like to compile with cmake.
    When compiling it gives the following error.

    make[2]: *** No rule to make target `/usr/lib/libQtXml.so'

    libQtXml.so is available in the following directory /usr/lib/x86_64-linux-gnu/libQtXml.so.4.8

    In the CMakeLists.txt file is a section that is supposed to find the correct location.
    search for Qt4
    @SET(QT_MIN_VERSION 4.4.0)
    FIND_PACKAGE(Qt4 ${QT_MIN_VERSION} REQUIRED)
    SET(QT_USE_QTXML 1)
    SET(QT_USE_QTNETWORK 1)
    SET(QT_USE_QTSVG 1)
    SET(QT_USE_QTSQL 1)
    SET(QT_USE_QTWEBKIT 1)

    IF (NOT QT_QTXML_FOUND OR NOT QT_QTNETWORK_FOUND OR NOT QT_QTSVG_FOUND OR NOT QT_QTSQL_FOUND OR NOT QT_QTWEBKIT_FOUND)
    MESSAGE(SEND_ERROR "Some Qt4 modules haven't been found!")
    ENDIF ()

    INCLUDE( ${QT_USE_FILE} )@

    But when running the ccmake in the terminal and look at all the variables it states the path as /usr/lib/libQtXml.so

    What do i have to do/change so that it will find the Qt libs in the correct place?

    Thanks in advance



  • Hi,

    instead of:
    @
    FIND_PACKAGE(Qt4 ${QT_MIN_VERSION} REQUIRED)
    SET(QT_USE_QTXML 1)
    SET(QT_USE_QTNETWORK 1)
    SET(QT_USE_QTSVG 1)
    SET(QT_USE_QTSQL 1)
    SET(QT_USE_QTWEBKIT 1)
    @

    try:
    @
    SET(QT_USE_QTXML 1)
    SET(QT_USE_QTNETWORK 1)
    SET(QT_USE_QTSVG 1)
    SET(QT_USE_QTSQL 1)
    SET(QT_USE_QTWEBKIT 1)
    FIND_PACKAGE(Qt4 ${QT_MIN_VERSION} REQUIRED)
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.