Results 1 to 3 of 3

Thread: Adding qrc file to cmake?

  1. #1
    Join Date
    Jul 2013
    Posts
    27
    Thanks
    11
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Adding qrc file to cmake?

    Hello friends,
    I am using cmake for my project, and resource file for all icons and images. As i have not added the qrc file name in my cmake file, i am unable to see the images. I searched on internet how to do it, but i can't find much. The qrc file is within a icons directory, and icons directory is in my project directory. Kindly let me know how to add the qrc file in cmake. Thank you for your time.

  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: Adding qrc file to cmake?

    Qt Code:
    1. ...
    2.  
    3. SET(helloworld_SOURCES main.cpp hellowindow.cpp)
    4. SET(helloworld_HEADERS hellowindow.h)
    5. SET(helloworld_FORMS hellowindow.ui)
    6. SET(helloworld_RESOURCES images.qrc)
    7.  
    8. QT4_WRAP_CPP(helloworld_HEADERS_MOC ${helloworld_HEADERS})
    9. QT4_WRAP_UI(helloworld_FORMS_HEADERS ${helloworld_FORMS})
    10. QT4_ADD_RESOURCES(helloworld_RESOURCES_RCC ${helloworld_RESOURCES})
    11.  
    12. ADD_EXECUTABLE(helloworld ${helloworld_SOURCES}
    13. ${helloworld_HEADERS_MOC}
    14. ${helloworld_FORMS_HEADERS}
    15. ${helloworld_RESOURCES_RCC})
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jul 2013
    Posts
    27
    Thanks
    11
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Adding qrc file to cmake?

    Thank you for the information. Is helloworld the project name here. We have to set project too in cmake, but in my cmake i cant see set project.

Similar Threads

  1. Replies: 1
    Last Post: 19th June 2013, 11:16
  2. Qt Creator Adding files to cmake project
    By xadian in forum Qt Tools
    Replies: 1
    Last Post: 1st April 2013, 16:18
  3. Replies: 5
    Last Post: 8th June 2012, 14:14
  4. how set icon for qt executable project file with cmake and vs 2005?
    By banlinhtienphong in forum Qt Programming
    Replies: 3
    Last Post: 28th April 2011, 09:38
  5. Generating .pro files from vcproj file or CMake file
    By ramazangirgin in forum Qt Programming
    Replies: 2
    Last Post: 17th February 2009, 10:37

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.