1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-1792 Makefile tidy: Fix up the 'copydata.pro's to depend on FORCE, not be FORCE, and be aux template, not subdirs template.

This commit is contained in:
James Duley 2015-03-25 09:27:00 +13:00
parent 4f50be6a44
commit 3a08642b40
6 changed files with 38 additions and 32 deletions

View File

@ -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 {

View File

@ -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
}

View File

@ -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

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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