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. Please help me with .qmake.cache
Qt 6.11 is out! See what's new in the release blog

Please help me with .qmake.cache

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

    I have two similar projects. Both use several same subprojects. I need set the switch in one of top projects and then make conditional build in subprojects depending of this switch. Say one project has ADVERTIZING = true but other not. I need get this value inside subproject header file. Qmake still cannot translate variables from project to subproject in natural way. But Qt5 has .qmake.cache file feature as I read in Web. Unfortunately I cannot get it working. I created zero length .qmake.cache file in directory with both top project files. All project and subproject drectories are nested in it too. In top project I wrote

    ADVERTIZING = true
    cache(ADVERTIZING, set, ADVERTIZING).
    

    I expected after qmake parsing or while building the .qmake.cache will get some text with variable ADVERTIZING set to true. But size of .qmake.cache remains 0. Whatever I did.

    What can be wrong? I use Qt 5.12.5 with all default settings after installation. No any settings was changed.

    G 1 Reply Last reply
    0
    • G Gourmet

      I have two similar projects. Both use several same subprojects. I need set the switch in one of top projects and then make conditional build in subprojects depending of this switch. Say one project has ADVERTIZING = true but other not. I need get this value inside subproject header file. Qmake still cannot translate variables from project to subproject in natural way. But Qt5 has .qmake.cache file feature as I read in Web. Unfortunately I cannot get it working. I created zero length .qmake.cache file in directory with both top project files. All project and subproject drectories are nested in it too. In top project I wrote

      ADVERTIZING = true
      cache(ADVERTIZING, set, ADVERTIZING).
      

      I expected after qmake parsing or while building the .qmake.cache will get some text with variable ADVERTIZING set to true. But size of .qmake.cache remains 0. Whatever I did.

      What can be wrong? I use Qt 5.12.5 with all default settings after installation. No any settings was changed.

      G Offline
      G Offline
      Gourmet
      wrote on last edited by Gourmet
      #2

      Just solved... The error was - I tried set value for cache file not inside top project file but inside "heading" subproject. When I moved both lines to top project - all began work fine. The cache() statement must be in project file before subprojects definition.

      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