Results 1 to 6 of 6

Thread: Changing the -spec flag for qmake needs Makefile deletion

  1. #1
    Join Date
    Jan 2006
    Location
    Athens - Greece
    Posts
    219
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Changing the -spec flag for qmake needs Makefile deletion

    I have tested with Qt 3.3.5 (linux) and Qt 4.1.0 (linux). Here's the case: I have gcc and icc installed in my linux box. For a Qt project if I run qmake -spec linux-g++ I get a Makefile that builds flawlesly with g++. If I delete the Makefile and run qmake -spec linux-icc I get a Makefile that also builds flawlesly using icc. The problem is that if I don't delete the gcc Makefile and run qmake -spec linux-icc I get the gcc Makefile again. Probably qmake just checks if the project has changed (new libs, source files, deps whatever) to generate a Makefile, but when the compiler changes does nothing. Is there a clever way around this? My question is for the QtWorkbench plugin I'm writing for Code::Blocks (you can get some info here) and deleting the Makefile "by hand" is not an option. Let's see if anyone else can come up with something. Thanks for your time,
    Yorgos

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Changing the -spec flag for qmake needs Makefile deletion

    Maybe you could just "touch" the .pro file?

  3. #3
    Join Date
    Jan 2006
    Location
    Athens - Greece
    Posts
    219
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Changing the -spec flag for qmake needs Makefile deletion

    Quote Originally Posted by jacek
    Maybe you could just "touch" the .pro file?
    The .pro file is recreated in every build, so the modification time is different. Also since the same aproach is also used in widows, is there something resembling "touch" in windows? I just mentioned the linux case cause this is where I have two compilers working with Qt. I will install Qt 3.2 (the free one that comes with the book) in windows for some extra tests at a later time.
    Last edited by yop; 12th March 2006 at 18:57. Reason: typo

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Changing the -spec flag for qmake needs Makefile deletion

    Quote Originally Posted by yop
    The .pro file is recreated in every build, so the modification time is different.
    AFAIR if .pro file was modified after the Makefile, make will run qmake. Maybe you should set the QMAKESPEC environment variable?

  5. #5
    Join Date
    Jan 2006
    Location
    Athens - Greece
    Posts
    219
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Changing the -spec flag for qmake needs Makefile deletion

    Quote Originally Posted by jacek
    AFAIR if .pro file was modified after the Makefile, make will run qmake.
    You are right but this doesn't change the fact that the same Makefile is created. Let me tell you about the steps I take. I create the .pro file depending on the users selections, I run qmake, I build using the created Makefile. Most of the .pro contents (SOURCES, FORMS, HEADERS and many others) are calculated and updated when the user builds the project, so between consecutive builds there is always a "new" .pro file.
    Quote Originally Posted by jacek
    Maybe you should set the QMAKESPEC environment variable?
    I have but it also didn't work. Also since it is intended to be a tool for other users as well, I don't want to mess with their enviroment behind the scenes.

  6. #6
    Join Date
    Jan 2006
    Location
    Athens - Greece
    Posts
    219
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Changing the -spec flag for qmake needs Makefile deletion

    Well distcleaning worked . I guess I had to see it from another point of view to get it done (or read the Makefile a little closer )

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.