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. qmake function change global variable
Forum Updated to NodeBB v4.3 + New Features

qmake function change global variable

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
2 Posts 1 Posters 256 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.
  • semlanikS Offline
    semlanikS Offline
    semlanik
    wrote on last edited by
    #1

    Hi,

    I would like to change global-scope variable in my qmake function like

    defineReplace(somefunc) {
        SOURCES += my_new_source.cpp
        return()
    }
    
    SOURCES += main.cpp
    
    ret = $$somefunc() #At this point I expect that SOURCES == main.cpp my_new_source.cpp, but it's not
    

    Any idea how to solve this?

    1 Reply Last reply
    0
    • semlanikS Offline
      semlanikS Offline
      semlanik
      wrote on last edited by semlanik
      #2

      Ok, solved.

      defineReplace(somefunc) {
          SOURCES += my_new_source.cpp
          export(SOURCES)
          return()
      }
      
      1 Reply Last reply
      1

      • Login

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