Results 1 to 6 of 6

Thread: qmake how to switch compilation to use different mkspecs

  1. #1
    Join Date
    Sep 2006
    Posts
    10

    Default qmake how to switch compilation to use different mkspecs

    I am looking to compiling under X11 sometimes for X11 and sometimes for Win32.
    So I know that it's possible to set environmnet variable QMAKESPEC or to set the option -spec with Qmake and delete the makefile, but I should want to use the .pro file, there is any possibility.

    Thanks to all.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake how to switch compilation to use different mkspecs

    Without setting a spec before/during qmake is called it wouldn't be possible to determine what environment you are using, therefore what would be the advantages of setting the specs in the .pro file? You couldn't do the following:
    win{
    QMAKESPEC=...
    }
    unix {
    QMAKESPEC=...
    }
    because scopes couldn't be evaluated this way...

  3. #3
    Join Date
    Sep 2006
    Posts
    10

    Default Re: qmake how to switch compilation to use different mkspecs

    QMAKESPEC is an environment variable and qmake cannot set it.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake how to switch compilation to use different mkspecs

    That's not the point. I'm asking, how would you use the possibility to set specs from within the .pro file.

  5. #5
    Join Date
    Sep 2006
    Posts
    10

    Default Re: qmake how to switch compilation to use different mkspecs

    I am using Eclipse with Qt integration, so the only way, I suppose, is to use Qt Project settings (.pro) to compile my project for X11 or Win32. I can set all the variables :

    CONFIG
    DESTDIR
    FORMS
    HEADERS
    QT
    RESOURCES
    SOURCES
    TEMPLATE
    but I don't know how inform qmake using .pro to use different mkspecs.

    The only way I found, is to do manually or to set QMAKESPEC or deleting makefile and running qmake -spec xxxx yyyy.pro

    What I am looking for is to do automatically from Eclipse.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake how to switch compilation to use different mkspecs

    I don't know much about Eclipse, but you can probably create some button in Eclipse where you can assign a custom command. You can call qmake from within there. The thing you want to achieve is not a common thing people do. Usually if you want to create a makefile for a different platform, you'll do it once and not change between two specs again and again.

Similar Threads

  1. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.