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. Add variable to project file in Qt creator
Forum Updated to NodeBB v4.3 + New Features

Add variable to project file in Qt creator

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
qt creatorproject configproject filescode coverage
3 Posts 2 Posters 894 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.
  • V Offline
    V Offline
    VictorTime
    wrote on last edited by
    #1

    Hello there, I want to generate code coverage report for my Qt project.
    Code coverage tool asks me to add a variable with arguments to my .pro file, however when I add those variable there seems to be no effect.
    I have a build log with code coverage executed from Codeblocks IDE-which shows where all arguments should go:

    -------------- Build: Debug in Genome (compiler: GNU GCC Compiler)---------------
    [ 50.0%] ctc32 -i m g++.exe -Wall -fexceptions -g -Weffc++ -Wextra -std=gnu++14 -Og -g -std=c++1z -IC:\Boost\include -c E:\Projects\Genome\src\main.cpp -o obj\Debug\main.o
    [100.0%] ctc32 -i m g++.exe  -o bin\Debug\Genome.exe obj\Debug\main.o
    ---------------------------------------------------------------------------------
    

    Here variable to add is: ctc32 and arguments are: -i m and they need to be executed before g++ is called.

    • I added variables to project file but I don't know how to pass it to qmake so that it can be called just before compiler is called?

    • I tried to edit Make files directly but they are auto generated each time project is build.

    Thank you

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      How exactly did you add that ?

      Not to nitpick but ctc32 is not a variable it's an executable or a script.

      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
      1
      • V Offline
        V Offline
        VictorTime
        wrote on last edited by
        #3

        Hello thanks for reply,
        Yes ctc32 is an executable and args -i m for instrumentation multi-condition code coverage.
        I added these lines to my project file.

        CodeCoverage {
         CTC32 += ctc32 -i m
        }
        
        QMAKE_CC  = CTC32$$QMAKE_CXX
        QMAKE_CXX = CTC32$$QMAKE_CXX
        

        I really don't understand how to tell Qt creator to call ctc32 before calling g++ (or in other words ctc32 will call g++). I had a look on qmake Variable Reference but this is the only thing I got.

        Thank you

        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