PDA

View Full Version : Problem with Copy a directory using pro & qmake



lni
10th December 2012, 07:57
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:



COPY_CONFIG = myConfigDir/subConfigDir
copy_config_cmd.input = COPY_CONFIG
copy_config_cmd.output = $${PLATFORM_DEST}/Config/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
copy_config_cmd.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
copy_config_cmd.CONFIG += no_link_no_clean
copy_config_cmd.variable_out = PRE_TARGETDEPS
QMAKE_EXTRA_COMPILERS += copy_config_cmd

wysota
10th December 2012, 11:40
Maybe use INSTALLS instead of QMAKE_EXTRA_COMPILERS and allow to override the directory with an env variable?