Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qmake behavior different in QtCreator and on command line

qmake behavior different in QtCreator and on command line

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 438 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.
  • Q Offline
    Q Offline
    QuentinV
    wrote on last edited by
    #1

    I am observing a strange behavior difference between QTcreator and qmake on the command line.

    Here is an example .pro file to reproduce this :

    TEMPLATE = aux
    
    system(/bin/echo "foo" > /tmp/bar0)
    dummy = $$system(/bin/echo "foo" > /tmp/bar1)
    exists(/nofilehere){
        system(/bin/echo "foo" > /tmp/bar2)
        dummy = $$system(/bin/echo "foo" > /tmp/bar3)
    }
    else {
        system(/bin/echo "foo" > /tmp/bar4)
        dummy = $$system(/bin/echo "foo" > /tmp/bar5)
    }
    

    When executing qmake untitled.pro in a terminal, the files bar0, bar1, bar4 and bar5 are created in /tmp.

    When right-clicking on the project name in QtCreator and clicking on "run qmake", the files bar0, bar1, bar4 and bar5 are created in /tmp.

    So far, so good.

    But when I modify the .pro file in QtCreator text editor and save it (like adding a comment somewhere), a spinning wheel appears on the project name. Then only the files bar1 and bar5 are created. In some cases bar3 is also created (!), but I can't reproduce it reliably.

    Is this the intended behavior for the "project refresh" ? I planned to use this to automate some tasks that must be done before anything, and it prevents me from using system calls under conditions.

    I am using Qt Creator 4.6.1 based on Qt 5.10.1 (GCC 7.3.0, 64 bit), on debian.

    aha_1980A 1 Reply Last reply
    0
    • Q QuentinV

      I am observing a strange behavior difference between QTcreator and qmake on the command line.

      Here is an example .pro file to reproduce this :

      TEMPLATE = aux
      
      system(/bin/echo "foo" > /tmp/bar0)
      dummy = $$system(/bin/echo "foo" > /tmp/bar1)
      exists(/nofilehere){
          system(/bin/echo "foo" > /tmp/bar2)
          dummy = $$system(/bin/echo "foo" > /tmp/bar3)
      }
      else {
          system(/bin/echo "foo" > /tmp/bar4)
          dummy = $$system(/bin/echo "foo" > /tmp/bar5)
      }
      

      When executing qmake untitled.pro in a terminal, the files bar0, bar1, bar4 and bar5 are created in /tmp.

      When right-clicking on the project name in QtCreator and clicking on "run qmake", the files bar0, bar1, bar4 and bar5 are created in /tmp.

      So far, so good.

      But when I modify the .pro file in QtCreator text editor and save it (like adding a comment somewhere), a spinning wheel appears on the project name. Then only the files bar1 and bar5 are created. In some cases bar3 is also created (!), but I can't reproduce it reliably.

      Is this the intended behavior for the "project refresh" ? I planned to use this to automate some tasks that must be done before anything, and it prevents me from using system calls under conditions.

      I am using Qt Creator 4.6.1 based on Qt 5.10.1 (GCC 7.3.0, 64 bit), on debian.

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by aha_1980
      #2

      hi @QuentinV,

      Creators integrated QMake parser is thought to provide data for the code model and is by no means complete.

      I think you have to explicitely run qmake (from Build menu) for your changes to take effect.

      That should also happen on a regular build (the makefile contains rules for that). in practice, we have to run qmake by hand from time to time...

      Regards

      Qt has to stay free or it will die.

      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