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

QMAKE_EXTRA_COMPILERS dependencies issue

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 1.7k 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.
  • D Offline
    D Offline
    DPbIH
    wrote on last edited by
    #1

    All

    I have Qt project which contains .ts-file and .qrc-file containing reference to generated .qm-file. We do not store .qm-files in our version control system. The issue here is that when I check out source code and run "make", I'm getting error

    @RCC: Error in 'CoreGeneral.qrc': Cannot find file 'core.general_en.qm'@
    

    I created updateqm.pri files to get .qm files generated before build, this file I include to my .pro files

    @!contains(QMAKE_EXTRA_COMPILERS, updateqm) {
    updateqm.input = TRANSLATIONS
    updateqm.output = ${QMAKE_FILE_BASE}.qm
    updateqm.commands = $$[QT_INSTALL_BINS]/lrelease -idbased ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_BASE}.qm
    updateqm.CONFIG += no_link target_predeps
    QMAKE_EXTRA_COMPILERS += updateqm
    PRE_TARGETDEPS += compiler_updateqm_make_all
    }
    @
    But again, I'm getting this error, though .qm files eventually get generated.
    Compile output looks like this

    @C:\Qt\Qt5.2.1\5.2.1\msvc2012\bin\lrelease -idbased core.general_en.ts -qm core.general_en.qm
    C:\Qt\Qt5.2.1\5.2.1\msvc2012\bin\uic.exe PSGHTMLDisplay.ui -o GeneratedFiles\ui_PSGHTMLDisplay.h
    C:\Qt\Qt5.2.1\5.2.1\msvc2012\bin\rcc.exe -name CoreGeneral CoreGeneral.qrc -o GeneratedFiles\qrc_CoreGeneral.cpp
    RCC: Error in 'CoreGeneral.qrc': Cannot find file 'core.general_en.qm'

    Updating 'core.general_en.qm'...
    Generated 108 translation(s) (0 finished and 108 unfinished)@

    So, for me it looks like RCC starts processing .qrc file before lrelease finished generating .qm-files.

    Is there any approach to avoid this issue?

    P.S. I tried using QMAKE_EXTRA_TARGETS to create pre-build event that will be generating .qm-files before any other target will be started but it didn't work for me. I used approach described here "link":http://blog.mgsxx.com/?p=2180

    Briefly, the approach of creating pre-build event is like below

    @# создаем файл-заглушку
    !exists($$OUT_PWD/.beforebuild) {
    system(@echo aaa > $$system_path($${OUT_PWD}/.beforebuild))
    }

    QMAKE_EXTRA_TARGETS += before_build makefilehook
     
    makefilehook.target = $(MAKEFILE)
    makefilehook.depends = .beforebuild
     
    POST_TARGETDEPS += .beforebuild
     
    before_build.target = .beforebuild
    before_build.depends = FORCE
    before_build.commands = @echo our command@
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      It's been some times since I've used that but shouldn't you rather use PRE_TARGETDEPS ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DPbIH
        wrote on last edited by
        #3

        [quote author="SGaist" date="1419983241"]Hi and welcome to devnet,

        It's been some times since I've used that but shouldn't you rather use PRE_TARGETDEPS ?[/quote]

        I used all combinations but with no luck, unfortunately

        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