Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QMake: Getting TARGET name when using VERSION



  • Hi all,

    how can I get the TARGET name when using VERSION in a lib TEMPLATE
    Example (file mylib.pro):

    TEMPLATE = lib
    VERSION = 1.0.0
    message($$TARGET)

    I get "mylib" while the actual target is named "mylib1"

    Thanks,
    Massimo


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    TARGET contains the name of the library so if you want mylib1 you have to assign mylib1 to TARGET.

    VERSION contains the version of the library as in mylib.so.1.0.0


Log in to reply