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. CMAKE variable for several directories
Servers for Qt installer are currently down

CMAKE variable for several directories

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
3 Posts 2 Posters 449 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.
  • M Offline
    M Offline
    maxwell31
    wrote on 3 Apr 2020, 07:02 last edited by
    #1

    Hi,

    We work with cmake toolchain files, and one entry looks like this
    set(SPECIAL_INCLUDE_DIRS /home/dir1 /homedir2 /home/dir3)

    later in the CmakeLists.txt we do
    include_directories(${SPECIAL_INCLUDE_DIRS})

    As I did not manage to use my toolchain file in creator I tried to add a variable named SPECIAL_INCLUDE_DIRS to my cmake settings in qt creator under build settings. When I simply enter the directories with a space in between I end up with the following line in compilation:

    -I"/home/dir1 /homedir2 /home/dir3"
    so it has quotes around it instead of having several -I entries for every dir.

    Is there a way around it? I cannot change the cmake file where include_directories(${SPECIAL_INCLUDE_DIRS}) is, as other developers don't use qt creator and I would like to avoid making them adopt their toolchain files.

    1 Reply Last reply
    0
    • C Online
      C Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 3 Apr 2020, 10:51 last edited by
      #2

      @maxwell31 said in CMAKE variable for several directories:

      Is there a way around it?

      If you want a list, you have to use ';' as separator - see the cmake documentation

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      3
      • M Offline
        M Offline
        maxwell31
        wrote on 8 Apr 2020, 18:28 last edited by
        #3

        Thanks! it worked

        1 Reply Last reply
        0

        1/3

        3 Apr 2020, 07:02

        • Login

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