[SOLVED] shell script from .pro file



  • 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 ?



  • 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..


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.