diff --git a/ground/openpilotgcs/copydata.pro b/ground/openpilotgcs/copydata.pro index 3ececc457..bf9d7b4d7 100644 --- a/ground/openpilotgcs/copydata.pro +++ b/ground/openpilotgcs/copydata.pro @@ -1,6 +1,6 @@ include(openpilotgcs.pri) -TEMPLATE = subdirs +TEMPLATE = aux # Copy Qt runtime libraries into the build directory (to run or package) equals(copyqt, 1) { @@ -26,8 +26,9 @@ equals(copyqt, 1) { data_copy.commands += $(COPY_DIR) $$targetPath(\"$$[QT_INSTALL_QML]/$$dir\") $$targetPath(\"$$GCS_QT_QML_PATH/$$dir\") $$addNewline() } - data_copy.target = FORCE + data_copy.depends = FORCE QMAKE_EXTRA_TARGETS += data_copy + PRE_TARGETDEPS += data_copy linux { diff --git a/ground/openpilotgcs/share/copydata.pro b/ground/openpilotgcs/share/copydata.pro new file mode 100644 index 000000000..2b3a89b6e --- /dev/null +++ b/ground/openpilotgcs/share/copydata.pro @@ -0,0 +1,26 @@ +include(../openpilotgcs.pri) + +TEMPLATE = aux + +DATACOLLECTIONS = cloudconfig default_configurations dials models pfd sounds diagrams mapicons stylesheets + +equals(copydata, 1) { + for(dir, DATACOLLECTIONS) { + exists($$GCS_SOURCE_TREE/share/openpilotgcs/$$dir) { + # Qt make macros (CHK_DIR_EXISTS, COPY_DIR, etc) have different syntax. They cannot be used + # reliably to copy subdirectories in two different Windows environments (bash and cmd/QtCreator). + # So undocumented QMAKE_SH variable is used to find out the real environment. + !isEmpty(QMAKE_SH) { + # sh environment (including Windows bash) + data_copy.commands += $(MKDIR) $$targetPath(\"$$GCS_DATA_PATH/$$dir\") $$addNewline() + data_copy.commands += $(COPY_DIR) $$targetPath(\"$$GCS_SOURCE_TREE/share/openpilotgcs/$$dir\") $$targetPath(\"$$GCS_DATA_PATH/\") $$addNewline() + } else { + # native Windows cmd environment + data_copy.commands += $(COPY_DIR) $$targetPath(\"$$GCS_SOURCE_TREE/share/openpilotgcs/$$dir\") $$targetPath(\"$$GCS_DATA_PATH/$$dir\") $$addNewline() + } + } + } + data_copy.depends = FORCE + QMAKE_EXTRA_TARGETS += data_copy + PRE_TARGETDEPS += data_copy +} diff --git a/ground/openpilotgcs/share/share.pro b/ground/openpilotgcs/share/share.pro index 7a4fe575a..c4d845b95 100644 --- a/ground/openpilotgcs/share/share.pro +++ b/ground/openpilotgcs/share/share.pro @@ -1,26 +1,5 @@ -include(../openpilotgcs.pri) - TEMPLATE = subdirs -SUBDIRS = openpilotgcs/translations -DATACOLLECTIONS = cloudconfig default_configurations dials models pfd sounds diagrams mapicons stylesheets +SUBDIRS = openpilotgcs/translations copydata -equals(copydata, 1) { - for(dir, DATACOLLECTIONS) { - exists($$GCS_SOURCE_TREE/share/openpilotgcs/$$dir) { - # Qt make macros (CHK_DIR_EXISTS, COPY_DIR, etc) have different syntax. They cannot be used - # reliably to copy subdirectories in two different Windows environments (bash and cmd/QtCreator). - # So undocumented QMAKE_SH variable is used to find out the real environment. - !isEmpty(QMAKE_SH) { - # sh environment (including Windows bash) - data_copy.commands += $(MKDIR) $$targetPath(\"$$GCS_DATA_PATH/$$dir\") $$addNewline() - data_copy.commands += $(COPY_DIR) $$targetPath(\"$$GCS_SOURCE_TREE/share/openpilotgcs/$$dir\") $$targetPath(\"$$GCS_DATA_PATH/\") $$addNewline() - } else { - # native Windows cmd environment - data_copy.commands += $(COPY_DIR) $$targetPath(\"$$GCS_SOURCE_TREE/share/openpilotgcs/$$dir\") $$targetPath(\"$$GCS_DATA_PATH/$$dir\") $$addNewline() - } - } - } - data_copy.target = FORCE - QMAKE_EXTRA_TARGETS += data_copy -} +copydata.file = copydata.pro diff --git a/ground/openpilotgcs/src/libs/sdlgamepad/copydata.pro b/ground/openpilotgcs/src/libs/sdlgamepad/copydata.pro index 4fa7cb219..91cc5292c 100644 --- a/ground/openpilotgcs/src/libs/sdlgamepad/copydata.pro +++ b/ground/openpilotgcs/src/libs/sdlgamepad/copydata.pro @@ -8,11 +8,9 @@ equals(copydata, 1) { data_copy.commands += $(COPY_FILE) $$targetPath(\"$${SDL_DIR}/bin/$$dll\") $$targetPath(\"$$GCS_APP_PATH/$$dll\") $$addNewline() } - # add make target - POST_TARGETDEPS += copydata - - data_copy.target = copydata + data_copy.depends = FORCE QMAKE_EXTRA_TARGETS += data_copy + PRE_TARGETDEPS += data_copy } } diff --git a/ground/openpilotgcs/src/plugins/hitl/aerosimrc/src/plugin.pro b/ground/openpilotgcs/src/plugins/hitl/aerosimrc/src/plugin.pro index dab7ba70a..dc809e67d 100644 --- a/ground/openpilotgcs/src/plugins/hitl/aerosimrc/src/plugin.pro +++ b/ground/openpilotgcs/src/plugins/hitl/aerosimrc/src/plugin.pro @@ -65,7 +65,8 @@ equals(copydata, 1) { # data_copy.commands += $(COPY_FILE) $$targetPath(\"$$(QTMINGW)/$$dll\") $$targetPath(\"$$SIM_DIR/$$dll\") $$addNewline() #} - data_copy.target = FORCE + data_copy.depends = FORCE QMAKE_EXTRA_TARGETS += data_copy + PRE_TARGETDEPS += data_copy } } diff --git a/ground/uavobject-synthetics/uavobject-synthetics.pro b/ground/uavobject-synthetics/uavobject-synthetics.pro index 1f974ae80..85e53d139 100644 --- a/ground/uavobject-synthetics/uavobject-synthetics.pro +++ b/ground/uavobject-synthetics/uavobject-synthetics.pro @@ -3,7 +3,7 @@ # Copyright (c) 2009-2013, The OpenPilot Team, http://www.openpilot.org # -TEMPLATE = subdirs +TEMPLATE = aux # Some handy defines defineReplace(targetPath) { @@ -64,5 +64,6 @@ win32 { uavobjects.commands += -spec $$SPEC CONFIG+=$${BUILD_CONFIG} -r $$addNewline() } -uavobjects.target = FORCE +uavobjects.depends = FORCE QMAKE_EXTRA_TARGETS += uavobjects +PRE_TARGETDEPS += uavobjects