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
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
To copy to clipboard, switch view to plain text mode
Bookmarks