Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. qmake does not generate 2nd install target in Makefile
Forum Updated to NodeBB v4.3 + New Features

qmake does not generate 2nd install target in Makefile

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
qmakeqtcreatorbuildinstall
5 Posts 2 Posters 4.1k 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.
  • A Offline
    A Offline
    Aleksey_K
    wrote on 15 Apr 2016, 11:11 last edited by Aleksey_K
    #1

    Modified .pro file to install my custom Qt Designer plugin to Creator directory as well:

    CONFIG      += plugin debug_and_release
    TARGET      = $$qtLibraryTarget(WidgetBoxPlugin)
    TEMPLATE    = lib
    ...
    target.path = $$[QT_INSTALL_PLUGINS]/designer
    creator_target.path = $$[QTCREATOR_BIN_PATH]/plugins/designer
    INSTALLS    += target creator_target
    
    

    And resulted dll file was copied into 2 paths (targets). Now it does not work for some reason: qmake does not generate install (copy) script for 2nd target (QTCREATOR_BIN_PATH is set). Think it is a bug in qmake or Qt Creator (QTCREATOR_BIN_PATH is set but not passed to qmake).

    Full project: https://github.com/akontsevich/WidgetBox

    Tried to modify .pro file like mentioned here: http://blog.qt.io/blog/2008/04/16/the-power-of-qmake/ and suggested there: https://bugreports.qt.io/browse/QTBUG-52580

    Modified .pro file to following:

    target.path = $$[QT_INSTALL_PLUGINS]/designer
    
    creator_target.name = Copying the target dll to Qt Creator plugins directory as well
    creator_target.input = $$qtLibraryTarget(WidgetBoxPlugin)
    creator_target.path  = $$[QTCREATOR_BIN_PATH]/plugins/designer
    creator_target.CONFIG += no_check_exist
    creator_target.output = WidgetBoxPlugin.dll
    creator_target.files =  $$[BUILDDIR]/WidgetBoxPlugin.dll
    QMAKE_EXTRA_COMPILERS += creator_target
    
    INSTALLS += target creator_target
    
    

    Build output:

    copy /y \WidgetBoxPlugin.dll \plugins\designer
    Can't find specified file.
    

    Think it is Qt Creator bug 3.6.1 - worked fine in previous versions. I see QTCREATOR_BIN_PATH variable is set, why it is not passed to qmake environment? Same for BUILDDIR

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 15 Apr 2016, 21:43 last edited by
      #2

      Hi,

      To retrieve environment variables, you need to use parenthesis not square brackets.

      The square brackets are for properties set when Qt was built.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 2 Replies Last reply 16 Apr 2016, 02:52
      1
      • S SGaist
        15 Apr 2016, 21:43

        Hi,

        To retrieve environment variables, you need to use parenthesis not square brackets.

        The square brackets are for properties set when Qt was built.

        A Offline
        A Offline
        Aleksey_K
        wrote on 16 Apr 2016, 02:52 last edited by Aleksey_K
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • S SGaist
          15 Apr 2016, 21:43

          Hi,

          To retrieve environment variables, you need to use parenthesis not square brackets.

          The square brackets are for properties set when Qt was built.

          A Offline
          A Offline
          Aleksey_K
          wrote on 16 Apr 2016, 03:06 last edited by Aleksey_K
          #4

          @SGaist works for QTCREATOR_BIN_PATH macro, thanks. Why square brackets works for target?

          According to documentation (https://wiki.qt.io/QMake-top-level-srcdir-and-builddir) correct build dir macro is $$OUT_PWD, so correct installation code is:

          target.path = $$[QT_INSTALL_PLUGINS]/designer
          
          creator_target.name = Copying the target dll to Qt Creator plugins directory as well
          creator_target.input = $qtLbraryTarget(WidgetBoxPlugin)
          creator_target.path  = $$(QTCREATOR_BIN_PATH)/plugins/designer
          creator_target.CONFIG += no_check_exist
          creator_target.output = WidgetBoxPlugin.dll
          creator_target.files = $$OUT_PWD/release/WidgetBoxPlugin.dll
          QMAKE_EXTRA_COMPILERS += creator_target
          
          INSTALLS += target creator_target
          

          This works, thanks! Mark this as resolved!

          P.S. Why engine of this forum sometimes eats 2nd dollar char $$?!

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 16 Apr 2016, 20:11 last edited by
            #5

            Because QT_INSTALL_PLUGINS is defined at build time and is known to qmake.

            As for the double $ problem, that's rather a question for the NodeBB folks

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            1/5

            15 Apr 2016, 11:11

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved