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
Forum Updated to NodeBB v4.3 + New Features

CMAKE variable for several directories

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
3 Posts 2 Posters 624 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 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
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 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 last edited by
        #3

        Thanks! it worked

        1 Reply Last reply
        0

        • Login

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