Results 1 to 2 of 2

Thread: QResource + CMAKE

  1. #1
    Join Date
    Feb 2013
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QResource + CMAKE

    Hello,

    I'm trying to use Qt Resources but my project i work with uses Cmakes files instead of pro files. I'm facing troubles to include de resources files and be able to use them.

    What i'm trying is to add the following into my cmakeslists file


    Part of my cmakeslists.txt
    .
    ..
    ...
    SET( RESOURCES resources.qrc )

    QT4_ADD_RESOURCES(QtApp_RCC_SRCS ${RESOURCES})

    ...
    ...

    target_link_libraries(
    dominio
    ${QT_LIBRARIES}
    ${QT_QTCORE_LIBRARY}
    ${QT_QTGUI_LIBRARY}
    ${QtApp_RCC_SRCS}
    )

    ...
    ..
    .


    It appears on the project viewer, i can add/remove/modify but i never get to compile it. The error returned is:

    *** No rule to make target `Domain/qrc_resources.cxx', needed by `Domain/libdominio_d.dll'.

    Can anyone help me on this one?

    Thanks in advance!

    Leonardo

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QResource + CMAKE

    After QT4_ADD_RESOURCES() is done with it the QtApp_RCC_SRCS variable contains a list of source files not libraries. You need to add this list of source files to your executable not the linker library list.
    Qt Code:
    1. ...
    2. QT4_ADD_RESOURCES(QtApp_RCC_SRCS ${RESOURCES})
    3. ...
    4. add_executable(QtApp ${QtApp_SRCS} ${QtApp_MOC_SRCS} ${QtApp_RCC_SRCS} ${QtApp_UI_HDRS} )
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 0
    Last Post: 6th April 2012, 04:29
  2. QResource::registerResource - problem?
    By zeldaknight in forum Newbie
    Replies: 0
    Last Post: 5th May 2010, 06:57
  3. Doubt regarding QResource
    By volcano in forum Newbie
    Replies: 3
    Last Post: 8th April 2010, 08:55
  4. QResource Stopped Working
    By JPNaude in forum Qt Programming
    Replies: 0
    Last Post: 22nd October 2008, 13:26
  5. qresource file alias problem with svg
    By giotto in forum Qt Programming
    Replies: 2
    Last Post: 19th February 2008, 16:59

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.