Results 1 to 2 of 2

Thread: Problem with Copy a directory using pro & qmake

  1. #1
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Problem with Copy a directory using pro & qmake

    Hi,

    When building a lib or app, I need to copy a config directory into a specific place. The config directory is needed during run time, but not during compile or link stage.

    However, qmake sets the build target to be dependent on the config directory, so when config directory is changed, gmake attempts to relink the library or app.

    Is there a way to prevent qmake doing so? Thanks!

    Here is my pro file:

    Qt Code:
    1. COPY_CONFIG = myConfigDir/subConfigDir
    2. copy_config_cmd.input = COPY_CONFIG
    3. copy_config_cmd.output = $${PLATFORM_DEST}/Config/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
    4. copy_config_cmd.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
    5. copy_config_cmd.CONFIG += no_link_no_clean
    6. copy_config_cmd.variable_out = PRE_TARGETDEPS
    7. QMAKE_EXTRA_COMPILERS += copy_config_cmd
    To copy to clipboard, switch view to plain text mode 

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

    Default Re: Problem with Copy a directory using pro & qmake

    Maybe use INSTALLS instead of QMAKE_EXTRA_COMPILERS and allow to override the directory with an env variable?
    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: 5
    Last Post: 22nd November 2012, 03:46
  2. Replies: 2
    Last Post: 15th July 2010, 12:45
  3. Copy a Qt project to another directory
    By QtFan19 in forum Qt Programming
    Replies: 6
    Last Post: 30th December 2009, 08:22
  4. Copy Directory Recusively
    By hkothari in forum Qt Programming
    Replies: 4
    Last Post: 22nd August 2009, 12:43
  5. Replies: 4
    Last Post: 24th February 2006, 10:30

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.