Important: Please read the Qt Code of Conduct -

Qmake version format for libraries

  • Hello,

    Is there a way to change the way that qmake generates versions for libraries?

    For example: The lib I am building with qmake outputs something like this given VERSION=1 (link to (link to (link to

    I'd like it to do this: (link to

    I can't find anything in the documentation that suggests a way to do this...


  • The links work this way on my Linux machine: -> -> -> ### this is the real file

    I don't know where your link scheme has come from. The creation of symbolic links is hard coded into qmake for most UNIX-like systems. This is absolutely standard behaviour on these machines.

    You can suppress the links using something like:
    @QMAKE_LN_SHLIB = echo Skipping@

    but you will still get a target library name containing the full version number.

    Why do you think you need to avoid behaving in expected ways?

  • I need to conform to my company's naming conventions... not everyone around here uses Unix systems and not everything uses qmake.

    Another way around this would be to change the format of the version number to be JUST the major version. I tried changing VER_MAJ and VER_PAT to 0 and undefined, but it always uses the same format and defaults to 0 when undefined. Is it possible to change the version format or is this also hardcoded?

  • Feel free to rename the library file and ignore the symlinks in your install script.

    Or, write a short shell script that renames and creates the desired links. Have it called after linking with:
    @QMAKE_POST_LINK = ./ $$quote($(TARGET)) @



    ln -s $TARGET $TARGET_X@

Log in to reply