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_EXTRA_COMPILERS fails when migrating form Qt 4 to Qt 5
Forum Updated to NodeBB v4.3 + New Features

QMAKE_EXTRA_COMPILERS fails when migrating form Qt 4 to Qt 5

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 1 Posters 483 Views 1 Watching
  • 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.
  • S Offline
    S Offline
    snow45
    wrote on last edited by snow45
    #1

    I am migrating some code from Qt 4 to Qt 5 and all has gone smoothly except for when I use QMAKE_EXTRA_COMPILERS in my .pro file. Compiling with Qt 4 works no problem. But when I compile with Qt 5 then my extra compiler is never called when I call make like it is with Qt 4. I have to call it manually. I have compared the generated Makefiles and they are identical with regards to calling the extra compiler. I'm not sure what is wrong. The code in question is:

    MYFILE_SH_INPUT = myfile.sh
    myfile_sh.input = MYFILE_SH_INPUT
    #myfile.sh creates MyFile.cpp
    myfile_sh.commands += $$PWD/myfile.sh $(OBJECTS_DIR)MyFile.cpp;
    myfile_sh.commands += $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)MyFile.o $(OBJECTS_DIR)MyFile.cpp;
    myfile_sh.output = $(OBJECTS_DIR)/MyFile.o
    myfile_sh.dependency_type = TYPE_C
    myfile_sh.depends = FORCE
    QMAKE_EXTRA_COMPILERS += myfile_sh
    

    I have tried this with Qt 5.5.1 on Xubuntu 16.04 and with Qt 5.6.1 on RHEL 7.3 and it fails with:

     "No rule to make target 'myfile_sh', needed by 'MyApp'. Stop.
    

    Thoughts?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      snow45
      wrote on last edited by
      #2

      Found the problem. For some reason in Qt 5 $(OBJECTS_DIR) returns an empty string in the command:

      myfile_sh.output = $(OBJECTS_DIR)/MyFile.o
      
      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