Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QtCreator, cmake and source_group
Forum Updated to NodeBB v4.3 + New Features

QtCreator, cmake and source_group

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 3 Posters 6.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tomasz_grobelny
    wrote on last edited by
    #1

    I am using QtCreator with CMake and I want to group files in Projects view in QtCreator. source_group seems to be the way to go, but a line of "SOURCE_GROUP("Source Files" FILES ${SOURCES})" doesn't seem to have any effect on QtCreator. Should such configuration work out of the box?
    If it is not a supported scenario work: are changes needed on QtCreator side or CMake side (CodeBlocks generator?)?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      Nope, SOURCE_GROUP is not supported by Qt Creator AFAIR.

      Improvements to the CMake code are welcome in case you want to implement it:-)

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tallia1
        wrote on last edited by
        #3

        Really too bad.. I have some CPP files which I would like to see in the source tree even though they are not part of a add_executable or a add_library statement.

        Is there any way of adding them?
        Something that will generate an OTHER_FILES equivalent...

        Thanks

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on last edited by
          #4

          Tallia1: Please do not necro-post, open a new thread instead.

          Sorry, I don't know much about the details of the cmake integration, so unfortunately I can't help. Just wipping up a qmake project using "qmake -project" and then removing the qmake call in creator usually works well enough for me to not bother with other build systems too much:)

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tallia1
            wrote on last edited by
            #5

            Tobias, sorry but I need to necro this post as I finally found a solution for it.
            Unfortunately source_group does not work for QtCreator. Instead you can do the following:

            @add_custom_target(dummy SOURCES ${HEADERS} ${SOURCES})@

            The "custom target":http://www.cmake.org/cmake/help/v3.0/command/add_custom_target.html has no command specified, so it will do nothing beyond adding the files to the source tree.

            I am going to submit a feature request for QtCreator nonetheless

            1 Reply Last reply
            2

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved