Results 1 to 2 of 2

Thread: Adding files to cmake project

  1. #1

    Default Adding files to cmake project

    Hello everyone,

    I'm new to QT Creator and like to work with CMake. I have however not been able to figure out how to add a new file to my CMake project using QTC.

    How I have been doing things so far:
    1. Create new source file in QTC
    2. Open CMakeLists in that directory in QTC (Open With->Plain Text Editor), add the new source file in CMakeLists
    3. Reload the whole project in QTC to have the file appear in the side window.

    Do I really have to reload the whole CMake project every time I add files?!
    Also: Is there no syntax highlighting for CMake?

    Thanks in advance,
    xadian

  2. #2
    Join Date
    Apr 2013
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Smile Re: Adding files to cmake project

    I have the same question about cmake project, and then I found a way to add files into it:

    1. Right click project pane, and click "show in the explorer"

    2. Add a new file, e.g. "new.c" in this dir

    3. Back to QTC, and then right click on the project name, choose the "execute CMake"

    4. In the popup window, click the button of "Execute CMake". When finished, the new file would show in our cmake project pane!

    Hope this helpful, and I'm happy sharing this with you.

Similar Threads

  1. Replies: 1
    Last Post: 3rd December 2009, 23:34
  2. Generating .pro files from vcproj file or CMake file
    By ramazangirgin in forum Qt Programming
    Replies: 2
    Last Post: 17th February 2009, 09:37
  3. build project with cmake does not work
    By codebehind in forum Qt Programming
    Replies: 4
    Last Post: 18th August 2008, 12:29
  4. visual studio project files - adding extra files
    By luf in forum Qt Programming
    Replies: 3
    Last Post: 13th June 2008, 21:05
  5. adding a qt-ui to a non-qt project, dll
    By TheKedge in forum Qt Programming
    Replies: 3
    Last Post: 28th February 2007, 17:08

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.