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