Results 1 to 3 of 3

Thread: passing variables to an mkspec definition via qmake?

  1. #1
    Join Date
    Jun 2008
    Posts
    49
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default passing variables to an mkspec definition via qmake?

    I wonder if it's possible to pass a variable to an mkspec definition, at the invocation of qmake? I'm thinking of passing a variable, that would be used as a substitution value (e.g. $$VAR_NAME) in the mkspec qmake.conf file.

    what I'm trying to solve in particular, is a cross-compilation setup, where I'm cross-compiling a project on Linux, for Windows, using MinGW. it works all fine, but depending on how you set up your cross-compliation toolchain, the names of the executables in the toolchain have different prefixes, like i586-mingw32msvc-gcc, or mingw32-gcc, etc. otherwise, the whole spec file is the same, it's only that the prefixes for these commands should be different.

    I was trying to solve this issue using the following thinking in the spec's qmake.conf:

    Qt Code:
    1. QMAKE_CC = $$TOOLCHAIN_PREFIX-gcc
    2. ..
    3. QMAKE_CXX = $$TOOLCHAIN_PREFIX-g++
    To copy to clipboard, switch view to plain text mode 

    where one would set a variable, TOOLCHAIN_PREFIX at the invocation of qmake, e.g. something like:

    Qt Code:
    1. qmake -set TOOLCHAIN_PREFIX i586-mingw32msvc -spec path/to/spec
    To copy to clipboard, switch view to plain text mode 

    but it doesn't seem to work is there a way to do this, other than creating a separate spec for each of the different toolchain names?

  2. #2
    Join Date
    Apr 2007
    Posts
    44
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: passing variables to an mkspec definition via qmake?

    I think you can edit qmake.conf directly.

  3. #3
    Join Date
    Jun 2008
    Posts
    49
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: passing variables to an mkspec definition via qmake?

    Quote Originally Posted by Teerayoot View Post
    I think you can edit qmake.conf directly.
    well, yes, but this is what I want to avoid..

Similar Threads

  1. Order of qmake variables
    By babu198649 in forum Newbie
    Replies: 3
    Last Post: 29th June 2008, 09:02
  2. Replies: 3
    Last Post: 6th February 2008, 12:53
  3. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  4. Replies: 2
    Last Post: 17th October 2006, 19:25

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.