Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to change the default value assigned to QMAKE_SPEC (returned when qmake -query) on windows?
Forum Updated to NodeBB v4.3 + New Features

how to change the default value assigned to QMAKE_SPEC (returned when qmake -query) on windows?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.7k Views 2 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.
  • ChetanC Offline
    ChetanC Offline
    Chetan
    wrote on last edited by
    #1

    I am using QT 5.5.1
    i was trying to migrate my project from Visual studio 2008 to 2013.
    i setup QT 5.5.1 and run qmake -tp -r
    in my system, the build goes correctly, and i get .vcxproj files which are compatible to VS 2013,
    but when i do similar things on another machine, the same command builds .vcxproj files which are compatible to VS 2012.

    After some investigation, i found that the QMAKESPEC variable governs this behaviour.
    i found that when i do:
    qmake -query
    i get
    QMAKE_SPEC:win32-msvc2012
    QMAKE_XSPEC:win32-msvc2012

    it seemed like, this variable value should have been win32-msvc2013,
    So, i tried to set it by:
    qmake -set QMAKE_SPEC win32-msvc2013
    but this command seems to be creating one more variable with the same name and sets the value of that to win32-msvc2013,
    i.e. if i do:
    qmake -query
    i get:
    **QMAKE_SPEC:win32-msvc2013
    QMAKE_SPEC:win32-msvc2012
    QMAKE_XSPEC:win32-msvc2012
    **
    and after this too, the build still results in making .vcxproj which are compatible with VS2012 and not VS2013.

    1 Reply Last reply
    0
    • Paul ColbyP Offline
      Paul ColbyP Offline
      Paul Colby
      wrote on last edited by
      #2

      Hi @Chetan,

      On Linux I've set QMAKE_SPEC via environment variables, eg:

      export QMAKESPEC=linux-clang
      

      I believe the Windows equivalent would be to use set, eg:

      set QMAKESPEC=win32-msvc2012
      

      Here's some examples that seem to be doing just that, or something similar:

      • https://github.com/search?q=set+QMAKESPEC&type=Code&utf8=✓

      Cheers.

      1 Reply Last reply
      1
      • ChetanC Offline
        ChetanC Offline
        Chetan
        wrote on last edited by
        #3

        Thanks Paul.
        saw your reply to my question, i was trying to understand the problem, why i didn't need to set QMAKE_SPEC on my Desktop(although the default value of QMAKE_SPEC in qmake -query returned vs2012), it builds vs2013 project files, however on a different machine with same setup it builds vs2012 project files.

        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