Results 1 to 8 of 8

Thread: Is it possible to say to Qmake that copy the target to multiple destination?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    56
    Thanked 1 Time in 1 Post

    Default Is it possible to say to Qmake that copy the target to multiple destination?

    I'd want to copy the file build to multiple places.
    I know I'd can do it with a bat, but it can generate errors (if you forget to execute it)
    So I think that the best way can be to do the work when build.
    I have seen a post from 2007, suggesting .command (or something like this).
    Any help ?
    Thanks
    Last edited by tonnot; 15th March 2011 at 19:41.

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

    Default Re: Is it possible to say to Qmake that copy the target to multiple destination?

    Have you tried what the post suggested? Why do you need to copy the same file into multiple places?
    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.


  3. #3
    Join Date
    Sep 2010
    Posts
    654
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    56
    Thanked 1 Time in 1 Post

    Default Re: Is it possible to say to Qmake that copy the target to multiple destination?

    mmm. I cant do nothing. But I have seen the system() element.

    And... I want to write the code at .pro file.
    Now I have a piece of .pro)
    Qt Code:
    1. RESOURCES = icons.qrc
    2. DESTDIR = $(QTDIR)/plugins/designer
    3. message( "This is a message" )
    4. system(copy d:/Qt/plugins/designer/apcplugins.dll d:/I_DESARROLLO/c++ok/MY_DLL)
    To copy to clipboard, switch view to plain text mode 
    I see at 'Compile Output window' then next :
    Command syntax does not correct
    Command syntax does not correct
    Command syntax does not correct
    RCC: Warning: No resources in '..\APCplugins\icons.qrc'.
    mingw32-make: Leaving directory `D:/I_DESARROLLO/c++ok/APCplugins-build-desktop'
    RCC: Warning: No resources in '..\APCplugins\icons.qrc'.
    Project MESSAGE: This is a message
    Project MESSAGE: This is a message
    Project MESSAGE: This is a message

    Three questions :
    1.- system copy does not work
    2.- I dont know whats happen, but I see the message and command error 3 times ???
    3.- I have the impression that things are not executed in the order I have write at .pro file .
    (RCC: Warning: No resources in '..\APCplugins\icons.qrc'. is true, I have nothing at icons.qrc but is does not matter)

    Any help ? Thanks

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

    Default Re: Is it possible to say to Qmake that copy the target to multiple destination?

    Your code doesn't make sense (even if the system call was correct). You don't want to execute the command when qmake is ran but rather after the compilation. You should be taking advantage of the "make install" target although I still fail to understand why you would want the same file in two places.
    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.


  5. #5
    Join Date
    Sep 2010
    Posts
    654
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    56
    Thanked 1 Time in 1 Post

    Default Re: Is it possible to say to Qmake that copy the target to multiple destination?

    I expected that when build the project with Qtcreator, the content of the .pro file is 'executed' in the order I write it, but it seems I'm doing some strange.
    What does qtcreator with my file ? It generates a makefile and then execute it , ins't it ? And is there any way to wait for the compilation and then execute the system commands ?
    I want to have the same file in two places because it is a plugin dll, so I have to put it at \plugins\designer and at \myplace\mydll.
    I have a \myplace\MYdll included into system path, so every program that needs some dll can find it at this place. (so I dont need to copy my dll's to windows/system or to every folder of my progs).
    I hope you understand my explanation.
    Thanks

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

    Default Re: Is it possible to say to Qmake that copy the target to multiple destination?

    Quote Originally Posted by tonnot View Post
    I expected that when build the project with Qtcreator, the content of the .pro file is 'executed' in the order I write it
    No, not really.

    What does qtcreator with my file ?
    It calls qmake and make.
    And is there any way to wait for the compilation and then execute the system commands ?
    Yes, you use the QMAKE_POST_LINK variable for that.

    I want to have the same file in two places because it is a plugin dll, so I have to put it at \plugins\designer and at \myplace\mydll.
    What for? If I correctly understand what you are doing then you should split your dll into two libraries where one is a plugin and the other is a functionality provided that the plugin links against. Then you have two libraries and each goes into its proper place.
    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.


  7. #7
    Join Date
    Sep 2010
    Posts
    654
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    56
    Thanked 1 Time in 1 Post

    Default Re: Is it possible to say to Qmake that copy the target to multiple destination?

    The library is the same, I have
    Qt Code:
    1. DEFINES +=APCPLUG_LIB at .pro
    To copy to clipboard, switch view to plain text mode 
    and
    Qt Code:
    1. #if defined(APCPLUG_LIB)
    2. #define A_TABLESHARED_EXPORT Q_DECL_EXPORT
    To copy to clipboard, switch view to plain text mode 
    at every .h of every custom widget I have .

    It works for me. I have the dll as a plugin for designer and also for my project.
    I'm doing it well isn't ?
    I'm going to see QMAKE_POST_LINK
    Thanks

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

    Default Re: Is it possible to say to Qmake that copy the target to multiple destination?

    Quote Originally Posted by tonnot View Post
    I'm doing it well isn't ?
    I would disagree.
    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. Replies: 2
    Last Post: 22nd November 2010, 21:49
  2. lp error : no default destination available
    By daudiam in forum Newbie
    Replies: 4
    Last Post: 17th October 2010, 19:46
  3. mingw32-make : multiple target patterns error
    By tsemer in forum Installation and Deployment
    Replies: 2
    Last Post: 6th November 2007, 14:54
  4. Multiple destination target
    By mdecandia in forum Qt Programming
    Replies: 9
    Last Post: 13th June 2007, 16:42
  5. Multiple target patterns in Makefile
    By mea36 in forum Newbie
    Replies: 12
    Last Post: 15th November 2006, 07:47

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.