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. getting non-simply named items in Header and Source Files in the project tree (Cmake)
Forum Updated to NodeBB v4.3 + New Features

getting non-simply named items in Header and Source Files in the project tree (Cmake)

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 77 Views
  • 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.
  • J Offline
    J Offline
    janhec
    wrote last edited by
    #1

    I try to define my file groups in CMakeLists.txt so that they appear under Header Files and Source Files, respectively. Filespecs using a path (often ../...) are not shown where expected. I noticed that the files (in the groups) have to be found in the set(Header_Files ...) command, so I tried to use include_directories(...) with the path strings in question, but that did not help to make the files (names without path) findable, and using target_include_directories(target, ...) is not possible because the groups are needed to define the target (add_executable(...)) in the first place.
    So I decided to call it a catch-22 and accept that some sourcy files end up under <Other Locations>. Or perhaps I overlooked something? Interesting to hear from you!

    cristian-adamC 1 Reply Last reply
    0
    • J janhec

      I try to define my file groups in CMakeLists.txt so that they appear under Header Files and Source Files, respectively. Filespecs using a path (often ../...) are not shown where expected. I noticed that the files (in the groups) have to be found in the set(Header_Files ...) command, so I tried to use include_directories(...) with the path strings in question, but that did not help to make the files (names without path) findable, and using target_include_directories(target, ...) is not possible because the groups are needed to define the target (add_executable(...)) in the first place.
      So I decided to call it a catch-22 and accept that some sourcy files end up under <Other Locations>. Or perhaps I overlooked something? Interesting to hear from you!

      cristian-adamC Offline
      cristian-adamC Offline
      cristian-adam
      wrote last edited by
      #2

      @janhec have a look at CMake's source_group which is also used by Qt Creator to organize the project view.

      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