Results 1 to 8 of 8

Thread: What Does $$qtLibraryTarget() Do?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: What Does $$qtLibraryTarget() Do?

    Quote Originally Posted by wysota View Post
    How do you use this function? All it does is return the name of the library. What happens if you write this instead of using the function?

    qmake Code:
    1. TARGET=mylibname
    To copy to clipboard, switch view to plain text mode 
    See my original post; I already know what the function's outputs are, or seem to be, and I already have a mixture of project files, some that use it, others that don't.

    My question is simple: what, exactly, is the function supposed to do? Since no one seems to know the answer to that question, I'm left to assume that it's simply an internal function that, as already noted, returns the system-specific name of the library being built, that it is used internally by qmake for this purpose, and the multitude of examples both in the Qt tutorials and examples code and scattered, albeit inconsistently, throughout Qt's source tree itself are, in fact, pointless escapees from the development environment.

    At least, that's the assumption I'm going to adopt unless someone can put forward some actual documentation.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: What Does $$qtLibraryTarget() Do?

    Quote Originally Posted by SixDegrees View Post
    My question is simple: what, exactly, is the function supposed to do? Since no one seems to know the answer to that question, I'm left to assume that it's simply an internal function that, as already noted, returns the system-specific name of the library being built, that it is used internally by qmake for this purpose, and the multitude of examples both in the Qt tutorials and examples code and scattered, albeit inconsistently, throughout Qt's source tree itself are, in fact, pointless escapees from the development environment.

    At least, that's the assumption I'm going to adopt unless someone can put forward some actual documentation.
    Qt is open-source, just look into the function code:

    qmake Code:
    1. defineReplace(qtLibraryTarget) {
    2. unset(LIBRARY_NAME)
    3. LIBRARY_NAME = $$1
    4. mac:!static:contains(QT_CONFIG, qt_framework) {
    5. QMAKE_FRAMEWORK_BUNDLE_NAME = $$LIBRARY_NAME
    6. export(QMAKE_FRAMEWORK_BUNDLE_NAME)
    7. }
    8. contains(TEMPLATE, .*lib):CONFIG(debug, debug|release) {
    9. !debug_and_release|build_pass {
    10. mac:RET = $$member(LIBRARY_NAME, 0)_debug
    11. else:win32:RET = $$member(LIBRARY_NAME, 0)d
    12. }
    13. }
    14. isEmpty(RET):RET = $$LIBRARY_NAME
    15. return($$RET)
    16. }
    To copy to clipboard, switch view to plain text mode 

    Like I already said, it returns the name of the library (with "d" or "_debug" appended for windows and mac respectively when running in debug mode). It's a direct equivalent of "TARGET=xyz" (apart from assigning the value of course).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. [SOLVED] Q_EXPORT_PLUGIN2 vs. $$qtLibraryTarget()
    By zaphod.b in forum Qt Programming
    Replies: 2
    Last Post: 24th July 2009, 14:40

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.