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. [SOLVED] shell script from .pro file
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] shell script from .pro file

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

    I'm trying to set my library version to the debian release version of my debian package (in the debian/control file)

    so in my .pro file i added:

    @VERSION="grep urgency ../debian/changelog | cut -f2 -d\\\\\\\\" \" | cut -f1 -d\\- | cut -c2- | head -1"
    DEFINES += LIB_VERSION=\"$$VERSION\"@

    the grep on it's own returns
    @2.1.0@

    but when i look in the generated Makefile the actual grep is in there like:

    @
    ####### Compiler, tools and options

    CC = gcc
    CXX = g++
    DEFINES = -DLIB_VERSION="grep urgency ../debian/changelog | cut -f2 -d" " | cut -f1 -d\- | cut -c2- | head -1" -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED

    ....
    @

    instead of
    DEFINES = -DLIB_VERSION=2.1.0 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED

    is it possible to run a shell script inside the .pro file ?
    or if it isn't can i pass in the VERSION variable during the call to qmake ?

    1 Reply Last reply
    0
    • clogwogC Offline
      clogwogC Offline
      clogwog
      wrote on last edited by
      #2

      ah..
      found an interesting page here: http://doc.qt.digia.com/3.3/qmake-manual-6.html

      @VERSION = $$system(grep urgency ../debian/changelog | cut -f2 -d" " | cut -f1 -d\- | cut -c2- | head -1)@

      does it..

      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